Troubleshooting

Start with pcli2 doctor: it checks the binary, the configuration, the credentials, the token, the tenant, the caches and connectivity in one screen, and says what to do about anything that is wrong.

By exit code

Every failure exits with a code that names its class (the full table is in Scripting and Automation).

CodeMeaningWhat to do
64The command line is wrong, or a prompt was needed with --no-inputRead the message; --help on the command shows its flags and examples
65Data could not be read (a malformed CSV, an unexpected API answer)Check the input file; for an API answer, run with --verbose and report it
66An input file cannot be openedCheck the path and its permissions
67An asset, folder, tenant or environment does not existCheck the spelling; paths start at / (Physna shows the root as "Home", and /Home/... works too)
68The deployment lacks a feature (failure diagnostics) or doctor could not reach a serverSee Proxies, Certificates and Timeouts
69Try again later: rate limited, a server error that outlasted the retries, a batch with failed items, a report still runningRun again later; for a batch, the summary lists what failed
78The configuration is brokenpcli2 config validate, then pcli2 env list
100Not logged in, or the credentials were rejectedpcli2 auth login
101The network failedSee Proxies, Certificates and Timeouts
102The API rejected the requestThe message carries the server's reason

Common situations

"Access token not found": run pcli2 auth login. In CI, set PCLI2_CLIENT_ID and PCLI2_CLIENT_SECRET first.

"No tenant specified and no active tenant selected": run pcli2 tenant use (or pass --tenant to the command).

A folder path is "not found" but exists: the folder cache may predate the folder; add --reload to folder list or asset list, or run pcli2 cache clear.

An asset shows failed: pcli2 asset diagnose --path <path> asks Physna why; pcli2 tenant failures lists what failed recently.

Bulk commands are slow or rate limited: folder commands run four items at a time by default; lower it with --concurrent 1 or space items out with --delay.

Seeing what pcli2 does: --verbose prints pcli2's own debug log on stderr; RUST_LOG=debug opens up the HTTP stack as well. --stats prints the number of API requests, retries and token renewals at the end.

Checking the basics

pcli2 auth expiration          # logged in, and for how long
pcli2 tenant get               # the active tenant
pcli2 env get                  # the active environment and its URLs
pcli2 config get path          # where the configuration lives
pcli2 config validate --api    # configuration, credentials and a test call

Reporting a problem

Include the output of pcli2 --version and pcli2 doctor, the command you ran, and the message (with --verbose if you can reproduce it). An internal error (exit 70) is always a bug.