0

I'm running the following docker command:

docker run -v /data/polygon/mainnet:/data ghcr.io/streamingfast/firehose-ethereum:v1.2.2-polygon-v0.3.2-fh2.1 start reader-node --common-chain-id=137 --common-network-id=137 --data-dir=/data <other args>"

Note that I'm mounting /data/polygon/mainnet to /data and that /data is being used as the data-dir arg.

When this container starts up, it creates files and folders in /data in the container which I can see from the host:

12:11PM /data/polygon/mainnet
 ❯❯❯ ls
reader  storage

However, when I try to cd into one of the directories I get denied:

12:15PM /data/polygon/mainnet/reader  ✘ 1
 ❯❯❯ cd /data/polygon/mainnet/reader/data
cd: permission denied: /data/polygon/mainnet/reader/data
12:15PM /data/polygon/mainnet/reader  ✘ 1
 ❯❯❯ sudo !!
12:15PM /data/polygon/mainnet/reader  ✘ 1
 ❯❯❯ sudo cd /data/polygon/mainnet/reader/data
sudo: cd: command not found

But, I can cd into the `reader directory no problem:

12:16PM /home/ubuntu
 ❮❮❮ cd /data/polygon/mainnet/reader
12:16PM /data/polygon/mainnet/reader
 ❯❯❯ ls
data  work

If I list the folders under reader I see the following

12:17PM /data/polygon/mainnet/reader
 ❯❯❯ ls -la
total 0
drwxr-xr-x 4 root 42 Jan 11 12:11 .
drwxr-xr-x 4 root 47 Jan 11 12:11 ..
drwx------ 4 root 33 Jan 11 12:11 data
drwxr-xr-x 3 root 41 Jan 11 12:11 work

Which is odd because the reader directory is owned by root, just like the data directory.

Why can't I cd into the data directory?

Ninja edit: turns out running chown -R ubuntu data solves the issue. I do still wonder why I couldn't cd into data but I could cd into reader.

CC BY-SA 4.0
3

1 Answer 1

0

Credit to @KamilCuk for getting me to look into the specific permissions on the data directory.

Looks like only the owner of the data dir has permissions to read it.

CC BY-SA 4.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.