Infrastructure worth keeping — and kept patched.

Build cache server exits with "permission denied" on its data

You start the container and it stops straight away. The log ends with permission denied. The cause I reproduced is who owns the data directory. This page shows the failure and the fix, reproduced for real with the 0.2.1 image.

What you see

The container exits with status 1 within a few seconds, and its log says:

{"level":"ERROR","msg":"fscache: fatal","error":"write shutdown marker: open data/.unclean-shutdown: permission denied"}

Why it happens

The server does not run as root. It runs as user 65532, and it keeps its files in a data folder inside /home/nonroot. If that folder already exists and belongs to someone else, the server cannot write to it and stops.

I reproduced it with a volume that already held data owned by root, which is what you get after restoring a backup as root:

/d       0:0   drwxr-xr-x      (owner:group, mode)
/d/data  0:0   drwxr-xr-x

The fix

Give the whole tree to user 65532. The image has no shell, so use a throwaway container to do it:

docker run --rm -v fscache-data:/d ubuntu:24.04 chown -R 65532:65532 /d

After that the same image started normally: /healthz answered ok and an upload returned 201.

What does not cause it

What I did not test

Related: back up and restore a build cache, where the restore step has to keep the ownership, and Gradle build cache with Docker Compose.

Your first 15 minutes FosterStack home