Bug report — build consistently fails with a cache key error stuck on "/app"
krispimentel
HOBBYOP

a month ago

The backend build (Dockerfile) consistently fails with the same cache error,

regardless of the builder used, the Dockerfile content, recreating the service from scratch,

or explicitly disabling the cache with NO_CACHE=1. An identical build works

without errors on local Docker Desktop (Windows, WSL2 backend) every time.

Exact error

failed to solve: failed to compute cache key: failed to calculate checksum of ref

::: "/app": not found

Different hashes observed across different attempts:

  • ar916b9tu63jsekp12mo837io
  • htwozrsgh66c3537nnpm8l6vn
  • irn0giy6hxq8632zttsakh54i

What has been tested so far (all resulting in the same error):

  1. Original Dockerfile (WORKDIR /app + apt-get install gcc).
  2. Same Dockerfile, apt-get with retry flags (-o Acquire::Retries=3).
  3. Complete removal of apt-get/gcc (bcrypt/cryptography

use pre-compiled wheels); error started occurring immediately after WORKDIR /app.

  1. Pinning the base image tag (python:3.12-slim → python:3.12.8-slim, including

the specific digest); same error.

  1. Removing WORKDIR entirely, using absolute paths (/app/...) in every

COPY/RUN; same error, though now failing at the last COPY instead of the first.

  1. Renaming the entire path from /app to /srv/app; the Dockerfile no longer

contains any occurrence of the string /app, yet the error **still cites `"/app": not

found`** — indicating that the broken cache reference does not stem from the

Dockerfile content, but rather from something internal to the builder. 7. Delete the entire service and recreate it from scratch (new New → GitHub Repo, same

Root Directory/Builder configuration), new builder (builder-uxoeww), new

cache hash, same error.

  1. Set the environment variable NO_CACHE=1 (officially documented); the log

explicitly shows "Caching Disabled - build performance will be

impacted", yet the FROM ... step still appears marked as cached and the build

fails with the identical error.

Current Dockerfile (reproduces the error)

dockerfile

FROM python:3.12.8-slim

COPY pyproject.toml /srv/app/

COPY alembic.ini /srv/app/

COPY alembic /srv/app/alembic

COPY app /srv/app/app

RUN pip install --no-cache-dir /srv/app

EXPOSE 8000

CMD ["sh", "-c", "cd /srv/app && alembic upgrade head && exec uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-8000}"]

Confirmation that the issue is not the repository content

The same Dockerfile, at the same commit, builds successfully locally (Docker

Desktop, docker build . inside backend/) repeatedly, without any errors.

Closed

1 Replies

Railway
BOT

a month ago

Apologies, we only correspond in English. Please open a new thread in English.


Status changed to Closed Railway • about 1 month ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...