ErrLookupBackground articles › "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them

"missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them

"missing required argument", "the following required arguments were not provided", and "<argument> is required" are the messages libraries emit when a call or command arrives without a value the library cannot proceed without: a selector role in k6 browser tests, a database name in SpacetimeDB CLI commands, a model name in litellm, a rule slot in a tree-sitter grammar. This article covers the whole family (106 documented records across 20 repositories): which validation layers produce these errors, why strictness differs between libraries, and the fixes that hold everywhere.

Distilled from 106 documented records across 20 repositories.

Background

These errors come from validation at the boundary between caller and library, and they fire before any real work starts. The layer varies by library. CLI argument parsers such as clap print a usage block naming the missing positional (SpacetimeDB's <database>, mise's --url). JavaScript API bridges run nullish guards before building selectors or requests: k6's browser module checks the first argument of every getByRole, getByPlaceholder, getByAltText, and getByTestId call with an IsNullish test, because no CDP query can be constructed without it. Internal kwarg validators guard plumbing parameters (litellm's completion-to-responses bridge requires 'model' as a string and 'optional_params' as a dict). Planner and resolver functions require a seed to expand from (ECC's install planners refuse to run with no profile, module, or component selection). Kernel plugin APIs check argument count or type up front (siyuan's client.fetch, storage.put, and storage.watcher.add).

The checks exist to fail fast: each call site has downstream work that is impossible without the value. There is no ARIA selector without a role, no dependency plan without a selection, no tool stub without an artifact URL, no hardened git command without a subcommand position to splice flags into. litellm's bridge deliberately stops a modelless request before it reaches a provider; mise's generator refuses to emit an empty stub.

From the caller's side, the trigger is usually one of two things: the argument was omitted outright, or a variable that was supposed to carry it evaluated to undefined (an unset env var, a data-fixture row missing the field, an absent config key, a lookup that returned nothing). The message vocabulary differs by library: k6 names the argument ("missing required argument 'role'"), clap prints the missing positional plus a usage line, ECC describes which selections would have counted, and some messages are actively misleading. yazi reports "Unknown copy type" or even a message about Cargo build limitations when an action's argument map lookup fails, and tree-sitter's "Undefined symbol" means a rule slot was literally undefined, which is distinct from the ReferenceError the $ proxy throws for a misspelled rule name.

How strict the check is turns out to be library-specific. k6's guards reject only null and undefined; an empty string passes and silently builds a locator that matches nothing. siyuan's storage.put is count-only: once two arguments exist, non-string values are coerced with String() rather than rejected, so only a genuinely missing argument errors. ECC normalizes ids and rejects whitespace-only values, and its locale option counts as a selection because it is injected as an included component. Some sites require a type (siyuan's client.fetch path must be a JS string), others mere presence. polars uses a NO_DEFAULT sentinel to distinguish "not given" from "passed as None", which is why its case surfaces as a TypeError about a keyword-only argument. yazi adds a consumption dimension: take() removes the entry from the action's args map, so a second consumer reading the same name or index fails exactly like a missing argument.

Common causes

What usually fixes it

Documented occurrences

…and 86 more across the corpus — use search.

Honest provenance: generated on 2026-08-20 from AI-assisted analysis of the linked records. See how records are made.