btcpayserver / btcpayserver-docker

Docker resources for hosting BTCPayServer easily
MIT License
584 stars 358 forks source link

Restart errors #242

Closed Goosie closed 4 years ago

Goosie commented 4 years ago

After 5 weeks the sync running on my raspberry 3, last night it seems probably everything should be synced. Unfortunately the site gave an 404 error something with nginx. SSH into the rasp, rebooted and trying to restart by doing ./btcpay-update.sh under root I run into all kind of bad errors. Like:

etc..

Trying to solve this by restarting the raspberry, sometimes by an hard reboot, putting the power off and on I run into more troubles like:

./btcpay-update.sh gives: /etc/profile.d/btcpay-env.sh: line 1: =2: command not found

./btcpay-up.sh gives: /etc/profile.d/btcpay-env.sh: line 1: Nov: command not found /etc/profile.d/btcpay-env.sh: line 2: Nov: command not found /etc/profile.d/btcpay-env.sh: line 3: Nov: command not found /etc/profile.d/btcpay-env.sh: line 4: Nov: command not found

Whats going on here? How get this in the air again?

Thanks

Goosie commented 4 years ago

Trying to tun the install script . ./btcpay-setup.sh -i I run into: -------SETUP----------- Parameters passed: BTCPAY_PROTOCOL:https BTCPAY_HOST:my.btcexperiments.com BTCPAY_ADDITIONAL_HOSTS: REVERSEPROXY_HTTP_PORT:80 REVERSEPROXY_HTTPS_PORT:443 REVERSEPROXY_DEFAULT_HOST:none LIBREPATRON_HOST: WOOCOMMERCE_HOST: BTCTRANSMUTER_HOST: BTCPAY_ENABLE_SSH:true BTCPAY_HOST_SSHKEYFILE: LETSENCRYPT_EMAIL: NBITCOIN_NETWORK:mainnet LIGHTNING_ALIAS: BTCPAYGEN_CRYPTO1:btc BTCPAYGEN_CRYPTO2: BTCPAYGEN_CRYPTO3: BTCPAYGEN_CRYPTO4: BTCPAYGEN_CRYPTO5: BTCPAYGEN_CRYPTO6: BTCPAYGEN_CRYPTO7: BTCPAYGEN_CRYPTO8: BTCPAYGEN_CRYPTO9: BTCPAYGEN_REVERSEPROXY:nginx BTCPAYGEN_LIGHTNING:lnd BTCPAYGEN_ADDITIONAL_FRAGMENTS:opt-save-storage-xs;opt-save-memory BTCPAYGEN_EXCLUDE_FRAGMENTS: BTCPAY_IMAGE: ACME_CA_URI:production TOR_RELAY_NICKNAME: TOR_RELAY_EMAIL:

Additional exported variables: BTCPAY_DOCKER_COMPOSE=/root/btcpayserver/btcpayserver-docker/Generated/docker-compose.generated.yml BTCPAY_BASE_DIRECTORY=/root/btcpayserver BTCPAY_ENV_FILE=/root/btcpayserver/.env BTCPAYGEN_OLD_PREGEN=false BTCPAY_SSHKEYFILE=/datadir/host_id_rsa BTCPAY_SSHAUTHORIZEDKEYS=/datadir/host_authorized_keys BTCPAY_HOST_SSHAUTHORIZEDKEYS:/root/.ssh/authorized_keys BTCPAY_SSHTRUSTEDFINGERPRINTS: BTCPAY_CRYPTOS:btc BTCPAY_ANNOUNCEABLE_HOST:my.btcexperiments.com

BTCPay Server environment variables successfully saved in /etc/profile.d/btcpay-env.sh

BTCPay Server docker-compose parameters saved in /root/btcpayserver/.env

Using default tag: latest Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?. See 'docker run --help'. Failed to generate the docker-compose

