OriginChainDB

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.

Find where a CLI check failsA successful offline check does not prove that a database request can succeed.
  1. Check the installed versionConfirm which CLI build you are testing.
  2. Run offline diagnosticsCheck the selected profile without contacting the database.
  3. Run online diagnosticsTest the connection and required credentials.
  4. 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 engine

For account commands, use oc --profile work doctor --target management instead. To inspect local settings without any server request:

oc --profile development doctor --target engine --offline

Read the first failed check and its suggested fix before changing credentials or connection settings.

CheckWhat success establishes
oc versionThe executable can run locally.
Offline doctorThe selected profile's local settings can be checked without a server request.
Online engine doctorThe configured engine passes the connection and access checks it performs.
Your actual queryThe 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

SymptomWhat to check next
oc is not foundOpen a new terminal. Check the install directory and PATH.
Missing engine credentialsLoad OC_BEARER and OC_DB_KEY, or save engine credentials for the selected profile.
Credential store unavailableUnlock Keychain or Secret Service. Linux also needs secret-tool.
Saved credentials fail after editing a profileRestore the original endpoint/identity or save credentials for the new settings.
HTTP 401Check the selected credential, expiry and revocation. Use the matching engine or management login.
HTTP 403Check database identity, organization, scope and role permissions. A new login does not grant missing access.
TLS errorConfirm the HTTPS origin. Use --ca-cert FILE for the correct private CA instead of disabling verification.
Login succeeds but SQL failsSelect an engine profile. Management tokens authorize account operations, not SQL.
Partial search or stopped batchInspect returned results and exit code 4; earlier work may have succeeded.
SQL timeout or interruptionCheck 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 --help

Put global flags first:

oc --profile development --output json --timeout 60s sql --file query.sql

Use 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 --plain

On Windows, build oc.exe and run ./oc.exe. To check OS credential storage and shell completion:

python3 scripts/verify_native.py

Use 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.json

The 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.

© 2026 Silicoyn Technologies Pvt Ltd

On this page