Closed appetrosyan closed 1 year ago
Dear @appetrosyan,
Thank you so much for opening this bug. After some debugging, I've found some nits that need to be adapted in order to make the compose.yaml
run as expected. Please take a look at this yaml snippet:
version: '3'
services:
celestia:
user: 10001:10001
image: ghcr.io/rollkit/local-celestia-devnet:v0.11.0-rc12
volumes:
- ./.local_data/celestia:/home/celestia
ports:
- "26657:26657"
- "26658:26658"
- "26659:26659"
- "9090:9090"
#use ganache for now
eth:
image: trufflesuite/ganache:latest
ports:
- "8545:8545"
volumes:
- ./.local_data/ganache_data:/ganache_data
command:
- --database.dbPath=/ganache_data
- -m
- 'minimum symptom minute gloom tragic situate silver mechanic salad amused elite beef'
- -h
- '0.0.0.0'
As you can see, we have missed the user group assignment in docker-compose. After we've provided the user: 10001:10001
(which is equal to user: celestia:celestia
), the celestia app/node part is going to be started as expected.
I hope you are fine that ganache part has been redacted to make sure you can have expected behaviour of eth local blockchain. ganache-cli has been ditched in favour of ganache image. In addition, the image is using commands as args flags etc, so we have command instead of entrypoint.
Let me know if it looks fine for you.
Here is proof that this solution works in my mac: https://app.warp.dev/block/pLcBHNpAOdPlEA34iRlWkv
Cheers
It didn't exactly solve my problem.
app@antares ~/G/s/docker (main)> docker compose --file docker-compose-revised.yml up --force-recreate
[+] Running 2/2
✔ Container docker-eth-1 Recreated 0.1s
✔ Container docker-celestia-1 Recreated 0.1s
Attaching to docker-celestia-1, docker-eth-1
docker-celestia-1 | The folder /home/celestia/.celestia-app does not exist.
docker-celestia-1 | Error: couldn't make client config: mkdir /home/celestia/.celestia-app: permission denied
docker-celestia-1 | Error: couldn't make client config: mkdir /home/celestia/.celestia-app: permission denied
docker-celestia-1 | Error: couldn't make client config: mkdir /home/celestia/.celestia-app: permission denied
docker-celestia-1 | Error: accepts 2 arg(s), received 1
docker-celestia-1 | Error: couldn't make client config: mkdir /home/celestia/.celestia-app: permission denied
docker-celestia-1 | Error: couldn't make client config: mkdir /home/celestia/.celestia-app: permission denied
docker-celestia-1 | sed: /home/celestia/.celestia-app/config/config.toml: No such file or directory
docker-celestia-1 | sed: /home/celestia/.celestia-app/config/config.toml: No such file or directory
docker-celestia-1 | sed: /home/celestia/.celestia-app/config/config.toml: No such file or directory
docker-celestia-1 | sed: /home/celestia/.celestia-app/config/config.toml: No such file or directory
docker-celestia-1 | sed: /home/celestia/.celestia-app/config/config.toml: No such file or directory
docker-celestia-1 | mkdir: can't create directory '/home/celestia/bridge//': Permission denied
docker-celestia-1 | cp: can't stat '/home/celestia/.celestia-app/keyring-test/': No such file or directory
docker-celestia-1 | Error: couldn't make client config: mkdir /home/celestia/.celestia-app: permission denied
I think it's probably something on our end, but it'd be nice if your experts could help us track down the problem.
@appetrosyan will you make a public repo with exact setup of the current docker-compose.yml? I'll pull it down and try and re-create too then work through it with you
I found the culprit
@appetrosyan amazing, let us know what it was
So we're still not quite operational yet (it's a different error message), but here's what it was. The files created by entrypoint.sh
were created as root
, with 0600
permissions. So it wasn't even possible to figure out if the directory existed.
Weirdly, only setting it to chmod 707
(it's really weird, but I checked other less permissive combinations), allowed the process to get past the initial stage.
Now the program terminates with a segfault using this Dockerfile
# from https://github.com/rollkit/local-celestia-devnet
FROM ghcr.io/celestiaorg/celestia-app:v1.0.0-rc14 AS celestia-app
FROM ghcr.io/celestiaorg/celestia-node:v0.11.0-rc12
USER root
# hadolint ignore=DL3018
RUN apk --no-cache add \
curl \
jq \
&& mkdir /bridge \
&& chown celestia:celestia /bridge
USER celestia
COPY --from=celestia-app /bin/celestia-appd /bin/
COPY entrypoint.sh /opt/entrypoint.sh
EXPOSE 26657 26658 26659 9090
ENTRYPOINT [ "/bin/bash", "/opt/entrypoint.sh" ]
I'm really surprised and a little baffled by that both the owner and everyone else require the execution right. This might be related to the segfault, maybe something gets executed, instead of being interpreted as plain data?
However, if we use the ghcr.io/rollkit/local-celestia-devnet:v0.11.0-rc12
image, everything works fine, so I'm now trying to work out what our image is doing differently.
great! sounds like you are on the path to fixing here, i'm going to close out the issue.
Celestia Node version
ghcr.io/celestiaorg/celestia-app:v1.0.0-rc14
OS
Alpine linux
Install tools
Docker, with docker compose
Others
No response
Steps to reproduce it
Create
docker-compose.yml
with the following contentscelestia
entrypoint.sh
with the following contentsExpected result
Network starts as expected; specifically:
Actual result
Celestia light client fails to start meaning that the following output is produced instead of the expected.
Relevant log output
Notes
Permissions for the actual location have been checked with
chmod 777
to ensure that the permissions were actually set right. It's possible that the location isn't exactly what we expect and the mistake is in thedocker-compose.yml
.This problem can be worked around if in the docker compose file the bind mount is disabled: