How-to

Fix a broken deploy

The link doesn't load, or the build failed. Symptom, cause and fix for the failures that actually happen.

Start here

read the logs for that app and tell me what went wrong

Your agent can read your app's build and runtime output and will usually name the cause and the fix in one go. The thing that wrote your app is also the thing that debugs it — you do not have to understand the error yourself.

If you want to follow along, the rest of this page is what it's looking for.

Symptom → cause → fix

What you seeAlmost alwaysFix
Status goes to running, then the page 502s or won't loadThe app started and immediately exited — usually the entrypoint isn't where the runtime looksCheck the runtime's convention
Python: build succeeds, container crash-loopsThe file isn't app.py, or the object in it isn't called appRename to app.py exposing app, or wrap it so that name resolves
Python: "gunicorn: not found"gunicorn missing from requirements.txtAdd it — it's what serves the app
Node: "Missing script: start"No start script in package.jsonAdd "start": "node server.js"
Node: build fails on installLockfile out of sync with package.jsonShip both, or neither
Build fails on a missing module you do haveYou shipped node_modules / vendor instead of the manifestSend your source; dependencies are installed for you
The app ignores a setting you asked forYou passed a field that doesn't exist — unknown fields are silently ignoredThere is no start command and no port setting. Use the runtime's convention
Static site: / works, other paths 404A single-page app doing client-side routingHash routing, pre-render the routes, or serve it from a Node app
PHP: blank pageA PHP error with display offRead the logs
Everything looks fine but the URL says the site can't be foundA custom domain whose DNS hasn't propagatedSee Use your own domain
Visitors see a sign-in screen you didn't expectThe app is invite-onlyMake it public again
The result says "simulated"Hosting isn't configured on this server — nothing was built or servedTreat it as a failed deploy, not a success

The three that account for most of it

The Python entrypoint. agenthost imports the name app from app.py. Not main.py, not application. This is a fixed convention, not a parameter — it's the single most common failure on the platform.

A Node app with no start script. npm start needs one. Without it there's nothing to run.

Trusting the first status. A deploy call returns when the build is queued. Poll until the status settles, then confirm with a real request. Two reads, and you avoid most false "it worked".

When the build itself fails

Build failures are in the logs, in the same place as runtime errors. Common ones:

  • A dependency that needs system packages we don't install. Bring your own Dockerfile if you need them.
  • A build script that fails. For Node, npm run build runs automatically when present — if it fails, the deploy fails.
  • A package version that doesn't exist for the runtime version you pinned. See Choosing a version.

Still stuck

Give your agent everything at once:

here's the app id — fetch its status, read 300 lines of logs, fetch the URL, and tell me what you'd change

That's three tool calls it can make on its own, and between them they almost always contain the answer.