Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker share - Archive not writable. #862

Closed
asbjornenge opened this issue Sep 11, 2017 · 5 comments
Closed

Docker share - Archive not writable. #862

asbjornenge opened this issue Sep 11, 2017 · 5 comments

Comments

@asbjornenge
Copy link

Hi guys 😄

I've been experimenting with using dat as a docker volumes replacement. It's been working quite well 🎉 👍 Only issue I'm having is that restarting the share service gives me an error: Archive not writable, cannot use share. Please use sync to resume download..

A quick example:

/Users/asbjorn/tmp/dat-data
❯ docker run --rm -v (pwd)/html:/html -it registry.taghub:5000/dat-data:0.0.1 share /html
dat v13.8.1
Created new dat in /html/.dat
dat://3a2ec47beee3cb74d354908cb7bfe2168616d07d135c22b297251561ef9fe32d
Sharing dat: (empty archive)

1 connection | Download 0 B/s Upload 0 B/s

Watching for file updates

Exiting the Dat program...
/Users/asbjorn/tmp/dat-data
❯ docker run --rm -v (pwd)/html:/html -it registry.taghub:5000/dat-data:0.0.1 share /html
Archive not writable, cannot use share. Please use sync to resume download.

So, I'm starting the share - everything looks good, the .dat folder is created etc. However, restarting with the exact same command gives me the above error. I'm pretty sure it's some docker permissions thing where the uid og gid mismatch or something, but I haven't been able to pin it down. Giving the folder 777 does not seem to help.

So I've been wondering how this dat.writable get's determined and if we can find a clue there somewhere. Any ideas?

To Dockerfile is just:

FROM node:8
RUN npm install -g dat
ENTRYPOINT ["dat"]

Thanks 👍

@asbjornenge
Copy link
Author

Running with DEBUG=dat:

/Users/asbjorn/tmp/dat-data
❯ docker run --rm -e DEBUG=dat -v (pwd)/html:/html -it registry.taghub:5000/dat-data:0.0.1 share /html
  dat dat 13.8.1 +0ms
  dat node v8.4.0 +3ms
  dat Sharing archive { _: [ '/html' ],
  utp: true,
  quiet: true,
  sparse: false,
  import: true,
  ignoreHidden: true,
  'ignore-hidden': true,
  watch: true,
  logspeed: 400,
  port: 3282,
  dir: '/html' } +307ms
Archive not writable, cannot use share. Please use sync to resume download.

@asbjornenge
Copy link
Author

Ok, so it seem to be related to something specific for the container instance? Some variable used in signatures or something like that? (I'm guessing 😛 )

Locally I get the same issue if I try to create a share with a container, and then share with my local dat installation.

// create share `html`
dat share html
// create share `html2` with container
docker run --rm -v (pwd):/dat -it registry.taghub:5000/dat-data:0.0.7 share /dat/html2
// re-share `html2` -> error
dat share html2
// re-share `html` -> works
dat share html

No diff in permissions:

./html/.dat:
total 88
drwxr-xr-x  14 asbjorn  staff   476 11 Sep 14:09 .
drwxr-xr-x   3 asbjorn  staff   102 11 Sep 14:09 ..
-rw-r--r--   1 asbjorn  staff    32 11 Sep 14:09 content.bitfield
-rw-r--r--   1 asbjorn  staff    32 11 Sep 14:09 content.key
-rw-r--r--   1 asbjorn  staff    64 11 Sep 14:09 content.secret_key
-rw-r--r--   1 asbjorn  staff    32 11 Sep 14:09 content.signatures
-rw-r--r--   1 asbjorn  staff    32 11 Sep 14:09 content.tree
-rw-r--r--   1 asbjorn  staff  3360 11 Sep 14:09 metadata.bitfield
-rw-r--r--   1 asbjorn  staff    46 11 Sep 14:09 metadata.data
-rw-r--r--   1 asbjorn  staff    32 11 Sep 14:09 metadata.key
-rw-r--r--   1 asbjorn  staff     0 11 Sep 14:09 metadata.latest
-rw-r--r--   1 asbjorn  staff     1 11 Sep 14:09 metadata.ogd
-rw-r--r--   1 asbjorn  staff    96 11 Sep 14:09 metadata.signatures
-rw-r--r--   1 asbjorn  staff    72 11 Sep 14:09 metadata.tree

./html2/.dat:
total 88
drwxr-xr-x  14 asbjorn  staff   476 11 Sep 14:09 .
drwxr-xr-x   3 asbjorn  staff   102 11 Sep 14:09 ..
-rw-r--r--   1 asbjorn  staff    32 11 Sep 14:09 content.bitfield
-rw-r--r--   1 asbjorn  staff    32 11 Sep 14:09 content.key
-rw-r--r--   1 asbjorn  staff    64 11 Sep 14:09 content.secret_key
-rw-r--r--   1 asbjorn  staff    32 11 Sep 14:09 content.signatures
-rw-r--r--   1 asbjorn  staff    32 11 Sep 14:09 content.tree
-rw-r--r--   1 asbjorn  staff  3360 11 Sep 14:09 metadata.bitfield
-rw-r--r--   1 asbjorn  staff    46 11 Sep 14:09 metadata.data
-rw-r--r--   1 asbjorn  staff    32 11 Sep 14:09 metadata.key
-rw-r--r--   1 asbjorn  staff     0 11 Sep 14:09 metadata.latest
-rw-r--r--   1 asbjorn  staff     1 11 Sep 14:09 metadata.ogd
-rw-r--r--   1 asbjorn  staff    96 11 Sep 14:09 metadata.signatures
-rw-r--r--   1 asbjorn  staff    72 11 Sep 14:09 metadata.tree

@mafintosh
Copy link
Contributor

mafintosh commented Sep 11, 2017 via email

@joehand
Copy link
Collaborator

joehand commented Sep 11, 2017

Unfortunately, looks like there isn't an option and it isn't quite straightforward to add. Our storage APIs are tightly coupled right now ☹️ . This'll be a good reason to improve that though!

Opened issue in dat-storage too dat-ecosystem-archive/dat-storage#6

@asbjornenge
Copy link
Author

Ah, excellent! Suspected it was something like this 😛 I managed to work around it by simply mounting /root/.dat as a volume 👍

docker run --rm -v (pwd)/html:/html -v (pwd)/dat:/root/.dat -it registry.taghub:5000/dat-data:0.0.10 dat share /html

Thanks a bunch 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants