ErrLookup › Background articles › Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them
Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them
Missing required parameter errors — 'model is required', 'The required X param is missing', 'Please provide userId or username', Yii's 'Missing required parameter $name when calling...' — fire when a call reaches the receiver without a value that can neither be defaulted, inferred, nor worked around. The family spans 191 documented records across 27 repositories: HTTP 400s from REST endpoints (Rocket.Chat, Nextcloud OCM federation, the LiteLLM proxy), ValueErrors raised client-side before any network traffic (LiteLLM provider handlers), CLI refusals (buzz-admin), DI container exceptions (Yii), and guard clauses in Rust services (CodeWhale, caveman). Developers meet it most often when serialization silently drops undefined or empty values, when a config-driven deployment leaves a required field unset, or when an internal handler is invoked directly instead of through the public wrapper that normally supplies the parameter.
Distilled from 191 documented records across 27 repositories.
Background
Every record in this family is a fail-fast guard on the receiving side: a handler, schema validator, config layer, or dependency-injection resolver refuses to proceed because it cannot do its work without the value. The receiver needs something concrete to act on — a roomId to look up (Rocket.Chat chat.syncMessages), a model id to route a provider request (LiteLLM bedrock and black_forest_labs image routes), a stable signing key to republish a channel snapshot (buzz-admin --channel), an expected role to audit a database identity against (caveman ValidateRuntimeIdentity) — and the check runs before side effects: Chroma's transactional delete rejects a None ids list before the server is called, LiteLLM's Pydantic AI handler raises before any HTTP traffic happens, and CodeWhale's memory store refuses a Workspace scope with no workspace id before any file is opened or the write lock is taken.
From the caller's side the error names the missing value, but vocabulary and strictness vary by library. Rocket.Chat handlers apply truthiness checks ('The required mid body param is missing', 'Please provide userId or username or userIds or usernames as param') and often run behind schemas with no minLength, so an empty string can pass validation and die only at the handler. LiteLLM's speech-to-completion bridge type-checks each kwarg ('model is required', 'headers is required', 'logging_obj is required') and rejects wrong types, not just absent keys — a unittest Mock fails the isinstance check for logging_obj. Yii's container reports exactly which parameter of which function was unresolvable, and only for scalars: class-typed parameters are autowired, scalar ones never are. The transport varies too — a Meteor.Error with no error code, a ValueError converted into a 400 ProxyException with a cosmetic 'Authentication Error' prefix, a BadRequestException on a federated OCM notification, or a Rust ErrorKind::InvalidInput.
Recurring quirks cut across libraries. Serialization loses values silently: JSON.stringify drops undefined keys, so a params object built from optional variables can lose roomId and roomName on both branches and ship as if never set. OR-contracts (roomId or roomName; user_id or user_email; type or lastUpdate; --relay-key or BUZZ_RELAY_PRIVATE_KEY) fail only when every alternative is absent — and some are asymmetric: Rocket.Chat's room resolver treats two empty strings as this error, but a lone empty roomId falls through to a lookup of '' and surfaces as error-room-not-found instead. None-versus-empty distinctions matter: LiteLLM's MCP tool-call entry accepts arguments={} yet rejects arguments=None, and its dall-e-2 model default applies only when both model and custom_llm_provider are absent, so a provider set without a model still reaches the guard. Parameter location matters: emoji-custom.update reads _id only from multipart form data and never sees it in a query string or JSON body.
A distinct sub-family sits at abstraction boundaries. LiteLLM's bridge kwargs (model, custom_llm_provider, headers, logging_obj), the Vertex video-edit transform's prefetched_source_data, and the api_base for Pydantic AI handlers are all supplied by public entry points such as litellm.speech() and litellm.video_edit(), which also perform prerequisite steps like prefetching the source operation. When those errors fire, the cause is usually not a forgotten payload field but a bypassed wrapper — direct handler calls, forked or refactored code paths, or tests with hand-built kwargs. Which check fires first is library- and version-specific: the records show both modern builds where schema validation rejects the omission up front and older builds where only the handler-level throw remains as defense-in-depth.
Common causes
- Value dropped or emptied during serialization. JSON.stringify strips undefined keys, so a param built from an optional variable ships as if never sent; empty strings and whitespace-only values survive serialization but fail the receiver's truthiness or trim check (Rocket.Chat rid, emoji, roomId).
- Dynamically built request with no identifier selected. Clients that assemble payloads from UI or optional state send requests before a required choice exists: an analytics call with no chart name, a bulk user operation with an empty selected-users list, a /user/update body with neither user_id nor user_email.
- Deployment or config missing a required field. Config-driven calls leave required values unset: a pydantic_ai deployment without api_base in litellm_params, a bedrock or black_forest_labs Router entry with an empty model field, an embedding engine never configured so LLMConnector resolves to null.
- Calling an internal handler directly. Bridge kwargs (model, headers, logging_obj, custom_llm_provider), the Vertex video-edit transform's prefetched_source_data, and internal speech handlers are populated by their public wrappers; direct calls or tests with hand-built kwargs omit them.
- Wrong parameter name, casing, or location. Unknown keys are silently ignored rather than rejected (user_id, userName typos), api_base must not be base_url, _id must be a multipart form field rather than a query or JSON value, and httpx.Headers must be converted to a plain dict.
- Explicit None where an empty value is expected. LiteLLM's MCP tool-call entry rejects arguments=None but accepts {}; a None forwarded from a failed upstream step (custom_llm_provider=None, image=None, api_base=None) reaches guards that an empty default would have avoided.
- None of several alternative parameters provided. OR-contracts fail only when all alternatives are absent: roomId or roomName, user_id or user_email, type or lastUpdate, --relay-key or BUZZ_RELAY_PRIVATE_KEY — typically during an escalation or refactor that removed the usual source of one alternative.
- Empty string passes schema, fails the runtime guard. Schemas without minLength let emoji='' or rid=' ' through validation; only the handler's truthiness or trim check catches them, so the error's exact message and first-firing check depend on the server build.
What usually fixes it
- Read the error as a contract statement: the message names the exact parameter, so before changing code confirm from the endpoint or schema what alternatives exist (roomId or roomName), the exact spelling and casing, and where the value must live — query string, JSON body, multipart form field, env var, or config key.
- Fix the value at its source: when the empty value comes from config or plumbing, repair it there — add api_base to the deployment's litellm_params, export BUZZ_RELAY_PRIVATE_KEY in admin shells, configure a working embedding engine, set the env var feeding expectedRole — instead of patching one call site.
- Validate and build payloads defensively on the client: require at least one accepted identifier before issuing the call, disable submit actions until required state exists, build payloads from stored objects so identifiers are always present, and trim strings so blank values never reach the wire.
- Prefer the public entry point over internal handlers: litellm.speech(), litellm.video_edit(), and the built-in chat pipeline assemble required kwargs and run prerequisite steps such as prefetching; if you must call an internal handler, replicate its full documented input shape (for example the bridge TypedDict) rather than a partial kwargs dict.
- Normalize types at the boundary: pass {} instead of None where the API distinguishes them, convert httpx.Headers to dict(headers), filter None entries out of image lists, and pass concrete non-empty collections (an explicit id list) instead of None-equivalents.
- Fail fast with your own checks: assert required keys in wrappers with your own message, lint configs at deploy or startup so required fields are non-empty, and unit-test payload builders for the missing-value case so the library's guard is never the first line of defense.
Go deeper
- HTTP status errors: handling 4xx and 5xx responses — how to handle 4xx and 5xx responses properly.
Documented occurrences
- --channel requires --relay-key or BUZZ_RELAY_PRIVATE_KEY (block/buzz)
- invalid-chart-name (RocketChat/Rocket.Chat)
- error-param-required: The "type" or "lastUpdate" parameters must be provided (RocketChat/Rocket.Chat)
- RESOURCE_NOT_FOUND: Parameters missing in order to complete the request. Missing Parameters: sharedSecret (nextcloud/server)
- error-room-param-not-provided: The parameter "roomId" or "roomName" is required (RocketChat/Rocket.Chat)
- model is required (BerriAI/litellm)
- api_base is required for PydanticAIProviderConfig (BerriAI/litellm)
- Missing required parameter "$name" when calling "$funcName". (yiisoft/yii2)
- The required "mid" body param is missing. (RocketChat/Rocket.Chat)
- workspace scope requires a workspace id (Hmbown/CodeWhale)
- HTTP ${res.status} (Hmbown/CodeWhale)
- postgres: expected runtime role is required (JuliusBrussee/caveman)
- Model needs to be set for bedrock (BerriAI/litellm)
- error-emoji-param-not-provided: The required "emoji" param is missing. (RocketChat/Rocket.Chat)
- error-users-params-not-provided: Please provide "userId" or "username" or "userIds" or "usernames" as param (RocketChat/Rocket.Chat)
- error-param-required: The required "roomId" query param is missing (RocketChat/Rocket.Chat)
- Either user_id or user_email must be provided (BerriAI/litellm)
- custom_llm_provider is required (BerriAI/litellm)
- Request arguments are required (BerriAI/litellm)
- res.statusText || "Error fetching api keys." (Mintplex-Labs/anything-llm)
…and 171 more across the corpus — use search.
Honest provenance: generated on 2026-08-19 from AI-assisted analysis of the linked records. See how records are made.