Cloud Run: The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable
Cloud Run started your container, but nothing listened on $PORT within the startup timeout — the app crashed, listens on another port, or binds to localhost.
Seen on:
Google Cloud
Meaning
Cloud Run sets PORT (default 8080). Apps hard-coded to 3000/5000, binding to 127.0.0.1, crashing at startup (missing env vars), or built for arm64 instead of amd64 all fail this check. Logs show the crash.
Common causes
- App listens on a fixed port instead of $PORT
- Binding to 127.0.0.1 instead of 0.0.0.0
- Startup crash (missing env/secret, DB unreachable)
- Image built for the wrong architecture (arm64 on Apple Silicon)
⚡ Quick fix
- Listen on process.env.PORT / os.environ["PORT"] and 0.0.0.0
- Check Cloud Run logs for the crash
- Build for linux/amd64
Detailed fix by platform
Node.js
- `const port = process.env.PORT
- 8080; app.listen(port, "0.0.0.0", () => console.log(
listening on ${port}));`
Shell
- bash
docker buildx build --platform linux/amd64 -t REGION-docker.pkg.dev/PROJECT/repo/app:1 --push . gcloud run services logs read app --limit 50
How to diagnose
- Port — What the app listens on
- Logs — Startup errors
- Arch — Image platform
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- ACR unauthorized Azure Container Registry: unauthorized: authentication required, visit https://aka.ms/acr/authorization (AKS ErrImagePull 401)
- CannotPullContainerError ECS task stopped: CannotPullContainerError: pull image manifest has been retried ... / ref pull has been retried
- Conflict container name Conflict. The container name "/x" is already in use by container …
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026