Troubleshooting
API, authentication and validation errors come out as JSON on stdout, with error.code and error.message; the process exit code tells you the category. Run with --verbose to see the request and the response (without the token).
Authentication (exit code 2)β
No authentication configured for <product>β
There is no token for that product. Each product has its own:
kobana billing auth login # or
export KOBANA_BILLING_TOKEN=...
kobana billing auth status # checks what is in effect
auth status exits with code 0 even without a credential: check the authenticated field in the output. A token from another product does not work β see Authentication.
API 401β
The token exists, but it is expired, belongs to another product or to another environment. Sandbox and production tokens are different. Log in again (kobana <product> auth login) in the right environment (--env).
API 403β
The token is valid, but it lacks permission. Common causes:
- Missing access level.
DELETErequiresdelete; import requiresimport; writing requireswrite. Log in again choosing the levels, or use--scopes. - Missing resource scope. The login lists the product's scopes (
billing/customers,inbox/emailsβ¦); a resource outside them is refused.
The login opens the browser in the wrong placeβ
The login uses the Kobana Account of the environment (account.kobana.com.br, account.sandbox.kobana.com.br). KOBANA_ACCOUNT_URL changes the address; check that no old variable is exported.
Environmentβ
<product> has no sandbox environmentβ
inbox, dashboards and kadu have no sandbox, and the CLI refuses instead of sending the test to production. Run without --env sandbox, carefully, or use --dry-run.
Workspaceβ
400 WORKSPACE_REQUIRED on financeβ
Every finance route needs X-Workspace-Id:
export KOBANA_WORKSPACE_ID=workspace-uuid
# or, in a single call:
kobana finance payables list --params '{"X-Workspace-Id": "uuid"}'
kobana dunning workspaces list shows the workspaces the token can reach.
Command line (exit code 3)β
unrecognized subcommand or unexpected argumentβ
The command or the flag does not exist. See what is available at that level:
kobana billing --help
kobana billing plans --help
Command names changed in older versions, but the old names still work as aliases. If a command "disappeared", look for it in the Manual.
Validation error: id cannot contain β¦β
The CLI refuses identifiers containing /, \, .., ?, #, % or control characters before calling the API. This is on purpose: it protects against path injection. Pass only the id.
Invalid JSON in --params or --jsonβ
Use single quotes outside and double quotes inside (--json '{"amount": 99.90}'). In PowerShell, escape the inner double quotes or use a file.
Variables and .envβ
A token in the .env was ignoredβ
The .env in the current folder cannot define tokens or credentials, because it may come from a third-party repository. The CLI warns about it. Set them in the environment or in the .env of the configuration folder (~/.config/kobana). See Environment variables.
Outputβ
Huge responseβ
Use --fields to limit the columns and --page-limit to limit the pages. For sums, use the aggregates endpoints.
--output refusedβ
The path cannot contain .., be a symbolic link, a folder or a device.
The "New version available" noticeβ
It is a notice on stderr, once a day. kobana update installs it. It affects neither stdout nor the exit code.
Still not solved?β
Run the command with --verbose and KOBANA_LOG=kobana=debug, and open an issue with the command (without tokens), the output and kobana --version.