Sandbox and Kit stops
An item keeps the sandbox, env names and harness hosts it was filed with. A later change to a repo's sandbox: in repos.yaml (expose, network, resources or kit), to its env: or env_passthrough, or a new host in a harness file reaches only items filed after it. A plain kraft item retry, kraft admin reload and a server restart all launch the stopped item in its old sandbox, and it stops the same way.
To give the item the sandbox repos.yaml sets now, run kraft item retry ID --sandbox-from-config: it prints both and, with --yes, replaces the old one and retries. Only the sandbox is read again. For a new env name or harness host, file the item again with kraft item create, and cancel or abandon the stopped one.
Find your reason
The first column is the text the board and kraft view show ID print. ... stands for text that varies. A row either holds the whole fix or links to an entry below.
| The reason says | What happened | Fix |
|---|---|---|
this launch is sandboxed in <repo> with no `network:` policy, which leaves the worker's network unrestricted and gates not enforced; add a `network:` policy to the sandbox (<address>), or, if you accept that, set `unrestricted_network: true` on it | The sandbox has no network: policy and doesn't set unrestricted_network. | Add a network: policy to the sandbox, then run kraft item retry ID --sandbox-from-config --yes. See A sandbox with no network policy. |
kraft: a process in the sandbox was killed by its memory limit (<size>), or ... under its <size> memory limit (the runtime did not confirm it was the limit) | The sandbox's memory limit killed the task. In the second form the runtime didn't confirm it, but the container exited 137 under the limit and Kraft didn't stop it. | Raise resources.memory in the sandbox policy, then run kraft item retry ID --sandbox-from-config --yes. Or make the task need less and run kraft item retry ID. See Out of memory. |
the Kit <ref> cannot be used: ..., or the Kit <ref> has not been fetched here yet ... | The item's sandbox is a Kit Kraft couldn't fetch, or won't run. | See A Kit is refused. |
work item <id> runs sandboxed, and its workspace members <paths> are not the checkouts Kraft made ... | A member of the item's worktree isn't the checkout Kraft made from its connected repository. | See Sandboxed workspace members. |
workspace member <path> of <worktree> has no checkout Kraft made ..., and four more like it | A sandboxed launch would have mounted a member Kraft couldn't check, so it didn't start. | See A sandboxed launch wouldn't mount a member. |
... runs sandboxed, and no connected repository is known for <paths> ..., or member <path> of <id>: ... | A member's repository isn't connected, is missing, isn't the top of a repository, or already has the item's branch. | See A member's repository can't be checked out. |
kind: os does not run while Kraft runs as root, bubblewrap is not installed ..., bubblewrap cannot create a user namespace here: ... and the other messages of a kind: os sandbox is refused | The host can't run a kind: os sandbox, or a command the session needs isn't in its view. Added in 2.3 | See A kind: os sandbox is refused. |
work item <id> runs sandboxed, and its worktree holds git repositories Kraft did not create: <paths>. ... | The worktree of a sandboxed item holds a nested git repository, and Kraft runs no git there. | See A nested repository Kraft didn't create. |
Stop reasons in detail
A sandbox with no network policy
Kraft refuses every launch into a sandbox that has neither network: nor unrestricted_network: true, whatever the harness. Without network:, Kraft sets up no channel and doesn't restrict the container's network, so nothing keeps the worker from reaching Kraft's API.
Add a network: policy to the repository's sandbox: in repos.yaml, then run kraft item retry ID --sandbox-from-config --yes. To accept an unrestricted network and gates that aren't enforced, set unrestricted_network: true there instead; the two keys can't be set together. See Without a network policy.
Sandboxed workspace members
A member of the item's worktree isn't the checkout Kraft made from its connected repository. A sandboxed worker may have swapped it, or the item started before Kraft checked members out this way. Kraft stops because host git there would read config the worker can write.
Run kraft item abandon ID --reason "..." --yes, then file the item again with kraft item create: it checks each member out afresh.
A sandboxed launch wouldn't mount a member
A sandboxed launch would have mounted a member Kraft couldn't check against its connected repository, or reach without a symlink, so it didn't start. The reason is one of:
workspace member <path> of <worktree> has no checkout Kraft made ...this sandboxed launch was not given the checkout of workspace members ...setup command for <id> cannot run: its sandbox was not given the checkout ...<path> is not a directory; the member under it is not mounted... cannot be made in the sandbox's ref store ...
Run kraft item retry ID. If the member's checkout changed, the check before the next task names it. If it recurs, report it as a bug.
A member's repository can't be checked out
A workspace member's repository must be connected, at the path repos.yaml gives, for Kraft to check it out. Each reason below names the member and the item.
| The reason says | What happened | Fix |
|---|---|---|
<id> runs sandboxed, and no connected repository is known for <paths> ... | A member's repository isn't connected, so Kraft has nowhere safe to check it out from. | Connect it with kraft repo connect PATH, then retry. |
member <path> of <id>: the connected repository <path> for <path> is missing ... | The member's repository is no longer at the path repos.yaml gives. | Reconnect it (kraft repo connect PATH), or fix its path in repos.yaml, then retry. |
member <path> of <id>: the connected repository <path> for <path> is not the top of a git repository ... | The path repos.yaml gives is a directory inside some other repository, so git there would act on that one. | Fix the member's path in repos.yaml to the repository's own top directory, then retry. |
member <path> of <id>: <repo> already has a branch <branch> at <sha>, not at <sha> ... | The repository already has a branch with the item's name, somewhere other than the commit the root points at. Kraft won't check it out and replace what the root records. | Look at that branch in the member repository. Move it to the named commit or delete it, then retry. |
A nested repository Kraft didn't create
The reason starts work item <id> runs sandboxed, and its worktree holds git repositories Kraft did not create: <paths>. A sandboxed worker writes the config of any git repository it makes in its worktree, and git reads that config when it commits or rebases, so Kraft runs no git there until you look. Kraft checks before the walk, before each task launches, and before any other step that refreshes the worktree.
The stop names an untracked nested repository, a gitlink whose directory is populated, and a gitlink the branch added or moved since the base. A submodule the repository already had, left unpopulated, doesn't stop anything. A workspace member reason that says It also holds git repositories Kraft did not create names these paths too.
In the worktree (cd "$(kraft repo path ID)"), remove the named repositories, or run git rm --cached on the gitlinks. Then run kraft item retry ID, or abandon the item. When a nested repository stops the item lists what counts.
A Kit is refused
An item whose sandbox is a Kit reads the Kit before its worktree is made. If that fails, the item stops and the reason names the Kit and why. The same check runs before each task; there a failure ends the launch as a configuration error, and nothing runs outside the sandbox. The rest of the reason says which:
| The reason goes on | Fix |
|---|---|
`manifest inspect <ref>` failed: ..., or under Podman `pull -q <ref>` failed: ... or `image inspect <ref>` failed: ... | The CLI couldn't read the Kit: a wrong reference, a missing registry login or a registry it doesn't trust. Check it with docker manifest inspect <ref> as the user Kraft runs as. |
<ref> is not a Kit: no vnd.docker.sandbox.kit.descriptor annotation | The image wasn't built with the Kit frontend (# syntax=docker/sandbox-kit:3). |
requires <type>; Kraft does not enforce it, is a kind: mixin ..., has a capability group ... | The Kit needs something Kraft doesn't run. Mark the capability optional: true, or remove it, and rebuild. Docker's published Kits are refused this way: build one for Kraft. |
credential service '<service>' has no binding ... | Add <service>: <DAEMON_ENV_NAME> under credentials in sandbox.yaml, and set that variable in the server's environment. |
A dotted path and a message, such as capabilities.1.config.apiKey: ... | The descriptor doesn't decode: fix the Kit at that path. |
has not been fetched here yet | A review, gate review, escalation turn or a read through the artifacts or diff API ran before any task fetched the Kit. Retry the item. |
Fix the Kit or the policy, then run kraft item retry ID. A changed Kit is a
new digest: put it in kit: in repos.yaml, then run
kraft item retry ID --sandbox-from-config --yes.
Doctor rows for a sandbox
kraft admin doctor prints these rows only for a repository that runs sandboxed. <repo> stands for its name.
sandbox <repo>
For a sandboxed repository, the row names the runtime it found (Docker or Podman, rootless or not) and the resource limits it can enforce. It reads sandbox.yaml afresh each run. It fails when:
- the runtime doesn't answer. Start the Docker or Podman daemon. Doctor can wait about a minute for a runtime that is slow to answer: see A runtime that doesn't answer.
- SELinux enforces and sandbox.yaml doesn't say how to get past it. Set
selinuxthere. ca_bundlecan't be used. Fix the path, which must be an absolute path to a PEM file, or unset it. See CA certificates.- the sandbox sets a limit the runtime can't enforce. Remove the limit or change it.
- the sandbox image isn't pulled. Run the
pullcommand the row names, such asdocker pull <image>. - with a
network:policy, the egress relay image isn't pulled. Run thepullcommand the row names. - with a
network:policy, the channel to the relay can't be reached. See It fails closed.
| The row says | What it means | Fix |
|---|---|---|
sandbox <repo> for a kind: os sandbox on Linux | The host can't run bubblewrap: a user-namespace sysctl, a missing or old bwrap, Kraft running as root, or an unsupported platform. The row passes as bubblewrap <version>. Added in 2.3 | Apply the fix the row's message names. See A kind: os sandbox is refused. |
sandbox <repo> for a kind: os sandbox on a Mac | The Mac can't run Seatbelt: an unsupported machine, Kraft running as root, /usr/bin/sandbox-exec missing, Kraft inside a sandbox, or a profile sandbox-exec rejects. The row passes as Seatbelt (sandbox-exec), macOS <version>. Added in 2.3 | Apply the fix the row's message names. See A kind: os sandbox is refused. |
sandbox <repo>: the Kit <ref> is refused: ... | The repository's Kit can't be fetched or won't run, so each item there stops. | See A Kit is refused. |
For a repository whose sandbox is a Kit, doctor fetches and lowers the Kit first. The sandbox row fails naming the Kit and why when it can't, and otherwise it and the egress, proxy and credentials rows check the sandbox the Kit lowers to. Doctor fetches each Kit it hasn't cached; under Podman a single-manifest Kit is pulled, which can take up to 10 minutes per repository the first time.
The other sandbox rows
| Row | What it means | Fix |
|---|---|---|
egress <repo> | The sandbox sets no network: and no unrestricted_network: true, so every agent launch into it is refused. With unrestricted_network: true it is a warning: tasks there reach any host, the cloud metadata address included, and gates aren't enforced. | Set network: in the sandbox policy to allow only the hosts they need. See Network policy. |
egress listener | The server's TLS listener didn't answer, so a sandbox under network: on a runtime in a VM has no route out. The row appears when some sandbox sets network:. | Run kraft admin restart. |
kit hosts <repo> (a warning) | The Kit doesn't allow a host a harness requires, so that harness's sessions under it are refused the host. | Add the host to the Kit's runtime allow list and rebuild it, or run that harness elsewhere. |
kit credentials <repo> (a warning) | An optional Kit credential has no binding in sandbox.yaml, so it is skipped. | Add <service>: <DAEMON_ENV_NAME> under credentials in sandbox.yaml. |
proxy <repo> (a warning) | A proxy variable points at this machine's loopback, which a container can't reach, so sandboxed tasks run without it. | Set network: in the sandbox policy to route them through Kraft's own proxy. See Proxy. |
ca <repo> (a warning) | SSL_CERT_FILE is set but can't be used as the sandbox's extra CA, so sandboxed tasks trust only their image's roots. | Fix the file, or name a CA in ca_bundle in sandbox.yaml. See CA certificates. |
ca <repo> for a kind: os sandbox | Always passes: the sandbox trusts the host's trust store plus the CA files the daemon's CA variables name, and ca_bundle isn't used. Added in 2.3 | None. |
credentials <repo> | A credential the sandbox's proxy manages has no value here, so the proxy refuses every request that should carry it. A name no harness declares how to inject only warns. | Give each name the row lists a value. See Credentials. |
The proxy, ca and credentials rows read the environment of the kraft admin doctor process, not the running server's. They agree when both started from the same shell. If the server runs as a service with its own environment, check that one.
Related
- Kits: what a Kit is and how Kraft runs one.
- Doctor failures: every other
kraft admin doctorrow. - Troubleshooting: the topic pages for every other stop reason.
Worktree and git stops
Fix a work item that stopped on a rebase conflict, a worktree git won't rebase or commit in, a branch someone else pushed to, or a branch origin lost.
A kind: os sandbox is refused
Fix a work item that stopped because the host can't run a kind: os sandbox, or because a command or path a session needs isn't in the sandbox's view.