Errors and recovery

Every structured error an agent can receive, and what it should do next.

8 sections5 min read

Codes are stable across releases. Match on error.code, never on error.message, and surface remedy to the user: it names the fix.

The shapejson
{
  "schemaVersion": 1,
  "ok": false,
  "command": "reproduced",
  "error": {
    "code": "branch_not_scanned",
    "message": "release/2.4 has not been scanned yet.",
    "remedy": "Run cf scan --repo acme/api --branch release/2.4.",
    "exitCode": 2
  }
}

Access and usage

CodeExitWhat to do
auth_required3Not signed in. Ask the user to run cf auth login, then poll cf auth status --agent.
usage_error2Read remedy. It names the flag or argument that was missing or wrong.
feature_required4The account does not include this. Tell the user, and do not retry.
organization_required2The account belongs to several teams and the command named none. Run cf org list --agent, then pass --org <slug> or set CEFENSE_ORG.
organization_not_found2That slug is not a team the account belongs to. Run cf org list --agent for the real ones. A slug that does not exist gets the same answer, so read it as neither.
organization_forbidden4Your role does not allow that action. Report it and stop. Only the user can be given a different role.
unknown_organization2cf org use was given a slug the account does not have. Nothing was stored.
cancelled130Interrupted. Nothing was completed.

The plan refusing

CodeExitWhat to do
allowance_exhausted4The period's allowance is spent, so no scan will start. Run cf plan --agent for what is left and when it resets.
repository_limit4The plan covers fewer repositories. Tell the user to disconnect one or move up a plan.
depth_unavailable4Max depth is not on this plan. Re-run at default depth.
billing_forbidden4Only an owner or admin may change what the organization pays. canAdministerBilling says so in advance.
no_subscription4Nothing has ever been bought, so there is no billing portal. cf plan upgrade <plan> --agent prints a checkout URL for the user.
plan_unavailable4That plan or seat is not on sale on this deployment. Report it verbatim.
billing_unavailable4This deployment has no billing configured at all. No flag turns it on.
invalid_plan2Use plus, pro, or max. free is what an organization falls back to, not something to buy.
invalid_seats2A whole number from 0 to 500, counting seats beyond the ones the plan includes.

See Usage and limits for what each limit is on each plan.

Filters and lookups

CodeExitWhat to do
invalid_severity2Use critical, high, watch, or info.
invalid_category2Use code, dependency, secret, misconfig, or os-package.
finding_not_found2The id is not in the scan being read. List again: ids belong to a scan.
branch_not_found2No such branch. Run cf branches --agent.
branch_not_scanned2Scan the branch before reading its findings.

Fixes and pull requests

CodeExitWhat to do
fix_not_found2Generate the patch first.
fix_not_ready2The patch is not ready. Check its status with cf fix show.
fix_in_progress2One is already generating. Poll rather than starting another.
fix_not_published2Open the pull request before trying to merge it.
invalid_merge_method2Use merge, squash, or rebase.
confirmation_required2Ask the user in this conversation, then pass --yes.

Refusals from the provider

CodeExitWhat happened
pull_request_blocked4A required review or status check is pending.
pull_request_conflicted4The branch conflicts with its base.
pull_request_draft4The pull request is still a draft.
pull_request_closed4It was closed without merging.

Settings, exports, and skills

CodeExitWhat to do
invalid_scan_mode2Use manual, push, or scheduled.
invalid_scan_interval2Use 1h, 6h, 12h, 24h, or 168h.
invalid_scan_depth2Use default or max.
invalid_check2Use sast, sca, secrets, iac, quality, or sbom.
invalid_format2Use cyclonedx or spdx.
sbom_unavailable4Enable the sbom check and rescan.
unknown_target2cf skill install was given an agent it does not know. Run cf skill list.
global_unsupported2That agent has no user-wide location. Drop --global.
skill_missing4The bundled skill is absent. Reinstall the package.

Failures

CodeExitWhat to do
api_error4The API failed. Retry once, then report it.
internal_error4Unexpected. Report it, with the message.

Retry policy

Have a correction or need help?

Email the docs team