CLI troubleshooting
Identify configuration, credential and query failures without blindly retrying writes.
Start with the failing profile. A successful management login does not prove that database queries have the right connection or permissions.
- Check the installed versionConfirm which CLI build you are testing.
- Run offline diagnosticsCheck the selected profile without contacting the database.
- Run online diagnosticsTest the connection and required credentials.
- Try a bounded readFix the first failed check before testing a real query.
Check the selected profile
oc version
oc --profile development --output table doctor --target engineFor account commands, use oc --profile work doctor --target management instead. To inspect local settings without any server request:
oc --profile development doctor --target engine --offlineRead the first failed check and its suggested fix before changing credentials or connection settings.
| Check | What success establishes |
|---|---|
oc version | The executable can run locally. |
| Offline doctor | The selected profile's local settings can be checked without a server request. |
| Online engine doctor | The configured engine passes the connection and access checks it performs. |
| Your actual query | The requested operation works with that data and credential. |
A pass at one stage does not establish the next. For example, local configuration can be valid while a table permission is missing.
Fix the reported problem
| Symptom | What to check next |
|---|---|
oc is not found | Open a new terminal. Check the install directory and PATH. |
| Missing engine credentials | Load OC_BEARER and OC_DB_KEY, or save engine credentials for the selected profile. |
| Credential store unavailable | Unlock Keychain or Secret Service. Linux also needs secret-tool. |
| Saved credentials fail after editing a profile | Restore the original endpoint/identity or save credentials for the new settings. |
HTTP 401 | Check the selected credential, expiry and revocation. Use the matching engine or management login. |
HTTP 403 | Check database identity, organization, scope and role permissions. A new login does not grant missing access. |
| TLS error | Confirm the HTTPS origin. Use --ca-cert FILE for the correct private CA instead of disabling verification. |
| Login succeeds but SQL fails | Select an engine profile. Management tokens authorize account operations, not SQL. |
| Partial search or stopped batch | Inspect returned results and exit code 4; earlier work may have succeeded. |
| SQL timeout or interruption | Check whether the statement took effect before resubmitting it. Cancellation is not proof of rollback. |
Verify command syntax
oc init --help
oc doctor --help
oc sql --helpPut global flags first:
oc --profile development --output json --timeout 60s sql --file query.sqlUse a SQL file to avoid shell quoting problems. For support, include the CLI version, command family, exit code and request ID when available. Remove tokens, database-user keys and private query data from shared logs.
Exit codes · Recover a SQL session
Check a source build
These checks are for CLI contributors, not required for normal installation. From an approved source checkout:
go test ./... -count=1
go vet ./...
go build -o oc ./cmd/oc
./oc ui --render --plainOn Windows, build oc.exe and run ./oc.exe. To check OS credential storage and shell completion:
python3 scripts/verify_native.pyUse python on Windows. Unix checks need the supported shells and an unlocked credential store. Passing these local checks does not establish live database compatibility.
Run an isolated engine check
Use a disposable loopback engine with OC_DB_RBAC_ENFORCE_WRITES=1. Set OC_SMOKE_DISPOSABLE=1, OC_SMOKE_URL and OC_SMOKE_TOKEN in the test process environment, then run:
python3 scripts/smoke.py --binary ./oc --receipt smoke.jsonThe script writes test data. Keep it off shared or production databases. Inspect the receipt, stop the disposable engine and remove its temporary data and credentials when finished.