Seems my docker is not running?! Doing dockerd I get: INFO[2019-12-05T09:14:55.011553078Z] Starting up
WARN[2019-12-05T09:14:55.031776774Z] could not change group /var/run/docker.sock to docker: group docker not found INFO[2019-12-05T09:14:55.039854273Z] parsed scheme: "unix" module=grpc INFO[2019-12-05T09:14:55.040159273Z] scheme "unix" not registered, fallback to default scheme module=grpc INFO[2019-12-05T09:14:55.040427867Z] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock 0 }] } module=grpc INFO[2019-12-05T09:14:55.040623700Z] ClientConn switching balancer to "pick_first" module=grpc WARN[2019-12-05T09:14:55.042572294Z] grpc: addrConn.createTransport failed to connect to {unix:///run/containerd/containerd.sock 0 }. Err :connection error: desc = "transport: Error while dialing dial unix /run/containerd/containerd.sock: connect: connection refused". Reconnecting... module=grpc failed to start daemon: failed to dial "/run/containerd/containerd.sock": all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial unix /run/containerd/containerd.sock: connect: connection refused": unavailable

NicolasDorier commented 4 years ago

hey sorry for not coming back to you earlier. Taking a look

NicolasDorier commented 4 years ago

This is not normal.

/etc/profile.d/btcpay-env.sh: line 1: Nov: command not found

Can you show me what you have there with

cat /etc/profile.d/btcpay-env.sh ?

Goosie commented 4 years ago

Ah thanks. Wel put the power again on the raspberry, login with ssh and all kind of messages came up like: image

I will wait what happpens now on pid 4207. Can't stop this, CTRL-C does nothing.

Goosie commented 4 years ago

Oke restart it again, did the command

cat /etc/profile.d/btcpay-env.sh

and got this:

!/bin/bash

export COMPOSE_HTTP_TIMEOUT="180" export BTCPAYGEN_OLD_PREGEN="false" export BTCPAYGEN_CRYPTO1="btc" export BTCPAYGEN_CRYPTO2="" export BTCPAYGEN_CRYPTO3="" export BTCPAYGEN_CRYPTO4="" export BTCPAYGEN_CRYPTO5="" export BTCPAYGEN_CRYPTO6="" export BTCPAYGEN_CRYPTO7="" export BTCPAYGEN_CRYPTO8="" export BTCPAYGEN_CRYPTO9="" export BTCPAYGEN_LIGHTNING="lnd" export BTCPAYGEN_REVERSEPROXY="nginx" export BTCPAYGEN_ADDITIONAL_FRAGMENTS="opt-save-storage-xs;opt-save-memory" export BTCPAYGEN_EXCLUDE_FRAGMENTS="" export BTCPAY_DOCKER_COMPOSE="/root/btcpayserver/btcpayserver-docker/Generated/docker-compose.generated.yml" export BTCPAY_BASE_DIRECTORY="/root/btcpayserver" export BTCPAY_ENV_FILE="/root/btcpayserver/.env" export BTCPAY_HOST_SSHKEYFILE="" export BTCPAY_ENABLE_SSH=true if cat "$BTCPAY_ENV_FILE" &> /dev/null; then while IFS= read -r line; do ! [[ "$line" == "#" ]] && [[ "$line" == "="* ]] && export "$line" done < "$BTCPAY_ENV_FILE" fi

Goosie commented 4 years ago

When I do after login: sudo su - cd btcpayserver cd btcpayserver cd btcpayserver-docker

And than ./btcpay-update.sh I get fatal: unable to access 'https://github.com/btcpayserver/btcpayserver-docker/': Could not resolve host: github.com

When I do: ./btcpay-restart.sh

I get: Restarting letsencrypt-nginx-proxy-companion ... Restarting nginx-gen ... Restarting nginx ... error Restarting tor-gen ... Restarting generated_lnd_bitcoin_rtl_1 ... Restarting generated_btcpayserver_1 ... Restarting btcpayserver_lnd_bitcoin ... Restarting btcpayserver_bitcoind ... Restarting tor ... Restarting generated_nbxplorer_1 ... Restarting generated_postgres_1 ... helpers.sh: line 134: 4800 Illegal instruction docker-compose -f $BTCPAY_DOCKER_COMPOSE restart -t "${COMPOSE_HTTP_TIMEOUT:-180}" Restarting letsencrypt-nginx-proxy-companion ... error Restarting nginx-gen ... error Restarting nginx ... error Restarting tor-gen ... error Restarting generated_lnd_bitcoin_rtl_1 ... done Restarting generated_btcpayserver_1 ... done Restarting btcpayserver_lnd_bitcoin ... done Restarting btcpayserver_bitcoind ... done Restarting tor ... error Restarting generated_nbxplorer_1 ... done Restarting generated_postgres_1 ... done

ERROR: for nginx Cannot restart container a180b5d5720bc155fdf34f588d2c71304bbfa6cd375629e6c993d17ea088b5db: driver failed programming external connectivity on endpoint nginx (3004c07402f1eabbf001300cdf9a1aed36cacb71a944dd9596d2a90b4c782f99): Bind for 0.0.0.0:443 failed: port is already allocated

ERROR: for nginx-gen Cannot restart container ae1d41a311d7da3392474ada7ffcf88ae3c0db4858327092c6b074a393b06dc6: write /var/lib/containerd/io.containerd.metadata.v1.bolt/meta.db: structure needs cleaning: unknown

ERROR: for tor-gen Cannot restart container 57e35e52f2090057910d0e041c4986ce2fdb6512255e0735f6d2eb23295a5064: write /var/lib/containerd/io.containerd.metadata.v1.bolt/meta.db: structure needs cleaning: unknown

ERROR: for tor Cannot restart container 9ce57bd7eb855d35e0de1d0b71921b07a64b33e318d313844d3f135f6f60e21d: write /var/lib/containerd/io.containerd.metadata.v1.bolt/meta.db: structure needs cleaning: unknown

ERROR: for letsencrypt-nginx-proxy-companion Cannot restart container c10363406fe89569903a89fdebb23d7229f2578df4910aac9e07b684dfdd5c7d: write /var/lib/containerd/io.containerd.metadata.v1.bolt/meta.db: structure needs cleaning: unknown root@raspberrypi:~/btcpayserver/btcpayserver-docker# cd btcpayserver-docker/

Goosie commented 4 years ago

I see something. Port is already allocated. Mmmmmm

Goosie commented 4 years ago

No, I'm stuck. Tried again by starting /.btcpay-up.sh run into stufff like this: ERROR: for tor Cannot start service tor: transport is closing: unavailable

ERROR: for tor Cannot start service tor: transport is closing: unavailable ERROR: Encountered errors while bringing up the project. helpers.sh: line 105: 12526 Illegal instruction docker-compose -f $BTCPAY_DOCKER_COMPOSE up --remove-orphans -d

Goosie commented 4 years ago

What can I do the best, without having the lost of 5 weeks syncing?

NicolasDorier commented 4 years ago

@Goosie do a btcpay-down.sh this will close all your containers.

Then try to restart, make sure that after the restart, no container should be started.

You have errors on bash scripts like Illegal instruction, but all the scripts are correct. Have you done anything strange to your bash environment which can't properly run the scripts anymore?

Try running /etc/profile.d/btcpay-env.sh and check if you have any error again.

Raspberry 3 is quite unpowered, but should work.

Goosie commented 4 years ago

/etc/profile.d/btcpay-env.sh gives: -bash: /etc/profile.d/btcpay-env.sh: cannot execute binary file: Exec format error

Seems there is something terrible wrong. What if I install from scratch. Is the synced data installed on the sd card or on the USB?

Goosie commented 4 years ago

I flashed my sd card again. Added ssh in the boot. put the sd card back, put the power on and strange enough everything came in the air. I was confused that i had to use my old password for ssh.
Seems it's working now to get the last 1% synced.

Goosie commented 4 years ago

Unfortunately... node is going offline: What is this? https://my.btcexperiments.com

Goosie commented 4 years ago

When i do btcpay-restart.sh I get

root@raspberrypi:~/btcpayserver/btcpayserver-docker# ./btcpay-restart.sh [6428] mod is NULL - structTraceback (most recent call last): File "/usr/local/lib/python3.6/struct.py", line 13, in ImportError: /tmp/_MEIqzXEUn/_struct.so: invalid ELF header [6428] mod is NULL - pyimod02_archiveTraceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/PyInstaller/loader/pyimod02_archive.py", line 28, in ModuleNotFoundError: No module named 'struct' [6428] mod is NULL - pyimod03_importersTraceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 24, in ModuleNotFoundError: No module named 'pyimod02_archive' Traceback (most recent call last): File "site-packages/PyInstaller/loader/pyiboot01_bootstrap.py", line 15, in ModuleNotFoundError: No module named 'pyimod03_importers' [6428] Failed to execute script pyiboot01_bootstrap [6433] Error loading Python lib '/tmp/_MEIzVelJY/libpython3.6m.so.1.0': dlopen: /tmp/_MEIzVelJY/libpython3.6m.so.1.0: invalid ELF header

Goosie commented 4 years ago

When I do btcpay-down.sh I get [6882] Failed to execute script pyiboot01_bootstrap [6887] Error loading Python lib '/tmp/_MEIfR4jru/libpython3.6m.so.1.0': dlopen: /tmp/_MEIfR4jru/libpython3.6m.so.1.0: invalid ELF header

pavlenex commented 4 years ago

It's online for me. You have to perform a FastSync, RPI is not powerful enough to sync from the genesis block.

Goosie commented 4 years ago

Even when I'm on the last 1%? I can get in the air now but after 10 minutes the node goes offline in one way or another.

pavlenex commented 4 years ago

Those all sound like CPU issues to me, RPI3 is just not stable enough with 1GB RAM.

Goosie commented 4 years ago

Than should't we remove the installation on raspberry 3 out of the manual?

pavlenex commented 4 years ago

I am not sure, perhaps we should put a warning and say it's not meant for production and recommend RPI4 , I set up mine on Raspberry Pi 3 Model B without any issues with FastSync, though I'm not sure if it went down a few times during the setup, it probably did but I haven't followed it, just left it overnight.

RPI3 guide can pretty much be applied on RPI4 as well, so I wouldn't remove it for sure.

Goosie commented 4 years ago

I have it running now on a heavier machine, seems it worked out. reason I choose not the fastsync is to the warning. Trust yourself only :-)

pavlenex commented 4 years ago

Well unless it's your own hardware, syncing on a machine owned by a third-party bears the same risks.

I'll go ahead and close this one then, let us know if it's not fixed and we'll re-open it.

NicolasDorier commented 4 years ago

Hey yeah seems something has gone crazy on the hardware level here.

@Goosie note that you can fully sync on a beefy machine, and use fast sync on a weak machine, we documented how you can then make sure that fast sync was successful by comparing the utxoset hash of the beefy machine with the weak one.