Authentication issues
This section covers errors that occur when the SDK can’t find or validate your credentials. Symptom:CWSandboxAuthenticationError or WandbAuthError raised on sandbox operations.
Which credential the SDK looks for depends on the authentication strategy you select. The SDK doesn’t fall back from one strategy to the other.
- CoreWeave (default): reads
CWSANDBOX_API_KEY, a CoreWeave API access token, and sends it as a bearer token. Requests go out unauthenticated when the variable isn’t set. - W&B: selected explicitly by passing
auth=AuthStrategy.WANDB. Credential discovery is delegated to thewandblibrary, which accepts an activewandb loginsession,WANDB_API_KEY, or theapi.wandb.aientry in~/.netrc.
Common issues
Command execution issues
This section covers problems related to running commands inside a sandbox, including timeouts, long-running processes, and how to interpret exit codes.Timeout tuning
The difference between client-side and server-side timeouts helps you choose the right setting when a command takes longer than expected. For command execution, distinguish the operation timeout from the sandbox lifetime:
For the complete list of timeout settings and their defaults, see Timeouts.
Client-side timeout (
timeout_seconds):
max_lifetime_seconds):
Long-running commands
Issue: Command takes longer than expected. Solutions:- Set an appropriate timeout:
- Use streaming to monitor progress:
Exit code interpretation
Issue: You need to understand command failures. Exit codes follow Unix conventions:
Use
check=True to raise on non-zero exit: