Troubleshooting
This page is for the operator of a function-wasm pod and for the module author whose module the runtime refuses. Find the message in the pod’s logs, in a step’s fatal result or in the output of function validate or guestfn, then follow the entry. Entries are grouped by what failed and match the current release. Each quoted message is a prefix or a fragment: match on the part that doesn’t vary.
Module load
cannot instantiate module: trap: …: the guest trapped while the runtime instantiated it, such as by panicking in its start-up code. The stack is in the stderr of the function pod.component does not implement the guestfn:function@1.0.0 world: …: the component doesn’t typecheck againstwit/guestfn-function.wit: it has norunexport (no exportrunfound) or imports something the runtime doesn’t provide. Rebuild against the currentwit/, and useguestfn inspect fn.wasmto list what the module exports and imports.cannot load module …: cannot compile module: failed to parse WebAssembly module: threads support is not enabled, or the same for another proposal: the module uses a WebAssembly proposal the engine refuses: threads, GC, function references, exceptions, tail calls, multi-memory or memory64 (ABI v2 lists what it accepts). Build the guest without that feature, which no scaffold’s toolchain emits by default.cannot load module …: cannot download module: the redirect to <url> is not followed: <host> resolves to an address the default block list refuses: the download was redirected to another host at a loopback, private or otherwise blocked address. Specify the final URL inmodule.http.url. See HTTP redirects. A manifest’s download sayscannot download manifest: …, formodule.http.manifestURL.… is not followed: not an http or https URLis a redirect to another scheme, andmore than 10 redirectsa chain longer than the runtime follows.cannot load module …: cannot fetch manifest sha256:…: manifest exceeds the size limit of 4194304 bytes: the registry answered the manifest request with more than 4 MiB, the most the OCI distribution specification asks a registry to accept. A module’s or an image’s manifest is measured in kilobytes: check what the registry stores under that digest.cannot fetch registry token: the token response exceeds the size limit of 1048576 bytesis the same bound, 1 MiB, on the answer of the registry’s token endpoint.module.http.manifestURL and module.http.manifestDigest must be set together: an HTTP source gave one of the two. The runtime reads the manifest from the URL and verifies it against the digest, so set both or neither.module.http.manifestURL "…" must be an http or https URLandmodule.http.manifestDigest "…" is not sha256:<64 hex characters>refuse a pair that’s set and malformed.module.http.url "…" must have a normalized path (…): the operator policy requires cosign signatures by location (requireSignature), and this one cannot be read, or the same aftermust name a host and carry no user information: the operator policy has arequireSignaturerule, and the rule is matched against a location that this URL doesn’t yield. Write the URL without user information and without.,..or empty path segments.cannot load module …: module is a core module, which function-wasm 1.0.0 no longer runs (ABI v1 was removed); build it as an ABI v2 component (docs/abi-v2.md): rebuild the guest as a component. For a Go guest,guestfn buildturns the core module thatgo buildemits into one; a guest written for ABI v1 is rebuilt on a current scaffold (guestfn init, then move the function over).guestfn inspectandfunction validate --resolveprint the same sentence.built fn.wasm, but the runtime would refuse it: …fromguestfn build, or a refusal fromguestfn push: the message is the runtime’s own load-time refusal. The entries before this one cover the common ones.module.oci.ref … tags are not supported: pin the reference to the manifest digest,repo@sha256:…orrepo:tag@sha256:…, asguestfn pushprints it.module.oci.ref "…": registry "…" is not a valid registry host (a host name or an IP address with an optional port, no user information): the part of the reference before the first/isn’t a host the runtime accepts as a registry. Write it ashostorhost:port, with an IP address in full (127.0.0.1, or[::1]for IPv6). Credentials belong inmodule.oci.credentials: the runtime doesn’t read auser@prefix.guestfn pushandguestfn inspectanswercannot parse reference "…"for the same reference.module.oci.ref "…": repository "…" is not a valid repository name (lowercase path components, no . or .. or empty ones): the path after the registry isn’t an OCI repository name. Use lowercase path components separated by single slashes.Repository::"…" is not the canonical name of that repository; write Repository::"…", afteroperator policy <file>:at startup orcompositionPolicy is invalid:on a request: a rule spells a registry in a way no module location has. The runtime reads a reference’s registry into its canonical form before the policies see it, soGHCR.IO/team/fnandghcr.io:443/team/fnareghcr.io/team/fn, and a rule over another spelling wouldn’t match any module. Write the name the message gives. Docker Hub isindex.docker.ioin a rule, neverdocker.io.Repository::"…" does not name a repository: registry "…" is not a valid registry host (a host name or an IP address with an optional port, no user information): the registry part of a name in a policy isn’t a host. Write it ashostorhost:port.module layer is a tar archive without /fn.wasm: aFROM scratchimage mustCOPYthe module to/fn.wasm. Preferguestfn pushororas push, which write a rawapplication/wasmlayer.
Input and admission
function validate runs the same checks as the runtime. Run it with the flags you start the runtime with: exit 1 means a step is refused and the line states the reason, and exit 2 means the tool itself failed. The fields are in the Input reference.
module.path is refused: the runtime was started without--module-dir.module.from: … names a OCI source, but the Input has no compositionPolicy: amodule.fromsource that isn’t static needs acompositionPolicywhosepullModulepermits its repository. Add the policy or make the source static.module.from: cannot read status.module from the composite resource: module: no such field: the composite resource hasn’t set the field the step reads. Set it, or addmodule.allowEmpty: trueso the step runs nothing until it’s set. The pod logs the skipped step. See Metrics.config.greeting is not a field of config, which has from and allowEmpty only: the step writes the configuration’s value underconfig, as 0.6 took it. The value belongs in the composite resource, in a fieldconfig.fromnames (Input reference).config.from: cannot read spec.config from the composite resource: config: no such field: the composite resource hasn’t set the field the step reads its configuration from. Set it, declare it in the definition, or addconfig.allowEmpty: trueto run the module unconfigured when it’s unset.config.from: spec.config of the composite resource is not an object: the field’s value is a scalar or a list. A module’s configuration is an object, the structure its manifest’sconfig.schemadeclares.module.allowEmpty is set but module.from is not:allowEmptyapplies to a field the composite resource may leave unset and to nothing else. Remove it, or switch the step tomodule.from.apiVersion wasm.fn.crossplane.io/v1 is no longer served; write apiVersion: guestfn.crossplane.io/v1 (the same fields): the Input’s group of 0.6 and earlier, refused byfunction validateunder the step and by the runtime on every request, and warned about byguestfn build. Change theapiVersionline.module oci … is an oci@0.1 module, which function-wasm does not serve; the OCI runtime is function-oci (docs/one-pager-oci-runtime.md), or… is an OCI image with a module manifest (an oci@0.1 module), which function-wasm does not serve …for a step whose reference is a module image: the manifest’s contract isoci@0.1. This package runs WebAssembly components and nothing else. The OCI runtime is a separate package.cannot resolve module: module.type Path is not served by function-oci: an OCI module is an image pulled from a registry, so module.type must be OCI(orHTTP):function-ocipulls images from registries alone. Setmodule.type: OCIwith the module’s pinned reference. The development loop uses a local registry (the OCI runtime).limits.memory 1Gi exceeds the runtime's --module-memory-limit of 512Mi, or the same forlimits.timeoutand--module-timeout: lower the limit or raise the flag.module oci … has an invalid manifest: config.schema: Resource '…' is not present in a registry and retrieving it failed: $ref … is external; config.schema must be self-contained: the module’sconfig.schemareferences a URL or a file. The runtime never fetches a reference. The author inlines the referenced schema. A#/$defs/…reference inside the schema is fine.module oci … config does not match the module's schema: /greeting: got number, want string: the Input’sconfigfails the module’sconfig.schema.
Policy grants
The layers are explained in Cedar policy, and the operator’s side in Grant policy.
-
module oci … requires egress GET to host "x" (requires.egress.http[0]), which the operator policy (--sandbox-policy-file) does not permit: the manifest requests a capability that the layer named in the message doesn’t permit. Variants:… which the compositionPolicy does not permit: the composition layer refuses it.module … requires a private /tmp (requires.filesystem.privateTmp), but the runtime has no --sandbox-policy-file, which is required to grant sandbox capabilities, and the same for env and egress: the runtime has no policy file at all.module oci … requires credential "cmdb" (requires.credentials[0]), which the operator policy (--sandbox-policy-file) does not permit, or… but the runtime has no --sandbox-policy-file, which is required to grant step credentials (spendCredential): the layer has nospendCredentialpermit forCredential::"cmdb".
Add a
permitto the layer named, or mount a policy file. A module that requests less avoids the refusal. -
A module stops seeing a step credential it used to read: the runtime forwards no credential but those a module was granted. Declare it in the manifest, with
requires.credentials: [name]for the whole credential or arequires.envbinding for one key. Then permitspendCredentialfor it in the operator policy, and in acompositionPolicythat scopes the action.function validate --resolvelists what each step’s module receives, and the runtime logs the withheld names at debug level. See Module manifests. -
module … requires.credentials[0]: the request carries no credential "cmdb"; declare it on the pipeline step: add the credential to the step’scredentials. -
the operator policy grants a private /tmp (usePrivateTmp), but the runtime cannot create one under …at startup: pointTMPDIRat a writable directory. AnemptyDirwith asizeLimitalso bounds what a module may write. -
A guest gets
EPERMunder/tmp: the path is outside the private/tmp, the one directory the guest has. -
operator policy …: dialAddress rule "…" must scope the action as == Action::"dialAddress", or another Cedar load error: the--sandbox-policy-fileis malformed and refused at load. AdialAddresscondition accepts nothing butcontext.ip.isInRange(ip("CIDR")),context.ip.isLoopback()or a||of them. -
module oci …: composed apps/Deployment "deployment" (modify), which the compositionPolicy does not permit (composeResource), or… which the operator policy (--sandbox-policy-file) does not permit …, or… composed platform.example.org/WebApp (composite, modify), which …: the module changed a resource that nopermitof the scoped layer matches, and the runtime applied none of its output. Widen the layer named or use a module that composes less. The rules are in the Cedar policy reference. -
module oci …: composed resource "thing" states no apiVersion or kind, so the policy layers cannot judge it (composeResource): a resource the module returned indesired.resourceshas noapiVersionorkindstring. Fix the module. -
module oci …: required core/Secret "db-password" in namespace "team-b" (requirements.resources["db"]), which the compositionPolicy does not permit (requireResource), or… which the operator policy (--sandbox-policy-file) does not permit …, or… required core/Secret with labels team=a,tier=gold (…), which …: the module asked Crossplane for a resource that nopermitof the scoped layer matches. The runtime didn’t relay the ask, and Crossplane didn’t fetch. Widen the layer named or use a module that reads less. The rules are in the Cedar policy reference. -
module oci …: required resource "db" states no apiVersion or kind, so the policy layers cannot judge it (requireResource): a selector the module returned inrequirements.resourcesorrequirements.extra_resourceshas noapiVersionorkindstring. Fix the module.
Signatures
Signing, keyless verification and the trusted root are explained on the Signatures page.
cannot verify module oci …: the operator policy requires a cosign signature, but the runtime has neither --cosign-key nor --cosign-trusted-root to verify it: add--cosign-key. For keyless signatures add--cosign-trusted-rootand atrustSignerrule instead. Or narrow therequireSignaturerule.cannot resolve module: only cosign-signed oci modules are accepted (--cosign-key, --cosign-trusted-root or --cosign-trust-instance is set); http and path sources are refused: the runtime has a signing flag and doesn’t have a--sandbox-policy-file. The runtime then requires a signature of each module, which anHTTPorPathsource can’t have. Publish the module as an OCI artifact, or mount an operator policy whoserequireSignaturerules select the repositories that must be signed. With a policy the refusal readsmodule.http "…" requires a cosign signature (operator policy), but only OCI modules can be signature-verified.cannot verify module oci …: <ref> carries no cosign signature (no Sigstore bundle among its referrers): none of the manifest’s OCI 1.1 referrers is a Sigstore bundle whose subject is this digest. Sign the module with cosign 3. A module signed with cosign 2 alone or with--new-bundle-format=false(asha256-<hex>.sigtag) lands here too: the legacy format isn’t read, so re-sign it.cannot verify module oci …: no valid cosign signature for <ref>: signature does not verify with the configured keys: a bundle exists but no--cosign-keykey signed it. The same list also reportssigned statement's predicate type is "https://slsa.dev/provenance/v1", not https://sigstore.dev/cosign/sign/v1(an attestation),signed statement is for another digestand bundle fetch, size or digest failures.… keyless signature cannot be verified: the runtime has neither --cosign-trusted-root nor --cosign-trust-instance: the signature is keyless. Add--cosign-trusted-rootor--cosign-trust-instance public-good, and atrustSignerrule for the signer. The reverse,key-based signature cannot be verified: the runtime has no --cosign-key, means a key-based bundle met a runtime with a trusted root alone.… keyless signature cannot be verified: the trusted root of <instance> has not been fetched yet (the last attempt failed: …):--cosign-trust-instanceis set and every fetch has failed. The message quotes the last failure. The runtime retries every minute and admits the module once a refresh succeeds, which the log reports asTrusted root updated. For a pod without network, mount the root with--cosign-trusted-root.--cosign-trusted-root and --cosign-trust-instance are mutually exclusive: the file is the trusted root, or the instance's root is fetched over TUFat startup, or--cosign-tuf-refresh must be at least 1m0s: choose the file for an air-gapped pod and the instance for one that can fetch.… keyless signature does not verify against the trusted root: <reason>: the runtime refused the bundle, and the reason is the verification library’s own text. Typical causes are a signature made under a different Sigstore instance, an invalid signature or log promise, or a bundle with neither a Rekor entry nor an RFC 3161 timestamp. Runcosign verifywith the certificate identity and issuer against the same root to tell which.… keyless signature by <identity> (issuer <issuer>) is not trusted for <repository>: no trustSigner rule in the operator policy permits it: the signature verifies but notrustSignerrule covers that signer for the repository. Add or widen a rule for the identity and issuer.
Egress
Egress is explained on the HTTP egress page.
sandbox.egress: <host> resolves to an address the egress policy blocks: the host refuses the ranges of its default block list, which cover the loopback, private, link-local and cluster ranges, and any range adialAddressforbidadds. AdialAddresspermitin the operator policy opens a range for an in-cluster service.sandbox.egress: HTTP egress is not granted to this module: its manifest requires no egress (requires.egress.http): the module made an HTTP request but its manifest doesn’t require egress. Addrequires.egress.httpto the manifest. A Go guest sees the message prefixed withwasmfn:.sandbox.egress: the module's request rate exceeds the egress policy's rateLimit: raise--egress-rate-limit-per-minuteand--egress-rate-limit-burst, or reduce the module’s request frequency.sandbox.egress: the request body exceeds 4194304 bytes (maxRequestBytes): the module sent a request body over 4 MiB, which the host refuses before it asks the policy. Send less in one request.
function-oci modules
cannot load module …: image has neither an entrypoint nor a command: the contract runs the image's configured command (docs/one-pager-oci-runtime.md): the image specifies no command. SetENTRYPOINTorCMDin theDockerfile.cannot load module …: image runs as root (its config sets no user): the OCI runtime runs a process as a non-root user only (docs/oci/modules.md): the image’s process would run as UID 0. Either the image doesn’t set a user, or its user is UID 0 by number or through its/etc/passwd. Set a non-rootUSERin theDockerfile.cannot load module …: image is built for linux/arm64, and this runtime runs on linux/amd64: build for the node’s platform, or push a multi-platform index.cannot load module …: layer is compressed with zstd, which the OCI runtime does not unpack yet; build the image with gzip layers (the default): rebuild the image with gzip layers.cannot load module …: image exceeds the size limit of … bytes (--module-size-limit): the image’s config and layers add up to more than--module-size-limitin the registry. Raise the flag or build a smaller image.cannot load module …: cannot unpack layer 2 (sha256:…): image unpacks to more than 1073741824 bytes, eight times the size limit (--module-size-limit): the image’s layers unpack to more than eight times--module-size-limitbetween them. The runtime keeps the unpacked files in memory while it writes the root filesystem, so it stops reading at the bound. Build a smaller image, or raise--module-size-limit.cannot load module …: cannot unpack layer 2 (sha256:…): image holds more than 1000000 entries, the most the OCI runtime unpacks: the image’s layers contain more than a million files, directories and links between them. Build a smaller image.cannot load module …: cannot unpack layer 2 (sha256:…): layer entry ../etc/passwd has a .. segment, which could name a path outside the image: a layer’s entry has a..segment in its path. Thelayer links … which has a .. segmentform is the same refusal for a hard link’s target. Image builders don’t write such paths. Rebuild the image.cannot load module …: cannot unpack layer 2 (sha256:…): layer entry etc/hosts/x is under etc/hosts, which is not a directory: a layer puts an entry under a path that an earlier entry made a file. The runtime follows a symbolic link to a directory inside the image, and refuses any other parent.a symbolic link that does not resolve: more than 40 links followedin place ofwhich is not a directorymeans the parent is a symbolic link in a loop. Rebuild the image.cannot load module …: cannot unpack layer 2 (sha256:…): layer links bin/sh to bin/busybox, which is not in the image: a hard link’s target isn’t in that layer or in one below it. Rebuild the image.cannot load module …: cannot unpack layer 2 (sha256:…): layer entry .guestfn/config.json is at /.guestfn/config.json, which the OCI runtime keeps for the image config it resolved: the image has a file at the path where the runtime stores its own copy of the image config. Remove the file from the image. The runtime also refuses anything other than a directory at/.guestfn.module … requires egress (requires.egress.http), which function-oci does not serve yet: the VM has no network device (docs/one-pager-oci-runtime.md): function-oci has no egress yet. Removerequires.egressfrom the manifest.module … failed: process exited with status 1 before answering the call: <line>: the process ended before it answered, and the line is the last one it logged. An SDK server without--insecureends this way: check the manifest’soci.args.module … failed: run returned an error: <message> (gRPC status <code>): the function answered the call with an error.module … failed: run failed: the guest did not connect before the deadline: the VM booted but its init never reached the host: the runtime failed before the module ran.--debuglogs the VM’s console, which says how far the boot got. A console that ends withguestfn-init: cannot mount "squashfs" "/dev/vda" on "/lower": Invalid argument (os error 22); the root filesystem is a squashfs packed with zstd, which the guest kernel has to read (CONFIG_SQUASHFS and CONFIG_SQUASHFS_ZSTD)means the kernel--guest-kernel-pathnames was built without zstd for squashfs: every run then fails this way, at its deadline. Use the kernel the package includes, or build yours with both options.
Runtime and startup
cannot create cache directory /tmp/guestfn-cache: …at startup: the pod’s filesystem there can’t be written. Mount anemptyDirat that path through aDeploymentRuntimeConfig.cannot open /dev/kvm: No such file or directory; the OCI runtime boots a microVM per request and needs the device granted to its pod (docs/oci/install.md)atfunction-oci’s startup: the pod has no/dev/kvm. Request it from a device plugin, as the OCI runtime page documents. WithOperation not permittedin place ofNo such file or directory, the pod mounts the device as ahostPath, which doesn’t admit it; withPermission denied, the device is admitted and the pod’s user isn’t in its group: the same page has both fixes. The pod restarts until the device is there, and every request meanwhile fails with Crossplane’sno children to pick from.module … failed: waiting for a run slot: deadline exceeded, or the step-slot and run-memory forms: the request’s deadline passed while it waited for a bound, so nothing ran. Raise the bound, shorten runs, or watchguestfn_module_runs_in_flight(see Metrics).cannot load module … : compile exceeded --module-compile-timeout 5m0s: a cold load (fetch and compile) ran past the bound. The compile finishes on its own and stores its artifact, so the next request for that digest is served; a module that hits the bound every time is too large to compile under it, so raise the bound or lower--module-size-limit.- The first request is slow, later ones are fast: expected, because the compile happens once per module digest per process. A volume under
/tmp/guestfn-cachespares the next process the fetch, not the compile, which--warm-modulesmoves ahead of readiness. See the cache section of Runtime flags. Cannot warm moduleat startup: a--warm-modulesentry didn’t load, and the log line gives the entry and the reason. The pod serves anyway and loads that module on its first request.cannot snapshot the VM; booting itorcannot restore the VM's snapshot; booting itinfunction-oci’s log, under--enable-vm-snapshots: the runtime couldn’t make or restore an image’s snapshot, and the line’serrorhas the reason. The run booted its VM, so the request was served. That image runs without snapshots until the runtime loads it again. A snapshot writes a file as long as the VM’s memory under/tmp/guestfn-cachebefore the runtime rewrites it sparse, so check that the cache has that much room. At warm-up the same failure readsWarmed module, but the engine could not make its first run ready.- The readiness probe fails for a while after start: the pod is warming
--warm-modules. See Readiness. rpc error: code = Unavailable desc = the function is not readyon a composite resource: the step called a pod that hadn’t finished warm-up. Crossplane retries, and the error clears once the pod is ready. A readiness probe on/readyzkeeps such a pod out of the Service until then.