p0 ls
1. Authentication & Authorization Failures
Error Message
Cause
Resolution
Please run 'p0 login <organization>' to use the P0 CLI.
You aren’t logged in or your identity file is missing.
Execute p0 login <ORG ID>
and complete the OIDC flow.
Could not load credentials for "<name>"
Corrupt or expired credential cache.
Remove the cache directory (rm -rf ~/.p0/cache
) and re-run p0 login
Silent hang or immediate exit without output
Token auto-refresh failed but no explicit error.
Clear credentials (p0 logout or delete identity.json
) and log in again.
2. Network & Connectivity Issues
Error Message
Cause
Resolution
Network error: Unable to reach the server at https://<tenant>/o/<org>/command/.
Cannot connect to the P0 API endpoint (DNS, proxy, firewall).
Verify your internet connection and DNS lookup.
Check appUrl in ~/.p0/config.json
Whitelist the endpoint in your proxy/firewall.
fetch failed
Underlying fetch call timed out or TLS handshake failed.
Test reachability with curl https://<tenant>/o/<org>/command/
Ensure your system clock is accurate (TLS requires correct time).
3. Flag & Usage Errors
Error Message
Cause
Resolution
Unknown argument: --foo
Typo or unsupported flag.
Check flags with p0 ls --help or p0 ls <provider> --help.
Invalid number for '--size'
Non-integer or out-of-range value provided.
Use a positive integer: e.g. --size 20.
No output, even though resources exist
You omitted the provider or subcommand.
Ensure you specify a valid provider and subcommand (e.g., p0 ls aws resource).
No <arg>
The backend returned zero matches for your query.
Remove or change your search term/filter; try running without arguments.
4. Subcommand & Provider Validation
Symptom
Cause
Resolution
Unknown command: ssh
Misspelling or integration not recognized.
Verify integration names with p0 ls --help (must be ssh, not sShh, etc.).
Empty list from p0 ls ssh session destination
No session destinations match your filter or you lack permissions.
Try a broader or different search term.
Confirm your account has at least one session destination assigned.
Backend error JSON (e.g., permission denied)
Your P0 role or tenant configuration does not allow listing.
Ensure your P0 admin has granted your role the “list” permission for that provider integration.
5. Pagination & Truncation Questions
“Showing the first N…” but you know there are more
CLI fetched 2×size to detect truncation; your --size controls only display.
Resolution: Increase --size to show more items, or add a filter term.
Suggestion “use <like> to narrow results”
This indicates isTruncated=true and no search term was provided.
Resolution: Add a search argument after your subcommand (e.g., p0 ls aws resource logs).
6. JSON Mode Issues
Invalid JSON output or parse errors
Occurs if the backend returns malformed JSON.
Resolution:
Run without --json to see the human output.
Contact P0 support if the payload is not valid JSON.
6. Debugging Tips
Enable debug
--debug
Prints HTTP request/response details to stderr.
Check local config
cat ~/.p0/config.json
Verify appUrl and any proxy settings.
Test API directly
curl -X POST https://<host>/o/<org>/command/ \
-H "Authorization: Bearer $(token)" \
-d '{"argv":["ls","aws","resource",""],"scriptName":"p0"}'
Examine raw JSON to ensure the backend is returning items.
Validate provider-side state
If you expect resources to exist, confirm in the native console or CLI (e.g., aws s3 ls, kubectl get pods, etc.).
Last updated