Error code dictionary

Tell task, dispatch, CLI, and common HTTP errors apart; each entry gives the cause and the fix.

Grape has several distinct "exit code / error code" systems, and looking at them together leads to wrong conclusions. First determine which layer you are looking at, then use the matching table.

Distinguish the three layers first

Layer Where it appears Produced by Typical values
Task exit code Issue Center / Observability · Tasks and logs / Pipeline node details Agent execution process -1 -15 1
Dispatch error Pipeline node error Scheduler engine_unavailable
Business HTTP error Page / API response Server 401 403 409 429 502 503 504 + error_code
CLI exit code You run grape in a terminal grape-cli 0 1 2 >=400 130; follow the --help / exit behavior of the grape-cli version you use

Index by symptom

What you see Where to look
Task failed with exit_code=-1, failing quickly in the startup phase Task exit codes
Task failed with exit_code=-15 Task exit codes
Task failed with exit_code=1 and a compile/API error in the log Task exit codes
The node reports "no available engine" engine_unavailable
Login reports a deactivated account or a disabled channel Login and sessions
RuntimeAgent registered: [] in the worker log This is normal
The codearts engine cannot be installed and reports an untrusted directory Directory not trusted (exit 1)
The browser can open Grape, but the worker cannot connect server_base_url dual meaning
grape in the terminal returns 401 / 403 / 130 CLI exit codes

Full reference table

Only verified codes are included; unverified codes do not appear here, and none are invented to fill a gap.

Layer Code Trigger Suggested action Retryable
Task exit code -1 The execution process was interrupted or timed out (commonly fails after about 30s); manual cancellation also produces -1 Check the node log to locate the specific engine-side error No
Task exit code -15 The process was terminated (SIGTERM class) Retry or reassign; this is not a business error Yes
Task exit code -9 The process was killed by SIGKILL (OOM, forced kill, host reclamation) Check Worker memory and system logs; add memory or reduce concurrency, then retry Yes
Task exit code 1 Engine-side business failure (compilation error / upstream API error) Read the first traceback in the task log No
Dispatch error engine_unavailable The scene is not "applied", or the node is not bound to an engine instance Apply the scene in Scene Center and bind engine_runtime_ids to the node Yes
Login/credentials OAuth not configured (HTTP 400) The client_id / secret of the login channel is missing or wrong Re-enter it in Login channels in the admin console and restart the corresponding container No
API error ISSUE_ASSERT_MISMATCH (HTTP 409) The subject anchor in the PR/Issue body does not match the Issue of the current task Correct the #N anchor in the body and related_issue_nums, then retry No
API error HTTP 403 Session token not allowed on this endpoint A tk_ session token was used to call a user_only endpoint (account / platform management) Use a grape_ user-level API key or a Web JWT instead No
API error HTTP 429 "at most 2 feedback items per task" More than 2 feedback items for the same task_id Merge the feedback or reduce the number of items No
Engine/CLI Exit code 1 (directory not trusted) The codearts CLI exits with 1 immediately when it encounters an untrusted directory in an environment without a TTY such as systemd or nohup Trust the directory in an interactive terminal first, or switch to the service user's directory No
CLI exit code 0 The command succeeded No action needed —
CLI exit code 1 Generic/configuration error (address, token, network) Use grape doctor to check the base_url and the token channel No
CLI exit code 2 Usage error (missing arguments, unknown subcommand) Check the arguments with --help No
CLI exit code >=400 HTTP status code passthrough (401 token invalid / 403 insufficient permission) Handle it according to the corresponding status code No
CLI exit code 130 Interrupted by Ctrl+C No action needed —

Task exit codes: -1 / -15 / -9 / 1

Why: This is the exit status of the Agent execution process, not a business error code.

Value Meaning Typical symptom How to fix
-1 Engine startup failed Fails after about 30s with almost no Agent output Check whether the engine CLI exists, whether the ACP dependency is fully installed (hermes requires [acp]), and the startup path
-15 Terminated by a signal (SIGTERM) Service restart, forced kill on timeout Check whether a release or restart happened in that period; check whether the task exceeded the default 60 minutes (120 minutes for coding, adjustable with RUNTIME_TASK_TIMEOUT / task-timeout.json) and was killed
-9 Forcibly terminated by SIGKILL Common with OOM, host reclamation, or a manual kill -9 Check Worker memory and system logs; retry after reducing concurrency or adding memory
1 Agent execution error Compilation failure, model API failure, tool error Read the last tool call and the error stack in the node log

Verification: the essential difference between -1 and -15 is whether the task ever started running — -1 never entered the Agent, while -15 was killed externally mid-run; -9 is more forceful, so check memory first.

engine_unavailable (no available engine)

Why: A task must be dispatched, but no eligible online engine can claim it. Three causes:

  1. The scene is not "applied" — the configuration was changed but did not take effect, and the webhook still uses the old configuration.
  2. The node's engine_runtime_ids is empty, and the global pool has no online engine with the corresponding label either.
  3. engine_runtime_ids is configured, but every engine in the list is offline, has a heartbeat timeout, or is deregistered (hard constraint, no fallback).

