-
Notifications
You must be signed in to change notification settings - Fork 0
Troubleshooting
This page lists the errors you are most likely to hit, what each one means, and how to fix it. Every error maps to a SandboxError variant and, on the CLI, to a distinct exit code (see CLI Usage).
The guest executed more instructions than its fuel budget allowed. This is expected for an infinite loop or for a genuinely heavy workload run under too small a budget.
- If the module is legitimate, raise
--fuel(or thefuelfield onLimits). Run once with a generous budget and read the reportedfuel consumedto size it. - If the module should not loop, the budget is doing its job; fix the guest.
The guest ran past its wall-clock deadline and the epoch watchdog interrupted it.
- For a legitimate slow workload, raise
--timeout-ms(or thetimeoutonLimits). - If a module that should finish quickly is timing out instead of exhausting fuel, check whether it is blocking inside a host call; time spent there does not consume fuel but does count against the wall clock.
The guest tried to grow its linear memory or tables past the cap.
- Raise
--memory-mb(ormemory_bytesonLimits) if the working set is legitimately large. Remember memory grows in 64 KiB pages, so the effective cap is rounded to a page boundary. - If the module should not need that much, the cap is working; the module is the problem.
The module declared an import that the host did not grant. This is the deny-by-default contract working as designed.
- If the import is
host::log, grant it with--allow-log(CLI) orHostAbi::deny_all().allow_log()(library). - If it is anything else (for example a WASI import like
wasi_snapshot_preview1::fd_write, orenv::*), sandboxd does not provide it by design. Recompile the guest without that dependency, or extend the host ABI yourself following the recipe in Host ABI. Do not expect WASI to be available; there is none.
A common cause is compiling a guest with a standard library that pulls in WASI. Build the guest for a freestanding target (for example wasm32-unknown-unknown rather than wasm32-wasi) so it does not import the host facilities sandboxd refuses to provide.
The bytes were not valid WebAssembly or WAT, or failed validation.
- Confirm the file is a real
.wasmor.wat. sandboxd parses WAT directly, so either is fine, but plain text that is not WAT will fail here. - A truncated or corrupted
.wasmproduces this too.
The function you asked to invoke does not exist, or you passed the wrong number or types of arguments.
- Check the export name. The CLI default is
run; pass--invoketo call a different export. - The CLI passes i32 arguments only. If the function expects other types, use the library API and supply matching
Valuevariants. A parameter-count or type mismatch is reported rather than panicking.
You granted the log capability but the guest does not export its memory under the name memory, so the host cannot read the string.
- Ensure the module has
(memory (export "memory") ...). Thelogger.watfixture is the reference.
This is expected. wasmtime and Cranelift are large crates and the first compile builds them from scratch. Subsequent builds reuse the cached artefacts and are fast. The CI workflow caches the cargo registry and target directory to keep pipeline times down.
Run cargo fmt --all locally and commit the result. CI enforces formatting with cargo fmt --all --check, so any unformatted code fails the pipeline. If rustfmt is missing locally, install it with rustup component add rustfmt.
SarmaLinux . sarmalinux.com . sandboxd on GitHub
Understand it
Reference
Operate it
Security
Extend it
Decide on it
SarmaLinux . sarmalinux.com