Skip to content

Instantly share code, notes, and snippets.

@lyoshenka
Last active November 27, 2019 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lyoshenka/2557c08344bfe1020f0c0a13b9c5b0ce to your computer and use it in GitHub Desktop.
Save lyoshenka/2557c08344bfe1020f0c0a13b9c5b0ce to your computer and use it in GitHub Desktop.
@mirgee
Copy link

mirgee commented Sep 29, 2019

When you mount volume to the container with --volume database:/database, docker drops privileges for the file back to root, and then since the entrypoint script is run as lbry user, the snapshot extraction fails. Maybe you should first create a ./database directory somewhere on the host and set privileges with the same uid and gid as for lbry user within the container, i.e. chown -R 999:999 ./database? Or just run the server with gosu.

@lyoshenka
Copy link
Author

lyoshenka commented Oct 10, 2019

@mirgee You're seeing that happen on a fresh Ubuntu install? When I run these steps, the extraction and permissions work out correctly. Here's what I'm seeing immediately after going through the above setup:

$ sudo docker volume ls
DRIVER              VOLUME NAME
local               database
$ sudo docker volume inspect database | grep Mount
        "Mountpoint": "/var/lib/docker/volumes/database/_data",
$ sudo su
# cd /var/lib/docker/volumes/database/_data
# ll -h
total 4.2G
drwxr-xr-x 5  999 docker 4.0K Oct 10 19:12 ./
drwxr-xr-x 3 root root   4.0K Oct 10 19:02 ../
-rw-r--r-- 1  999 docker 4.1G Oct 10 19:12 claims.db
-rw-r--r-- 1  999 docker 320K Oct 10 19:13 claims.db-shm
-rw-r--r-- 1  999 docker 161M Oct 10 19:13 claims.db-wal
drwxr-xr-x 2  999 docker 4.0K Oct 10 19:12 hist/
drwxr-xr-x 2  999 docker  12K Sep 13 19:53 meta/
drwxr-xr-x 2  999 docker 4.0K Oct 10 19:12 utxo/

Can you help me reproduce this? Maybe I'm missing something?

@lyoshenka
Copy link
Author

tagged the wrong person above. meant to tag @mirgee

@ceoger
Copy link

ceoger commented Oct 10, 2019

i'm able to run the wallet server successfully and instructions were simple enough so i did not take help

@mirgee
Copy link

mirgee commented Oct 10, 2019

@lyoshenka, not fresh, but older Ubuntu 16.04 install, Docker version 19.03.2, and I followed the instructructions to the point (made sure to reinstall Docker). I think Docker was creating db directory in /opt/ at runtime with root only permissions, so I had to manually create a directory elsewhere with proper permissions and run --volume ./database:/database. I will try to reproduce it again later.

@tzarebczan
Copy link

@lyoshenka, can you also provide instructions on how to run the wallet server after reboot/initial startup?

@lyoshenka
Copy link
Author

@tzarebczan you can use docker [start|stop] wallet-server to start or stop the server after reboot or any other time

@ceoger
Copy link

ceoger commented Oct 29, 2019

thanks tom and grin: sudo docker start wallter-server starts the server and sudo docker stop wallet-server stops it. Use sudo docker logs -f wallet-server to see live logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment