SPAWNBOX

Troubleshooting

Common problems, their causes and what to do: KVM, host capacity, keys, quotas and template builds.

Type these commands on the host.

Problem Cause Action
The log shows sandboxes run in gvisor, but you want Firecracker Spawnbox cannot open /dev/kvm Type spawnbox doctor. Use a bare-metal server, or turn on nested virtualization.
Spawnbox does not start, and the log shows --backend firecracker needs /dev/kvm You set --backend firecracker on a host without KVM Remove --backend firecracker, or use a host with KVM.
A create gives 503 no_capacity with the memory of this host is reserved by other sandboxes The running sandboxes reserve --memory-overcommit-pct of the host memory Delete or pause sandboxes, add a worker, or use smaller templates.
A create gives 503 no_capacity with this host is short of memory Free host memory is below --memory-pressure-pct; the host is pausing idle sandboxes Wait and try again, add a worker, or give the sandboxes less memory.
A create gives 503 no_capacity for a microvm-only tenant No Firecracker host has space Add a Firecracker host, or set isolation of the tenant to any.
The installer stops with only Debian and Ubuntu are supported Wrong operating system Use Ubuntu 22.04 or later, or Debian 12 or later.
curl .../healthz shows Connection refused The service is not running Type sudo systemctl status spawnbox. Then read the log with sudo journalctl -u spawnbox -n 50.
A request gives 401 unauthorized The key is wrong or missing Make sure that $A contains Authorization: Bearer and your full key.
A request gives 429 quota_exceeded The tenant is at a quota limit Delete or pause sandboxes, or increase the quota with PATCH /v1/tenants/{id}.
A create request gives 409 The template build is not ready Wait until latest_build.state is ready.
A snapshot gives 409 protected_env The sandbox was created with env values, which the template would show Use secrets for the values, or create the sandbox without env.
The server stops at start with cannot read the stored env of ... secrets.key is not the key that encrypted them, or their rows are damaged Put back the earlier secrets.key, or set --secrets-key-file, and restart. If the key is right, add --allow-unreadable-env to start without those sandboxes; they stay as they are.
You are not sure that secrets.key reads the database, for example after you moved or restored it Stop the server and type sudo /opt/spawnbox/bin/spawn-api check-data (add --database-url for Postgres). It decrypts each secret, sandbox env and CA key, and tells which ones fail.
spawnbox-backup.service fails The passphrase file is missing, the target cannot be written, pg_dump is older than the database server, or the backup ran longer than its 4-hour limit (TimeoutStartSec) Read sudo journalctl -u spawnbox-backup. Refer to Back up and restore.
The server stops at start with downgrades are not supported An earlier release runs on a database that a newer release changed Install the newer release again, or restore the backup from before the upgrade.
A move gives no host has the same backend, kernel, base disk, Firecracker or runsc, egress CA and CPU model The hosts have different backends, files or CPUs Compare fingerprint, backend and cpu in GET /v1/nodes. Sandboxes cannot move between Firecracker and gVisor hosts. Copy /opt/spawnbox/vmlinux and /opt/spawnbox/rootfs.ext4 from the primary to the worker, then restart the worker.
A request gives 503 node_unreachable The worker that runs the sandbox does not answer On the primary, look at the worker with GET /v1/nodes. On the worker, type sudo systemctl status spawnbox.
A request for a persistent sandbox gives 503 node_unreachable for a long time Its worker is down, and no proof says that its VM is stopped Bring the worker back, or stop its machine and call POST /v1/nodes/{id}:fenced. Refer to Fence lost hosts.
A request for a cold sandbox gives 503 volume_unavailable The only copy of its volume is on a host that is down Bring the host back.
A request for a cold sandbox gives 503 rebuilding This host is building the sandbox’s template spec again, because it cannot use the recorded build Try again in a minute. Refer to Upgrades and old builds.
A request gives 503 sandbox_cold The sandbox’s worker found it cold, and the primary did not learn it in time to start it again Try again. Refer to Upgrades and old builds.
A request for a cold sandbox gives 409 build_failed The sandbox’s template spec cannot be built on this host now, for example a setup command fails Read the error. Fix what the setup needs, such as network access, then try again after 5 minutes.
A worker stops with the join token is unknown, used or expired The token was used or is older than one hour Make a new token on the primary.
A worker log shows not a node of this fleet The worker was removed Remove /var/lib/spawnbox/fleet/worker/ and add the worker again with a new token.

To check the host in more detail, type this command:

spawnbox doctor

doctor checks cgroup v2, and shows the backend that the host uses: Firecracker if KVM operates, or gVisor if it does not. Exit code 0 means that no check failed.

doctor also gives WARN when --data-dir (default /var/lib/spawnbox) is not on a dm-crypt or LUKS disk. Memory files and disks of sandboxes are not encrypted. On AWS, the encryption of an EBS volume cannot be seen from the instance, so doctor says that it cannot tell. Check the volume in the EC2 console. Instance store disks are encrypted by AWS.

To remove Spawnbox, type sudo /opt/spawnbox/install.sh --uninstall. This keeps your data. To remove the data too, type sudo /opt/spawnbox/install.sh --purge.

This page is the “Troubleshooting” section of README.md ↗. Found a mistake? Edit it on GitHub ↗