22 days ago
Hi, I’m getting a Railpack image-build failure that appears to be outside my repository configuration.
Project: serene-purpose
Service: backend-sukared
Environment: production
Deployment ID: acde6255-c4fa-4d21-b7a9-c4c8f1e3d559
Builder: Railpack
Intended commit: c97213bb034d21e0f304a65d23886f38748ecdf6
The build fails during:
install apt packages: libatomic1
Exact error:
failed to solve: secret ID missing for "" environment variable
I already fixed a separate legacy region issue (sfo), and the service now uses Railway’s US West region. The region blocker is resolved, but this build error remains reproducible.
I audited the repository and service configuration:
no Dockerfile
no BuildKit secret mounts
no RUN --mount=type=secret
no Railpack/Nixpacks secret config in the repo
no blank/stale build-secret mapping visible in the Railway service UI
The application never reaches startup; the failure happens during the Railpack image build.
The service uses an existing persistent mount at /var/data/luavex, and I added:
LUAVEX_ACCOUNT_STATE_DIR=/var/data/luavex/account-policy
Could you please check whether this service has stale/internal Railpack build-secret metadata or another builder-side configuration causing an empty secret ID to be passed to BuildKit?
Pinned Solution
22 days ago
Make sure your variable keys or values aren't blank, nore does the key contain forward slashes.
2 Replies
Status changed to Awaiting Railway Response Railway • 22 days ago
22 days ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • 22 days ago
22 days ago
The issue is almost certainly caused by an empty or whitespace-only environment variable name defined in the Railway Service or Shared Environment settings.When Railpack constructs the build plan, it mounts all environment variables as BuildKit secrets. If a variable key contains leading/trailing whitespace (e.g., " LUAVEX_ACCOUNT_STATE_DIR") or an empty key/blank line exists in the environment settings, BuildKit receives an empty secret ID (id=""), causing failed to solve: secret ID missing for "" environment variable. Suggested Response to the UserHi @iqubex,This error occurs when BuildKit receives a secret mount request with a blank or whitespace-padded key name. When Railpack builds the container image, it maps your service's environment variables as build secrets. If an environment variable name starts or ends with a space, or if an empty line/key exists, Railpack attempts to pass an empty key to BuildKit. How to Resolve1.Check for Leading or Trailing Whitespace:Go to your service's Variables tab in Railway (or Raw Editor mode) and check every key name—especially recent additions like LUAVEX_ACCOUNT_STATE_DIR. Ensure there are no accidental leading spaces (e.g., " LUAVEX_ACCOUNT_STATE_DIR" instead of LUAVEX_ACCOUNT_STATE_DIR) or trailing spaces.2.Inspect Raw / Bulk Editor:Switch to the Raw Editor view in the Variables tab. Look for:Any empty key-value lines (e.g., a blank line between entries).Lines starting with =value (missing key name).3.Verify Shared & Environment-Level Variables:If your service inherits variables from a Shared Variable Group or environment-level config, check those for empty or whitespace-padded key names as well.4.Save and Redeploy:Once any padded or empty variable keys are removed, trigger a new deployment.After fixing the key name, the step will succeed: check your Build Logs during the install apt packages phase to confirm BuildKit solves the layer successfully.
22 days ago
Make sure your variable keys or values aren't blank, nore does the key contain forward slashes.
Status changed to Open 0x5b62656e5d • 22 days ago
Status changed to Solved 0x5b62656e5d • 22 days ago