Troubleshoot Codi
Start by identifying the active client, server, profile, identity, and workspace:
codi version
codi status
codi profile show
codi auth whoami
codi workspace current
Add --output json when collecting a failure for automation or support. Codi writes diagnostics to standard error and includes a stable code, message, and httpStatus object in JSON mode.
The command is not recognized
Use the help generated by the installed client instead of assuming that a command or option is available:
codi help
codi help pipeline
codi pipeline update --help
An unknown command, missing operand, unsupported option, duplicated option, or invalid option value exits with code 2. The human-readable error is followed by the top-level usage text.
The server is unavailable
Check the selected endpoint without requiring authentication:
codi status
codi status --server https://codinamo.com
Confirm that the URL contains only its scheme and authority, with no path. Codi requires HTTPS unless CODINAMO_ALLOW_INSECURE_HTTP=true is explicitly configured for an isolated development environment.
If the endpoint is correct but slow, retry one diagnostic request with a timeout from 1 to 300 seconds:
codi status --timeout 60
An unavailable status check exits with code 1.
Authentication is missing or expired
The message not authenticated; run 'codi auth login' means that neither the selected profile nor CODINAMO_ACCESS_TOKEN supplied a token.
codi profile show
codi auth login --email user@example.com
codi auth whoami
HTTP 401 exits with code 3. Log in again for an interactive profile, or replace the expired CODINAMO_ACCESS_TOKEN in the CI secret store. Use --profile <name> when the credential belongs to a profile other than the active one.
Do not print a token to diagnose authentication. auth whoami verifies the credential without exposing it.
No workspace is active
Workspace-scoped commands fail before making their main request when no workspace has been selected. Choose one persistently or override it for a single command:
codi workspace list
codi workspace use platform
codi project list --workspace WKS-123
workspace use stores the canonical workspace ID in the selected profile. --workspace does not alter saved profile state.
A resource is not found or its name is ambiguous
Codi resolves most resources by canonical ID or unique name. Organizations, workspaces, and teams also accept slugs; targets also accept reference names.
List the resource with --quiet, then repeat the command with its canonical ID:
codi pipeline list --quiet
codi pipeline show PIP-456
A local selector failure exits with code 2. An HTTP 404 returned by the server exits with code 5.
Access is denied
HTTP 403 and a denied access decision both exit with code 4. Inspect the authenticated identity and the effective decision on the exact resource:
codi auth whoami
codi access capabilities --resource PIPELINE:PIP-456
codi access decision \
--permission pipeline.run --resource PIPELINE:PIP-456
Use grant effective when diagnosing access for another user or team:
codi grant effective --organization acme \
--principal USER:USR-123 --resource PIPELINE:PIP-456
Check direct grants, parent-scope inheritance, team membership, expiration, and permission implications before creating another grant. See How access control works.
A role or grant conflicts with current state
HTTP 409 or 412 exits with code 6. The resource changed after the version or revision used by the command was read.
Fetch the current role or grant, review the intervening change, update the JSON definition, and retry. Do not blindly replace expectedVersion or expectedRevision: those fields prevent one administrator from overwriting another administrator’s work.
codi role show ARO-456 --organization acme --output json
codi grant list --organization acme --output json
When the version or revision field is omitted, Codi reads the current resource immediately before mutation and supplies that concurrency value automatically.
ICE validation fails
Validate a local document without changing the saved pipeline:
codi pipeline validate --file pipeline.ice
Validation diagnostics are printed in table or JSON form and the command exits with code 1. Correct every diagnostic before running pipeline update. If the source was piped from another command, use --file - and verify that the producer writes a complete ICE document.
See ICE syntax for the supported grammar.
A JSON definition cannot be read
Role, grant, and deployment-target definitions must be JSON objects, not arrays. Confirm the file path, JSON syntax, and required fields. To isolate filesystem issues, validate piped content through standard input:
codi role preview --organization acme --file - < role.json
codi target create production-api \
--reference production_api \
--kind machine \
--strategy docker-compose \
--config - < target.json
Invalid JSON or a missing local file exits with code 2 for validated input errors or code 1 for a local I/O failure.
A secret command waits for input
secret-group set never accepts a secret value as an argument. In an interactive terminal it prompts without echo. In automation, provide --stdin and pipe exactly the value:
printf '%s' "$REGISTRY_PASSWORD" \
| codi secret-group set release REGISTRY_PASSWORD --stdin
An empty value is rejected. Avoid commands that add debugging output to the same pipe.
A destructive JSON command requests confirmation
JSON mode is non-interactive for destructive operations. Confirm the target with a read operation, then pass --yes explicitly:
codi pipeline show PIP-456 --output json
codi pipeline delete PIP-456 --output json --yes
Without --yes, the command exits with code 2 and does not mutate the resource.
A script receives unexpected output
Use --output json when the script needs structured fields. Use --quiet only when the command documents identifier-oriented output; its minimal value varies by resource.
codi workspace list --output json
codi workspace list --quiet
Keep standard output and standard error separate. A command can return a JSON error on standard error while leaving standard output empty. Always check the exit code before consuming output.
See Codi command reference for output modes and the complete exit-code table.