[Docker-machine] - Sync /root/.ipfs/blocks: invalid argument

I want to use a shared volume within docker machines (docker-machine)

The volume is mounted ok, also if I add a file inside the docker container I can see it in the folder outside of it (the volume), but when I try to add a file with IPFS I’m getting this message:

root@01dd7cb5f6f2:/uploader# ipfs add file.txt
 49.31 KB / 49.31 KB  100.00% 0s15:38:51.035 ERROR commands/h: sync /root/.ipfs/blocks: invalid argument client.go:247
Error: sync /root/.ipfs/blocks: invalid argument
root@01dd7cb5f6f2:/uploader#  mount | grep ipfs
Users on /root/.ipfs type vboxsf (rw,nodev,relatime)

Docker run command:

docker run -p 3000:3000 -v $PWD/../ipfs-vol:/root/.ipfs -p 4001:4001 -p 5001:5001 -p 8080:808 uploader:latest

Output:

docker run -p 3000:3000 -v $PWD/../ipfs-vol:/root/.ipfs -p 4001:4001 -p 5001:5001 -p 8080:808 uploader:latest

initializing IPFS node at /root/.ipfs
generating 2048-bit RSA keypair...done
peer identity: QmeRzUAEgL6nMfuaEpowocpJRc6msTu8a4NHap8b5Lu4Sw
Error: sync /root/.ipfs/datastore: invalid argument
Initializing daemon...

uploader@1.0.1 start /uploader
nodemon src/server.js

[nodemon] 1.14.12
[nodemon] to restart at any time, enter rs
[nodemon] watching: *.*
[nodemon] starting node src/server.js
Listening on port 3000...
18:09:18.201 ERROR        dht: checking dht client type: connection reset notif.go:81
18:09:18.205 ERROR   cmd/ipfs: error from node construction: failure writing to dagstore: sync /root/.ipfs/blocks: invalid argument daemon.go:335
Error: failure writing to dagstore: sync /root/.ipfs/blocks: invalid argument

IPFS VERSION:

go-ipfs version: 0.4.11-
Repo version: 6
System version: amd64/linux
Golang version: go1.9

Note: If I don’t use a volume, it works.

OS: macOS High Sierra

So, I take it your outer OS is Windows? So, we’re trying to sync the repo directory but one can’t sync directories on Windows. It looks like docker is bubbling the error from window up to us. That’s just lovely… I’ve reported a bug:

Could you run sync /root/.ipfs/blocks for me? Does that return an error?

The OS is macOS High Sierra

Interesting. I wonder if this is a bug in vboxsf.

Could you try running that sync command for me anyways?

Sure, here you are:

root@e4cf2a8520a2:/uploader#  sync /root/.ipfs/blocks
sync: ignoring all arguments

Trying to add a file

root@e4cf2a8520a2:/uploader# ipfs add -r scripts/
Error: failure writing to dagstore: sync /root/.ipfs/blocks: invalid argument

Thanks! So, it looks like vboxsf just doens’t support syncing directories. We’ll have to modify the datastore to ignore “invalid argument” errors in that case.

1 Like

Is there any Issue open or something in progress?

1 Like