Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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 against wit/guestfn-function.wit: it has no run export (no export run found) or imports something the runtime doesn’t provide. Rebuild against the current wit/, and use guestfn inspect fn.wasm to 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 in module.http.url. See HTTP redirects. A manifest’s download says cannot download manifest: …, for module.http.manifestURL. … is not followed: not an http or https URL is a redirect to another scheme, and more than 10 redirects a 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 bytes is 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 URL and module.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 after must name a host and carry no user information: the operator policy has a requireSignature rule, 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 build turns the core module that go build emits into one; a guest written for ABI v1 is rebuilt on a current scaffold (guestfn init, then move the function over). guestfn inspect and function validate --resolve print the same sentence.
  • built fn.wasm, but the runtime would refuse it: … from guestfn build, or a refusal from guestfn 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:… or repo:tag@sha256:…, as guestfn push prints 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 as host or host:port, with an IP address in full (127.0.0.1, or [::1] for IPv6). Credentials belong in module.oci.credentials: the runtime doesn’t read a user@ prefix. guestfn push and guestfn inspect answer cannot 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::"…", after operator policy <file>: at startup or compositionPolicy 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, so GHCR.IO/team/fn and ghcr.io:443/team/fn are ghcr.io/team/fn, and a rule over another spelling wouldn’t match any module. Write the name the message gives. Docker Hub is index.docker.io in a rule, never docker.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 as host or host:port.
  • module layer is a tar archive without /fn.wasm: a FROM scratch image must COPY the module to /fn.wasm. Prefer guestfn push or oras push, which write a raw application/wasm layer.

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: a module.from source that isn’t static needs a compositionPolicy whose pullModule permits 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 add module.allowEmpty: true so 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 under config, as 0.6 took it. The value belongs in the composite resource, in a field config.from names (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 add config.allowEmpty: true to 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’s config.schema declares.
  • module.allowEmpty is set but module.from is not: allowEmpty applies to a field the composite resource may leave unset and to nothing else. Remove it, or switch the step to module.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 by function validate under the step and by the runtime on every request, and warned about by guestfn build. Change the apiVersion line.
  • 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 is oci@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 (or HTTP): function-oci pulls images from registries alone. Set module.type: OCI with 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 for limits.timeout and --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’s config.schema references 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’s config fails the module’s config.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 no spendCredential permit for Credential::"cmdb".

    Add a permit to 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 a requires.env binding for one key. Then permit spendCredential for it in the operator policy, and in a compositionPolicy that scopes the action. function validate --resolve lists 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’s credentials.

  • the operator policy grants a private /tmp (usePrivateTmp), but the runtime cannot create one under … at startup: point TMPDIR at a writable directory. An emptyDir with a sizeLimit also bounds what a module may write.

  • A guest gets EPERM under /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-file is malformed and refused at load. A dialAddress condition accepts nothing but context.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 no permit of 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 in desired.resources has no apiVersion or kind string. 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 no permit of 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 in requirements.resources or requirements.extra_resources has no apiVersion or kind string. 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-root and a trustSigner rule instead. Or narrow the requireSignature rule.
  • 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 an HTTP or Path source can’t have. Publish the module as an OCI artifact, or mount an operator policy whose requireSignature rules select the repositories that must be signed. With a policy the refusal reads module.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 (a sha256-<hex>.sig tag) 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-key key signed it. The same list also reports signed statement's predicate type is "https://slsa.dev/provenance/v1", not https://sigstore.dev/cosign/sign/v1 (an attestation), signed statement is for another digest and 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-root or --cosign-trust-instance public-good, and a trustSigner rule 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-instance is 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 as Trusted 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 TUF at 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. Run cosign verify with 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 no trustSigner rule 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 a dialAddress forbid adds. A dialAddress permit in 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. Add requires.egress.http to the manifest. A Go guest sees the message prefixed with wasmfn: .
  • sandbox.egress: the module's request rate exceeds the egress policy's rateLimit: raise --egress-rate-limit-per-minute and --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. Set ENTRYPOINT or CMD in the Dockerfile.
  • 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-root USER in the Dockerfile.
  • 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-limit in 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-limit between 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. The layer links … which has a .. segment form 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 followed in place of which is not a directory means 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. Remove requires.egress from 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 --insecure ends this way: check the manifest’s oci.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. --debug logs the VM’s console, which says how far the boot got. A console that ends with guestfn-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-path names 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 an emptyDir at that path through a DeploymentRuntimeConfig.
  • 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) at function-oci’s startup: the pod has no /dev/kvm. Request it from a device plugin, as the OCI runtime page documents. With Operation not permitted in place of No such file or directory, the pod mounts the device as a hostPath, which doesn’t admit it; with Permission 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’s no 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 watch guestfn_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-cache spares the next process the fetch, not the compile, which --warm-modules moves ahead of readiness. See the cache section of Runtime flags.
  • Cannot warm module at startup: a --warm-modules entry 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 it or cannot restore the VM's snapshot; booting it in function-oci’s log, under --enable-vm-snapshots: the runtime couldn’t make or restore an image’s snapshot, and the line’s error has 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-cache before the runtime rewrites it sparse, so check that the cache has that much room. At warm-up the same failure reads Warmed 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 ready on 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 /readyz keeps such a pod out of the Service until then.