Troubleshoot host and run issues
Diagnose and fix missing DATABASE_URL, a spent Neon quota, held leases, broken event chains, missing AI or GitHub connections (409), GitHub App permission errors, agy sign-in files, macOS and Colima cage problems, approvals, paused conversations, production dry runs, mail, and Operator lockout.
Use these entries to diagnose and fix common database, host, cage, run, and web app failures in the factory. State lives in Neon Postgres, so most "file" problems are now database or connection problems.
Neon & leases
Fix a missing DATABASE_URL, a spent Neon quota, and a lease another command holds.
Timeouts & auth
Fix Intel Mac unit timeouts, wedged Colima VMs, and agy sign-ins.
Blocked lanes
Resolve failed installs, ui-unpredicted shots, 409 approvals, and conflicts.
Connections & lockout
Connect AI and GitHub (409), debug sign-in email, and recover Operator accounts.
Database issues
- Symptom:
t12,t12 uior the worker exits withDATABASE_URL is not set: the factory keeps all state in Neon Postgres and has no local mode; set DATABASE_URL to the pooled Neon connection string. - Cause: Every process needs the database.
db.ErrNoDatabaseURLis returned before anything else runs; there is no local mode. Onlyt12 profile-checkandt12 dbskip the startup connection. - Fix: Export the pooled Neon connection string, or put it in
~/.config/t12/env(mode0600;t12refuses a file others can read), then check the schema:
export DATABASE_URL='<POOLED_NEON_URL>'
bin/t12 db statusOn Vercel the function answers missing cloud configuration: set DATABASE_URL (the Neon Postgres pooled connection string). The GitHub Actions worker fails with The DATABASE_URL secret is not set on this repository; add the secret to the repository and to the production and staging environments.
- Symptom: The start screen is titled The factory is up but cannot work right now and says
The factory's database is over its plan limit (Neon quota); it works again once the limit resets or the plan is upgraded. - Cause: Neon refuses every connection once the plan's monthly limits are spent.
db.ErrQuotamarks this as permanent, so the client never retries it. - Fix: Waiting does not help. Upgrade the Neon plan or wait for the monthly reset, then reload the page. Locally,
t12 uiexits with the database error text instead of a start screen.
- Symptom: A command fails with
<name> is held by another t12 command, orlane "<unit>" of run "<id>" is busy: another t12 command holds <lease>; retry when it finishes. The error text readsdb: lease held by another owner. - Cause: Locks are rows in the
leasestable (run:<id>,lane:<id>:<unit>,integration:<id>,req:<kind>:<id>,home:<name>). Another command, a UI job, or the worker on another machine really holds it. - Fix: Wait for the other command and rerun. A crashed holder frees its lease on its own when the TTL passes, within
1to2minutes for run, lane and request leases. Checkt12 uiand the GitHub Actions run for a live job before assuming a stale lease.
- Symptom:
t12 conversation verify --home <HOME> --conversation <ID>exits1and prints lines such asevent 7 was edited (hash mismatch),event 7 does not link to the event before it,event 7: the stored line and its hash columns disagree, orblob "<path>" was changed. - Cause: An
eventsrow or a blob underreports/,evidence/, ordecisions/no longer matches its hash. The table refusesUPDATE,DELETEandTRUNCATE, so someone changed it with the trigger off or edited a log beforet12 db import, which refuses logs that fail verification. - Fix: Do not patch hashes back into sync. The record is no longer evidence: start a fresh conversation, and re-import from an untouched home if the damage came from an import.
Host and cage issues
- Symptom: QC unit checks inside the cage time out on an Intel Mac even when tests run in under a second.
- Cause:
UnitLimit(internal/runner/timed.go) defaults to10 s, while startingnpmandvitestinside Colima on an Intel Mac takes5–9 s. - Fix: Set
T12_UNIT_LIMIT_S=30(1..300) in~/.config/t12/env(0600) and restartt12ort12 ui. On 4-CPU Intel Macs, stop other test suites and exclude demo/state folders from Spotlight.
- Symptom: Containerized build, install, or QC steps hang or run abnormally slowly on macOS.
- Cause: The Colima
t12VM (4CPUs,6 GiBRAM,vz+virtiofs) wedged, usescontainerd, or is competing with host load. - Fix: Restart Colima and verify Docker responds before resuming
t12 run(a coldwrangler devinside Colima takes ~90 s; Release/Red team wait up to300 sfor/healthz):
colima restart t12
docker infoIf a Colima profile uses containerd instead of Docker (runtime: containerd in colima.yaml, or containerd.sock without docker.sock), delete and recreate it with --runtime docker:
colima delete t12
colima start t12 --runtime docker --vm-type vz --mount-type virtiofs --cpu 4 --memory 6 --disk 60 --mount "$HOME:w" --mount /private/var/folders:w- Symptom: Commands using
agyprompt for auth over SSH on a machine already signed in at the desktop. - Cause:
agyreads the desktop keyring locally, but switches to a separate token file wheneverSSH_CONNECTION,SSH_CLIENT, orSSH_TTYis set.t12 uiand the worker drop these variables foragyruns; a command you start yourself does not. - Fix: Strip the SSH environment markers before running
t12ort12 ui(or sign in once viassh -t <host> agy):
env -u SSH_CONNECTION -u SSH_CLIENT -u SSH_TTY bin/t12 run --home <HOME> --conversation <ID>- Symptom: The agy connection dialog asks for
~/.gemini/antigravity-cli/antigravity-oauth-token, but the folder has no such file. - Cause: agy writes that file only when it cannot reach the system keyring. On a desktop it keeps the sign-in in the keyring and writes no file.
- Fix: Sign in once with the keyring turned off for that single run, type
/login, finish in the browser, quit, then choose the file in the dialog. Your keyring sign-in is untouched:
DBUS_SESSION_BUS_ADDRESS=unix:path=/nonexistent agyRun and verification issues
- Symptom: A lane stops during
install-deps, or later steps fail on missing packages even thoughnode_modulesexists. - Cause:
npm citimed out or was interrupted mid-extract (or a Linux/tmptmpfsfilled up, causingTAR_ENTRY_ERROR-122). - Fix: Keep scratch homes (
T12_HOME) and project repos offtmpfs, clear incompletenode_modulesif needed, reinstall inside the cage image, and resume:
docker run --rm -v <WORKTREE>:/work -w /work <CAGE_IMAGE> npm ci
bin/t12 run --home <HOME> --conversation <ID>- Symptom:
t12 run --home <HOME> --conversation <ID>exits and reports a blocked lane or release step. - Cause: A gate, review finding, Engineer question, or environment failure prevented the Orchestrator from recording
step-done. - Fix: Inspect the full report, fix the underlying issue (pass
--answer "<REPLY>"if an Engineer question blocked), and resume from the last checkpoint:
bin/t12 report --home <HOME> --conversation <ID> --detailed
bin/t12 run --home <HOME> --conversation <ID>- Symptom: A conversation that waited on a person shows
No answer in <limit>, so the factory stopped.and no longer counts as waiting on you. - Cause: The conversation had no event for longer than the project's
budgets.wait_hours(default24) while it waited on an unanswered question, a part that needs an OK, or a sign-off. Nothing is written to pause it: the page derives it from the last event, the clock and the limit. - Fix: Answer, press Resume or Try again, or sign off; any new event ends the pause. Set
budgets.wait_hourshigher (up to720) to wait longer, or to a negative number to never pause.
- Symptom:
ui-checkfails withui-unpredictedblocking findings across pages or viewports. In the defaultteamflow the screens are checked inside theqastep, so theqastep fails with these findings once the tests have passed. - Cause: A shared layout or CSS change altered screens missing from
Predicted(internal/roles/uicheck/uicheck.go). - Fix: Compare the before/after screenshot pairs on the Sign-off page in
t12 ui. Add affected screen IDs to the plan if intentional, or revert the side effect.
- Symptom: Worker commands stall or deny execution, and the Conversation permission menu in
t12 uishowsthe mode setting is unreadable; choose the mode againorthe mode setting names no mode; choose the mode again. - Cause: The
approval-modedocument in the database is not valid JSON or names an unknown mode. The session bridge mirrors it into the scratch spool filemode.json, and harness guard hooks fail closed when it is unreadable. - Fix: Select a valid mode (
review,default,auto, orturbo) from the Conversation permission menu int12 ui(or viaPOST /api/mode); only an Operator can change it.
- Symptom: Clicking Allow/Deny in
Request Reviewreturns HTTP409(the session that asked has endedorthis command was already decided), or the session stops waiting. - Cause: Command asks bind to the caller session (
approvals.GuardFor+approvals.EndSession). Shorter role timers (15manalyzer/explorer,10mredteam,5mdeslop,3mstrategist) close pending asks on exit even thoughWaitTimeoutis30m. - Fix: Approve asks promptly while active, or switch away from
Request Reviewfor unattended runs; retry paused steps from Needs you.
- Symptom: After a staging merge sends a lane back to
engineer, the lane blocks before Engineer edits start rather than leaving conflict markers. - Cause:
gitio.SyncOntoStagingkeeps text conflict markers for caged Engineers, but rolls back and blocks on binary or delete/modify (UD) conflicts. - Fix: Inspect the conflicting paths on the block, resolve or drop the binary/deleted-file change on the branch, and resume.
Connections, mail, and access
- Symptom: Starting or building a conversation fails with HTTP
409andConnect agy or omp under Your connections to start a conversation. - Cause: Runs use the requesting person's own connections. Without a connected agy or omp, the server refuses (
requireAI). Shared factory credentials stand in only for an Operator, and only whenT12_SHARED_CREDENTIALS=1. - Fix: Open Your connections and connect agy (a Gemini key or Google sign-in) or omp (Anthropic or OpenAI keys, or sign-in), then retry.
- Symptom: Creating a project fails with HTTP
409andConnect GitHub under Your connections to create the project.orSign in with GitHub again under Your connections to create the project. - Cause: The repository is created in the requester's own GitHub account, so the server needs their GitHub connection. The second message means the stored user token expired.
- Fix: Connect GitHub, or sign in with GitHub again, under Your connections, then retry.
- Symptom: Creating a project, pushing, or opening an issue or pull request fails with
Resource not accessible by integration (the GitHub App needs: <permissions>). - Cause: Runs act with the person's GitHub App user token, and the App lacks a repository permission the endpoint needs. GitHub names the accepted permissions in the message. Creating a repository needs both Administration and Repository creation.
- Fix: Grant the permissions the message names on the GitHub App (the full list is in
docs/hosting.md), then have each person accept the new permissions the next time they sign in with GitHub.
- Symptom: The release gate says nothing is connected to deploy to, or a promotion is refused with
Nothing is connected to deploy to: production stays a dry run. - Cause: The release's production step deploys to the requesting person's own Cloudflare or Vercel account. With neither connected,
devops.PromoteusesDryRunOnlyand refuses production. A Cloudflare token without its account id counts as not connected. A project that needs its Worker is refused when only Vercel is connected, because Vercel serves static pages only. - Fix: Connect Cloudflare (API token and account id) or Vercel (token, and the team for a team account) under Your connections, then release again. Cloudflare takes precedence when both are connected.
- Symptom: Submitting an email on
t12 uishows confirmation, but no sign-in or invite email arrives. - Cause: The endpoint always returns a constant response. Either
T12_SMTP_ADDR/T12_SMTP_FROMare unset (links print only to logs) or SMTP rejected/timed out after30 s. - Fix: Check
t12 uilogs for the printed link ormail to <address> failed: .... ConfigureT12_SMTP_ADDR,T12_SMTP_USER,T12_SMTP_PASSWORD, andT12_SMTP_FROMin~/.config/t12/env(0600) and restartt12 ui.
- Symptom: Nobody can change the agent, the approval mode, the Observer, or the factory-wide connections setup in
t12 ui; those pages and actions are Operator-only. - Cause: Existing Operator accounts were removed or sessions expired, and
--urltunnel setups disable first-signup auto-promotion. On Vercel,T12_OPERATOR_EMAILandT12_OPERATOR_PASSWORDcreate the first Operator only while the database has none. - Fix: Generate a 15-minute Operator recovery link (
<URL>/link?b=1&t=<TOKEN>) or set an Operator password from the host shell (omit--urlfor localhost):
bin/t12 ui --home <HOME> --bootstrap --url <URL>
bin/t12 access set-password --home <HOME> --email <EMAIL> --operator