a month ago
Hi Railway team,
A synthetic browser startup preflight fails on Railway’s Amsterdam V2 runtime. We run Linux as non-root UID 1000, with Playwright 1.63.0 and Chrome for Testing 153.0.8010.12, Chromium headless shell build 1243. Chromium’s sandbox is enabled.
The browser exits with SIGTRAP and: FATAL:sandbox/linux/services/credentials.cc:131] Check failed: . : Permission denied (13)
In this exact Chromium version, line 131 checks errors from CLONE_NEWUSER operations. We haven’t established whether clone or unshare failed, or which host policy denied it.
Can Railway confirm the restriction and whether a supported, narrowly scoped configuration allows Chromium’s sandbox to initialize as UID 1000? We need to retain the browser sandbox without running the browser as root, privileged mode, or disabling sandbox protections. If unsupported on this runtime, please confirm.
2 Replies
a month ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • about 1 month ago
a month ago
Short answer: no, there's no configuration available to you that restores Chromium's namespace sandbox on a managed container runtime, and running as root wouldn't change it either. Here's how to prove that yourself in about thirty seconds, and what the workable alternatives are.
Why UID 1000 is a red herring
credentials.cc:131 is in Chromium's user-namespace capability check, it fails when clone(CLONE_NEWUSER) / unshare(CLONE_NEWUSER) returns an error, and the zygote has no fallback path when it can't create a user namespace, which is the SIGTRAP. The denial is on the syscall. If the host policy blocks unprivileged userns creation, root inside the container hits the same wall, because the restriction is applied above your container, not by your container's user model. So "run it as root" isn't a workaround you're missing, it's the same failure.
Confirming which layer denied it
Run this inside the container, no Chromium needed:
cat /proc/sys/user/max_user_namespaces # 0 = disabled outright
cat /proc/sys/kernel/unprivileged_userns_clone # may not exist on this kernel
unshare -U true; echo "unshare -U -> $?"
unshare -U --map-root-user true; echo "mapped -> $?"
grep Seccomp /proc/self/status # 2 = filter mode
capsh --print 2>/dev/null | head -5 # what you actually hold
Read it like this: max_user_namespaces at 0 means the sysctl disabled it and that's the whole story. Nonzero but unshare -U still failing means a seccomp filter or LSM is denying the syscall, Seccomp: 2 in that output tells you a filter is active. ENOSPC would mean you'd exhausted the namespace limit, which is the one case that's actually about your workload; you're not seeing that. Either way the answer to "which host policy" is answerable without waiting on staff.
One caveat on your own analysis: I wouldn't read EACCES as a precise fingerprint for a specific mechanism. It points away from an exhausted limit and toward a policy denial, but the commands above are what actually distinguishes them.
What to do instead
--no-sandbox, with the container as the boundary. Your service is already isolated at the container level, so the trust boundary moves from the renderer to the service. If the browser only loads content you control, this is the standard answer on managed runtimes and the security story is defensible. If it renders untrusted URLs, isolate that service properly: its own project, no shared credentials, no internal network reach to the rest of your stack, so a renderer compromise gets nothing worth having. Don't just add the flag and move on if untrusted content is in scope.
Move the browser, not the app. chromium.connectOverCDP() against Browserless, Browserbase, or your own VM where you control the kernel flags. Playwright doesn't care that the browser is remote, your app stays on Railway, and this is the only option that genuinely keeps the sandbox you asked to retain. If the sandbox is a hard requirement rather than a preference, this is your answer.
Stop launching the browser in the preflight. If the check only verifies the binary is installed and the right version, assert on chromium.executablePath() and the version string. A full sandboxed launch in a preflight tests the platform's namespace policy, not your application, which is how you ended up debugging this instead of shipping.
If you want a staff answer, narrow the question
"Is this supported" invites a no. Better: is unprivileged user-namespace creation blocked by the seccomp profile on Amsterdam V2, and does that policy differ from other regions? That's specific enough to get a real reply. And if this same image worked on an older Railway runtime, say so, that reframes it from expected platform policy to a regression, which is a different and more urgent thread.
a month ago
Sandboxed Chromium fails with EACCES on Amsterdam V2 -- Diagnosis & Workarounds (UID 1000)
You are hitting the expected platform policy, not a bug in your image. FATAL:sandbox/linux/services/credentials.cc:131 is Chromium's zygote check for CLONE_NEWUSER -- when clone(CLONE_NEWUSER) / unshare(CLONE_NEWUSER) is denied the zygote has no fallback and exits with SIGTRAP. Reproducible without Chromium.
1. Why UID 1000 is not the cause (and root won't fix it)
The denial is on the syscall, applied above your container by the host sysctl / seccomp / LSM. On Amsterdam V2 root inside the container is still unprivileged on the host, so root gets the same EACCES/EPERM. Changing the container user or adding privileged: true is not supported on Railway -- and wouldn't help.
2. Prove it in 30s -- no Chromium needed
Run inside the same Railway service (Amsterdam V2):
cat /proc/sys/user/max_user_namespaces
# 0 => disabled outright. >0 => not this
cat /proc/sys/kernel/unprivileged_userns_clone
# 0 => disabled, 1 => enabled, ENOENT => not applicable
unshare -U true; echo "unshare -U exit: $?"
unshare -U --map-root-user true; echo "mapped exit: $?"
grep Seccomp /proc/self/status
# 0 = off, 1 = strict, 2 = filter active
capsh --print 2>/dev/null | head -n 20
# or: grep Cap /proc/self/statusOptional precise errno: strace -e unshare unshare -U true 2>&1 | tail
Reading:
max_user_namespaces == 0=> host sysctl disabled user-ns; nothing in-container can re-enable it.>0butunshare -Ufails +Seccomp: 2=> seccomp/LSM denying the syscall (the Amsterdam V2 case).ENOSPC=> you exhausted the namespace limit (quota, not policy -- the only "your workload" case).EACCES/EPERMpoints away from a limit and toward a policy denial, but only the commands above distinguish sysctl vs seccomp precisely. Don't treatEACCESas a fingerprint.
Versions in your report confirm the path: Playwright 1.63.0 with Chrome for Testing 153.0.8010.12 (headless shell 1243) always hits credentials.cc:131 when the host blocks unprivileged CLONE_NEWUSER.
3. Your two questions
Can Railway provide a narrowly scoped config to keep the sandbox as UID 1000 without root/privileged/
--no-sandbox?
No -- there is no user-visible knob on a managed container runtime that re-enables unprivileged user-ns creation. The policy lives in the host seccomp profile / sysctl, not your service config. If Railway confirms it's intentional, it's working as designed.
If unsupported, please confirm.
Expected: unsupported on Amsterdam V2 -- unprivileged CLONE_NEWUSER is blocked by the seccomp profile (same as most managed CaaS). Other regions use the same profile unless Railway says otherwise -- ask explicitly if it differs.
4. Workable alternatives (keeping your constraints)
A -- --no-sandbox with the container as the boundary (trusted content only)
If the browser only loads content you control (your own app / synthetic check), move the trust boundary from renderer to service. Keep UID 1000, add:
await chromium.launch({ args: ['--no-sandbox','--disable-setuid-sandbox','--disable-dev-shm-usage'] })Harden the service: own Railway project, no shared secrets, no internal network to the rest of your stack. This is the standard answer on managed runtimes for trusted content. Don't use for arbitrary untrusted URLs without that isolation.
B -- Move the browser, not the app: remote CDP (only option that keeps the sandbox)
If sandbox is a hard requirement, run the browser where you control kernel flags and connect over CDP. Your app stays on Railway.
- Managed: Browserless, Browserbase
- Own VM (Fly VM / EC2 with
kernel.unprivileged_userns_clone=1/user.max_user_namespaces>0, no seccomp block)
import { chromium } from 'playwright';
const browser = await chromium.connectOverCDP('wss://your-browserless.example/cdp');Playwright doesn't care the browser is remote -- this genuinely keeps the namespace sandbox.
C -- Stop launching the browser in the preflight
If the preflight only verifies "binary present + correct version", don't do a full sandboxed launch. Assert on the binary/version:
console.log(chromium.executablePath());
npx playwright --versionThis tests your image, not the host's namespace policy.
5. How to get a useful staff answer
Reframe from "is this supported?" to:
Is unprivileged user-namespace creation (
CLONE_NEWUSER/unshare -U) blocked by the seccomp profile on Amsterdam V2, and does that policy differ from other regions? Did this same image work on an older runtime (regression vs expected policy)?
Include the 6 command outputs above -- staff can answer without asking you to re-run them.
TL;DR: credentials.cc:131 + EACCES + SIGTRAP = host policy denies CLONE_NEWUSER. N