docker-cardano-node icon indicating copy to clipboard operation
docker-cardano-node copied to clipboard

Error: Unpack directory 'db' already exists, please move or delete it -- on arm64

Open TheStophe opened this issue 1 year ago • 2 comments

I'm getting this error in the logs after a few hours of downloading (seen using docker stats). This repeats upon node auto restart continuously.

Running the cardano node ...
CARDANO_BIND_ADDR=0.0.0.0
CARDANO_BLOCK_PRODUCER=false
CARDANO_CONFIG=/opt/cardano/config/mainnet/config.json
CARDANO_DATABASE_PATH=/opt/cardano/data
CARDANO_LOG_DIR=/opt/cardano/logs
CARDANO_NETWORK=mainnet
CARDANO_PORT=3001
CARDANO_RTS_OPTS=-N2 -A64m -I0 -qg -qb --disable-delayed-os-memory-return
CARDANO_SOCKET_PATH=/opt/cardano/ipc/socket
CARDANO_TOPOLOGY=/opt/cardano/config/mainnet/topology.json
AGGREGATOR_ENDPOINT=https://aggregator.release-mainnet.api.mithril.network/aggregator
GENESIS_VERIFICATION_KEY=5b3139312c36362c3134302c3138352c3133382c31312c3233372c3230372c3235302c3134342c32372c322c3138382c33302c31322c38312c3135352c3230342c31302c3137392c37352c32332c3133382c3139362c3231372c352c31342c32302c35372c37392c33392c3137365d
SNAPSHOT_DIGEST=latest
RESTORE_SNAPSHOT=true
Detected empty /opt/cardano/data
Starting: /usr/local/bin/mithril-client snapshot download latest
Error: Unpack directory 'db' already exists, please move or delete it.

So on my archlinux arm64, I pulled the image using

docker pull ghcr.io/blinklabs-io/cardano-node:8.9.1@sha256:4ad71c0a4bbf09c01e93d583d646ea9d951312026968d9173017762b9e814708

From latest package 8.9.1

https://github.com/blinklabs-io/docker-cardano-node/pkgs/container/cardano-node

I run the docker container startup using

docker run --detach \
  --name cardano-node \
  --restart unless-stopped \
  -e CARDANO_BLOCK_PRODUCER=false \
  -e CARDANO_SHELLEY_KES_KEY=/opt/cardano/config/keys/kes.skey \
  -e CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE=/opt/cardano/config/keys/node.cert \
  -e CARDANO_SHELLEY_VRF_KEY=/opt/cardano/config/keys/vrf.skey \
  -v /src/cardano/node-keys:/opt/cardano/config/keys \
  -v /srv/cardano/node-db:/opt/cardano/data \
  -v /srv/cardano/node-ipc:/opt/cardano/ipc \
  -p 3001:3001 \
  -p 12798:12798 \
  ghcr.io/blinklabs-io/cardano-node run

When I check /srv/cardano/node-db after the error posts, the /srv/cardano directory only has the node-keys dir made (node-db) does not exist.

I then deleted the entire container and ran it again with /srv/cardano/node-db directory made. Still the same "Unpack directory db" error.

TheStophe avatar Mar 30 '24 18:03 TheStophe

Note: All my directories for node-db and node-ipc are empty, maybe a permissions thing?

TheStophe avatar Mar 30 '24 19:03 TheStophe

This should be resolved in 8.9.2, where we updated Mithril to a version that has this fixed.

wolf31o2 avatar Apr 25 '24 15:04 wolf31o2

Can you try this again with an 8.9.2 image?

wolf31o2 avatar May 16 '24 15:05 wolf31o2

I tried it again, looks like a slightly different error. At first the docker run command does nothing. Had to chmod the data/db with

sudo chmod -R 777 /opt/cardano/data

then here's the second run.

docker run --detach \
  --name cardano-node \
  -v node-data:/data/db \
  -v node-ipc:/ipc \
  -e NETWORK=mainnet \
  -p 3001:3001 \
  ghcr.io/blinklabs-io/cardano-node
Unable to find image 'ghcr.io/blinklabs-io/cardano-node:latest' locally
latest: Pulling from blinklabs-io/cardano-node
24c63b8dcb66: Pull complete 
a12b6e9b748a: Pull complete 
62be20b5baa3: Pull complete 
ea886906694e: Pull complete 
ac7de4e75967: Pull complete 
61554dfd8e50: Pull complete 
1f4970e6d624: Pull complete 
bb36e65edab6: Pull complete 
19935bfaf91b: Pull complete 
b8fe1fe916fa: Pull complete 
c39035ae3bda: Pull complete 
Digest: sha256:b96244e7b3bc0ff0cfb440831c43faf633e3c0ae6bb3d1b2fe747e84408e7bba
Status: Downloaded newer image for ghcr.io/blinklabs-io/cardano-node:latest
f8654f1a4b7034471c880a7b996bae3e5c5041a030f85b2d05ec792fe55f2717

<user> in ~/cardano/docker-cardano-node
± |main ✓| → docker logs -f -n 500 cardano-node
Starting: /usr/local/bin/mithril-client cardano-db download 2cbb33a094459b988bac95cc964798c4e5d73cfd3eeaa4be9cfc436144746303
Error: Can not get download and unpack cardano db for digest: '2cbb33a094459b988bac95cc964798c4e5d73cfd3eeaa4be9cfc436144746303'

Caused by:
    0: Download: Could not read from byte stream
    1: error decoding response body: error reading a body from connection
    2: error reading a body from connection
    3: end of file before message length reached

TheStophe avatar Jun 09 '24 19:06 TheStophe