Skip to main content
Use this guide when executions behave unexpectedly and you need to identify whether the issue is in your code, runtime setup, policy configuration, or session lifecycle.

Diagram: Debugging workflow

1) Turn on observability first

CLI debug logs

Useful for:
  • engine option resolution (mode, network, limits)
  • container lifecycle and pool behavior
  • execution completion metadata (exitCode, duration, truncated)

Server debug logs

Useful for:
  • request metadata (runtime, code length, sessionId)
  • session reuse vs creation
  • semaphore acquire/release
  • auto-prune activity

2) Reproduce with a minimal command

Before deep analysis, reduce moving parts:
Then add complexity one knob at a time:
  • package installs (--install)
  • filtered network (--net filtered, --allow, --deny)
  • persistence (--persistent, --persist)
  • larger input/files

3) Inspect container state with --persist

--persist leaves execution containers running so you can inspect filesystem/process state.
Then inspect with Docker:
--persist is for debugging and leaves containers running by design. Clean them up after investigation.
Cleanup:

4) Validate effective configuration

Many issues come from unexpected default/override values.
Confirm:
  • defaults.network, defaults.timeoutMs, defaults.memoryLimit
  • network.whitelist / network.blacklist
  • cleanup.autoPrune, cleanup.maxContainerAgeMs
  • maxConcurrent

5) Debug stream vs non-stream behavior

CLI streams by default. If debugging final output/result flags (truncated, final stderr), switch to non-stream mode:
In non-stream mode CLI prints:
  • final stdout/stderr
  • truncation warning when output exceeded cap
  • network logs (if present)

6) Debug network policy issues

For filtered mode connectivity checks:
What to verify:
  • target host actually matches allow regex
  • deny rules are not shadowing allow rules
  • networkLogs appear only when both are true:
    • network: filtered
    • logNetwork: true

7) Debug session and file issues (remote)

If files/sessions fail, verify sessionId usage and lifecycle:
  1. create/reuse session via /execute with sessionId
  2. call /file upload/download using same sessionId
  3. check prune settings if session disappears

8) Library-level debugging patterns

For remote client debugging:

9) High-signal checks by failure class

Runtime selection

  • explicitly pass --runtime when extension detection is uncertain
  • avoid inline Deno; run Deno code from file path (.mts) in current adapter model

Resource pressure

  • raise --timeout for long workloads
  • raise --memory for OOM-like termination
  • increase --sandbox-size for large package/file workloads

Persistent mode behavior

  • one persistent container supports one runtime
  • local CLI process exit ends engine lifecycle
  • for multi-call remote persistence, use stable sessionId

Output surprises

  • set --no-stream to inspect final aggregate output path
  • raise --max-output when output is intentionally large

Execution guide

Execution pipeline details and mode-level semantics.

Remote server and client

Session lifecycle, file endpoints, and auto-pruning behavior.

Security model

Filtered networking, seccomp, and masking boundaries.

Troubleshooting

Symptom-driven fixes and concrete recovery steps.