Help

Troubleshooting

Fix authentication, sandbox startup, runtime access, network, and SSH issues.

On this page

Fix authentication and permission errors

Identify whether a request failed because of credentials, access scope, or resource visibility.

A 401 response means the credential was missing, expired, or invalid. Check that the server sent X-API-Key or Authorization: Bearer, that the environment variable is set in the process making the request, and that the key has not been revoked. For OAuth, sign in again when the refresh token has expired. See Errors and limits for the status code reference.

A 403 means the credential was accepted but does not have the permission required for that action. Use MACHINE_READ to inspect resources, MACHINE_CREATE to provision, MACHINE_UPDATE for lifecycle or runtime access, MACHINE_DELETE to remove a sandbox, and ORG_MANAGE for organization resources.

A 404 can mean the ID is wrong or the resource belongs to another organization. The API avoids revealing resources across organization boundaries. Confirm which organization the credential belongs to and list visible resources before retrying with an ID.

When reporting a failure, include the HTTP status, error code, request ID, method, and path. Remove API keys, data-plane tokens, secret values, and private user data from logs and support messages.

A sandbox does not become ready

Check the sandbox state and events before retrying provisioning.

Sandbox creation is asynchronous. A successful create response means the request was accepted; it does not guarantee the runtime is ready. Fetch the sandbox detail record and wait for running before requesting commands, files, SSH, desktop actions, or previews. See the sandbox lifecycle guide for the available states and actions.

If the sandbox remains pending or becomes failed, read its events and logs to find the latest lifecycle transition and diagnostic message. Confirm that the template ID is visible to the credential's organization and that the requested resources and region are supported by that template.

Do not create a new sandbox every time a poll times out. First inspect the existing sandbox and its events. If the original create request itself timed out, retry that same logical request with its original Idempotency-Key to avoid duplicate sandboxes.

If a terminal or failed state is reached, decide whether to retry from the same sandbox, create a fresh sandbox from the template, or restore from a prepared snapshot. Preserve logs and the request ID before cleanup if you need to diagnose a recurring failure.

A command or file operation fails

Check lifecycle readiness, runtime credentials, command status, and paths.

Confirm the sandbox is running and call waitForAccess before the first runtime operation. The SDK session client obtains and refreshes the scoped data-plane credential. If you built a custom client, request a new exec-access credential after its expiry time; never reuse a token for another sandbox. See data-plane access for the credential flow.

Check the command's exitCode, stderr, working directory, and timeout. A nonzero exit code means the command ran and failed; it is different from an authorization or transport error. Commands and file operations execute inside the sandbox file root, so confirm that input paths exist in the guest rather than on your application host.

If the sandbox is paused or stopped, resume or start it and wait for running before retrying. If the runtime is failed, inspect events and logs before recreating the sandbox. Treat command output as untrusted data and redact secrets before storing it.

A preview or network connection does not work

Separate a service that is not listening from an access or port configuration issue.

First confirm the application is running inside the sandbox and listening on the expected port. Then confirm that the sandbox declares the matching protocol and internal port. A preview code cannot make a stopped process or undeclared port start listening.

For a browser, use the returned preview handoff URL directly. For fetch, WebSocket, Playwright, or Chrome DevTools Protocol, use the preview base URL and send the short-lived code as a bearer credential. Do not append a path to the one-time handoff URL. The preview guide explains the two access forms.

For raw TCP clients such as database drivers, expose a TCP port and use tunnel access. A public ingress policy is unauthenticated; choose it only when the service is intentionally available to anyone who can reach its endpoint. Preview-code expiry and port exposure are separate controls.

SSH does not connect

Verify the key identity, sandbox state, and runtime key synchronization.

Confirm the sandbox is running and that you registered the public key matching the private key on your local machine. SSH keys belong to a user. If you created the sandbox under another identity, the key may not be part of its authorized set.

When a key was added or removed after sandbox creation, sync the current key set into the running sandbox. Then retry with the CLI SSH command or pass the correct identity file to your local SSH client. See SSH key setup for the full workflow.

If the connection still fails, check the sandbox detail for SSH service information and make sure you are using the latest connection details. Do not send a private key to Zeish or include it in a bug report.