How to fix: Scene Center → bind an engine to each Agent → save → Apply; then go to Observability → Devices and engines and check the health probe (pending means the first probe has not passed; for fail, check the installation and the key).

Verification: Create a new Issue and check whether the node enters "running".

RuntimeAgent registered: [] — this is normal

Why: A brand-new Worker with no engine installed still registers successfully, with an empty engine list. Engines do not require a Worker restart: the Worker periodically rediscovers local engines and registers them automatically (within 5 minutes).

How to fix: Wait 5 minutes and check the health probe again instead of restarting.

codearts: folder-trust exits with 1 in environments without a terminal

Why: In environments without a TTY such as systemd / nohup, the directory trust gate in the codearts CLI exits with 1 directly when it encounters an untrusted directory, which shows up as "the engine is online but every task fails".

How to fix: Write the working directory into trustedFolders in ~/.codeartsdoer/cli-data/settings.json. Grape's worker installation script merges it automatically; manual installations must add it yourself.

Verification: Rerun a task; if it still reports an untrusted directory, check whether folderTrust.enabled and trustedFolders both exist.

server_base_url dual meaning: the browser can open Grape, but the worker cannot connect

Why: A single server_base_url carries two meanings at the same time — the browser callback address and the worker callback address. In a dual-address deployment, one of them is necessarily wrong.

How to fix: Configure them separately in configs/server-config.json (falls back when not set):

{
  "browser_callback_url": "https://<domain>",
  "worker_connect_url": "https://<worker-reachable-domain>"
}

Restart the service after the change. Verification: GET /api/health returns both fields and the url_split_warning warning.

CLI exit codes: 0 / 1 / 2 / >=400 / 130

Value Meaning Typical handling
0 Success —
1 Generic/configuration error (address, token, network) grape doctor
2 Usage error (missing arguments, unknown subcommand) grape <group> --help
>=400 HTTP status passthrough (401 token invalid, 403 insufficient permission) For 401, switch to grape_; for 403, the command exceeds its scope
130 Interrupted by Ctrl+C —

Note: CLI exit codes and task exit codes are two different systems. Use the CLI exit code to determine script success; look at Issue Center for task results.

The CLI is released from the separate grape-cli repository, not this one; the exit codes above and the availability of grape doctor depend on grape --help and actual execution on the machine.

Common HTTP errors for login, scenes, and repositories

The entries below are not task exit codes but HTTP statuses + error_code returned by pages/APIs. Read error_code in the response first, not only the status code.

Login and sessions

HTTP error_code / symptom Meaning Handling
401 INVALID_CREDENTIALS Wrong username or password Re-enter; consecutive failures trigger login rate limiting
401 SESSION_EXPIRED Session expired Sign in again
401 REFRESH_TOKEN_INVALID The refresh token expired or is invalid Sign in again
403 MISSING_CSRF_HEADER Missing CSRF header Refresh the page and retry; scripted calls should use an API token, not a simulated web session
403 ACCOUNT_DEACTIVATED / ACCOUNT_DELETED / ACCOUNT_DEACTIVATING The account is deactivated, deleted, or being deleted Contact the administrator; retrying does not restore it
403 CHANNEL_DISABLED The third-party login channel is disabled An administrator enables it on the login channels page
400 OAUTH_CHANNEL_NOT_CONFIGURED The platform has no OAuth channel configured yet Configure client_id / client_secret / the callback URL first
429 Login/verification code endpoint Too many requests Wait according to retry_after; do not retry continuously

Applying scenes

HTTP Symptom Meaning Handling
400 Select a repository first A scene was applied without selecting a target repository Select the repository first, then apply
400 The scene references a deleted Skill A Skill in the scene was deleted Add the Skill or change the node first, then apply
400 This scene has no demo template Try was clicked but no template is configured Use the normal Apply instead
404 The scene does not exist The scene was deleted, or it does not belong to the current repository Return to Scene Center and select again
409 Duplicate name The current repository already has a scene with the same name Rename it; applying the same official scene again reuses it instead of creating a duplicate
503 Bot Token is not configured; cannot query branches The platform Bot Token is not configured Configure the Bot Token in the Git platform integration first

Repositories and plugins

HTTP Symptom Meaning Handling
400 API Token is not configured The current Git platform has no token bound Bind one in the personal/platform credentials first
502 Failed to query branches / sync failed / failed to create the template repository The upstream Git platform returned an error Retry later; if it keeps failing, check the network, token permissions, and platform status
504 Timed out fetching the platform user identity / timed out creating the template repository The upstream platform timed out Retry; check the network from the Worker/service to the platform
502 Plugin execution failed The plugin process returned an error Check the plugin log and input parameters
504 Plugin execution timed out The plugin exceeded its execution limit Shorten the task or raise the timeout; do not retry indefinitely

These error codes come from HTTPException branches in the current code; the exact wording may change slightly between versions. During troubleshooting, rely on the error_code in the response.

Help and troubleshooting | Runtime and Worker | CLI