Repository navigation
Description
In deployments/docker-compose.yml the arc-snapshots service uses the execution image and bind-mounts ${ARC_HOME} to /data. It sets no user:, so it runs as the image user: USER arc in deployments/Dockerfile.execution, UID/GID 999. The published arc-execution:0.8.4 image has "User": "arc" in its config.
The guide asks the operator to create that directory first, as their own user, so that it does not end up owned by root (docs/running-an-arc-node.md, "Prepare data directory"):
If it doesn't exist, Docker will create it as root and the
arc-snapshotscontainer will fail with permission errors:
mkdir -p "${ARC_HOME:-$HOME/.arc}"
On a Linux host that directory belongs to the operator's UID (usually 1000) with mode 0755, and a bind mount keeps host ownership, so UID 999 still cannot create anything in it. The step only moves the failure from a root-owned directory to an operator-owned one. arc-snapshots first creates its staging directory next to the targets, /data/.snapshot-tmp (sibling_tmp_dir in crates/snapshots/src/main.rs, then create_dir_all in resumable_download), and fails there. arc-consensus-init, arc-sockets-init, arc-execution and arc-consensus all wait for it with service_completed_successfully, so nothing else starts.
The note further down says the opposite:
The init container runs as root so it can set file ownership for the main services (UID 999). No manual
chownis needed.
Nothing in the stack runs arc-snapshots as root, and the compose file has never set a user: for it.
Checked on v0.8.4 and v0.8.5 (release/0.8 at 602eed3); the compose file, Dockerfile.execution, the guide and crates/snapshots are the same in both. Repro without Docker, with arc-snapshots built from v0.8.4 (0470b92) and run the way the container runs it, as UID 999 against a directory owned by UID 1000. ARC_EXECUTION_BINARY points at a stub that only answers the download --help probe, because the failure comes before the execution download:
$ ls -ld home
drwxr-xr-x 2 ubuntu ubuntu 4096 Nov 11 11:01 home
$ setpriv --reuid=999 --regid=999 --clear-groups \
arc-snapshots download --chain=arc-testnet --el-profile=full \
--execution-path=home/execution --consensus-path=home/consensus
INFO Selected storage v2 snapshot block=71847996
INFO Downloading snapshot url="https://snapshots.arc.network/api/download/testnet/storage-v2/archive/71847996-20261111T0820Z/consensus.tar.lz4"
Error: Permission denied (os error 13)
Location:
crates/snapshots/src/download.rs:531:5
The same command as UID 1000, or as UID 999 after chown 999:999 home, starts downloading. The error does not say which path it could not write, so an operator has little to go on. Docker Desktop on macOS does not enforce bind-mount ownership, which may be why this has not shown up there.
Expected: mkdir -p "$ARC_HOME" followed by docker compose up -d restores the snapshots and starts the node, as the guide says.
Proposed fix: give $ARC_HOME to UID 999 before arc-snapshots runs, the same way arc-sockets-init already does for the sockets volume: a debian:bookworm-slim init service that runs chown 999:999 /data on the ${ARC_HOME} mount (not recursive), with arc-snapshots depending on it. Then correct the note about the init container running as root. If you would rather not change ownership of a host directory from the compose file, the alternative is to document sudo chown 999:999 "$ARC_HOME" in "Prepare data directory".
I can open a PR with either. Could you assign this to me?
Activity