Skip to content

Instantly share code, notes, and snippets.

@lyoshenka
Last active Nov 27, 2019
Embed
What would you like to do?
@mirgee

This comment has been minimized.

Copy link

@mirgee 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

This comment has been minimized.

Copy link
Owner Author

@lyoshenka 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

This comment has been minimized.

Copy link
Owner Author

@lyoshenka lyoshenka commented Oct 10, 2019

tagged the wrong person above. meant to tag @mirgee

@ceoger

This comment has been minimized.

Copy link

@ceoger 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

This comment has been minimized.

Copy link

@mirgee 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

This comment has been minimized.

Copy link

@tzarebczan tzarebczan commented Oct 29, 2019

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

@lyoshenka

This comment has been minimized.

Copy link
Owner Author

@lyoshenka lyoshenka commented Oct 29, 2019

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

@ceoger

This comment has been minimized.

Copy link

@ceoger 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