Skip to content

/version.json reports git_sha and built_at as "unknown" on both prod and -test #1459

Open

Description

@jonfroehlich

What's wrong

https://makeabilitylab.cs.washington.edu/version.json and https://makeabilitylab-test.cs.washington.edu/version.json both return "git_sha": "unknown", "built_at": "unknown" (checked 2026-10-24, while serving 2.34.0). That field pair was added in #1366 precisely so we could confirm which commit a server is actually running without shell access; right now it tells us nothing, and the only deploy signal left is bumping ML_WEBSITE_VERSION.

Because both values are unknown, the container isn't failing at git rev-parse (that would leave built_at populated). website/views/version.py is falling back because build-info.json is absent or unreadable at BASE_DIR.

Likely cause (hypothesis, not yet confirmed on a server)

docker-entrypoint.sh writes build-info.json into the cwd (/code) and its comment says "this script runs as root". That was true under the old webhook deploy, but since the move to GitHub Actions self-hosted runners (.github/workflows/deploycse.yml, deploycse-test.yml, 2.34.1), /code is the actions/checkout workspace bind-mounted from the runner, owned by the runner's user, while the Dockerfile ends with USER apache (uid 48). An apache-owned process can't create a file in a runner-owned directory, so the printf > build-info.json fails and the view never finds the file.

The same ownership mismatch may also be silently affecting other things the entrypoint writes under /code (collectstatic output, makemigrations into website/migrations/), so it's worth checking the container log for permission errors, not just this one symptom.

How to confirm

  • On the runner host: docker logs <website container> | head -60 — the entrypoint prints whoami and cat build-info.json; a Permission denied on the printf is the smoking gun.
  • Or ls -la the checkout directory on the runner and compare owner/uid against 48.

Options

  1. Write build-info.json somewhere the container user owns (e.g. a dedicated small volume, or /tmp) and point BUILD_INFO_PATH there — mirrors how Write a nightly pg_dump into the postgres data volume so backups always contain a consistent snapshot #1443 handles status.json for the backup sidecar.
  2. Have the deploy workflow write the file before docker compose up (the workflow has ${{ github.sha }} for free), and have the entrypoint only read it.
  3. chown/chmod the workspace in the workflow so uid 48 can write — simplest, but widens what the container can modify in the checkout.

Option 2 is probably cleanest: the SHA the workflow checked out is exactly the SHA we want to report, and it removes the git dependency from the container entirely.

Found while reviewing the Dependabot alerts (#1456, #1458).

🤖 Generated with Claude Code — Fable 5.1, claude-fable-5-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions