ErrLookup › Background articles › "Must pass :limit option" / "Missing required option" — required option errors explained
"Must pass :limit option" / "Missing required option" — required option errors explained
Errors like "Must pass :limit option", "Missing required option '--account'", "Option \"implements\" is required" all come from the same guard: a library checks its options object or command-line flags up front and refuses to run when a mandatory one is absent, nil, or misspelled. This article explains where these fail-fast checks live, why they fire before any real work happens, and how to fix the option your call is actually missing.
Distilled from 106 documented records across 41 repositories.
Background
This family lives at configuration boundaries. Before a library does any real work — rendering a grid, starting a throttle counter, constructing a MapFile writer, building an OAuth URL — it validates that the options it was handed contain everything it cannot guess. The check is usually one line: Ruby's 'options[:limit] or raise ArgumentError', Rust's expect() on an Option field, a JavaScript throw when a required key is undefined. Because it fires at construction, initialization, or first call, you meet it at boot time, in an initializer, or on the very first request — not deep inside a failing operation.
The reason these checks exist is that the missing option has no sensible default. Rack::Attack's Fail2Ban needs bantime, findtime, and maxretry because a ban without a duration or a counting window is meaningless; Grape's coerce_with needs a type because knowing HOW to convert a parameter is useless without knowing WHAT it becomes; Hadoop's MapFile.Writer needs exactly one of keyClass or comparator because giving neither leaves the sort order undefined. Rather than silently misbehave — never banning, coercing wrongly, sorting unpredictably — the library fails closed with a message that names the missing piece.
From the caller's side, the error usually points at an honest omission or a config plumbing failure. Options built from environment variables are the biggest offender across these records: ENV['MAXRETRY'] unset yields nil, and the truthiness-based checks (common in Ruby) treat nil and false exactly like a missing key. Misspelled keys are the second pattern — the API wants :findtime and you wrote :find_time, or entryTypes with a lowercase t, and the validation sees nothing at all. A third pattern is programmatic use: the error surfaces in code paths the library's own CLI or interactive prompt normally shields (kamal's CLI pre-checks --account before the adapter raises, Angular's CLI prompts for --implements before the schematic throws).
The details vary by library in ways worth knowing. Some checks are exact-count rules, not just presence rules: Hadoop's MapFile.Writer requires exactly one of two options — passing both raises too. Some checks are order- or context-sensitive: kamal's Doppler adapter only needs --from=project/config when no DOPPLER_TOKEN is set, and inspects only the first secret. Some messages interpolate what's missing (rack-attack's "Must pass #{opt.inspect} option" tells you the exact symbol; puppet's trollop names the flag), while others are fixed strings that force you to read the surrounding documentation to know which option was at fault.
Common causes
- Option simply omitted. The most common case: the call or command line leaves out a mandatory key entirely, such as Rack::Attack.throttle without a limit, or kamal secrets fetch without --account. Libraries refuse to guess because the option has no defensible default.
- Nil or false from environment/config plumbing. ENV-backed values like Integer(ENV['MAXRETRY']) or process.env.TEMPLATE evaluate to nil/undefined when unset, and truthiness-based checks treat that exactly like a missing key. Explicitly nil or empty-string values raise the same way.
- Misspelled or wrong-cased option key. The validation sees nothing because the key doesn't match: find_time instead of :findtime, entryTypes with wrong casing, expectedTools instead of expectedTool. The error message names the option the library expected, which is the fastest way to spot the typo.
- Programmatic use bypassing CLI validation. Many libraries pre-check options in their CLI or interactive prompt, so the raw validator only fires when calling the API directly — invoking a schematic without the CLI schema, calling an adapter's fetch programmatically, building a renderer with default-constructed options.
- Paired or exactly-one options broken. Some options must travel together or be mutually exclusive: Grape requires type: alongside coerce_with:, RubyGems requires engine_version: with engine:, and Hadoop's MapFile.Writer raises both when neither and when both of keyClass/comparator are given.
- Conditional refactors leaving options inconsistent. Refactoring that moves an option into an if-branch while its companion stays unconditional — a budget controller passed without a budget, a helper that creates options only sometimes — produces calls where one half of a required pair is missing.
- Automated environments with incomplete arguments. Cron jobs, systemd units, and CI pipelines invoke commands with partial flags — a puppet subcommand missing its required option, a GitHub Actions step that forgets to forward GITHUB_REPOSITORY as --repo. The failure appears only in that environment.
What usually fixes it
- [object Object]
- [object Object]
- [object Object]
- [object Object]
- [object Object]
Documented occurrences
- Details table options not given! (ogham/exa)
- Must pass #{opt.inspect} option (rack/rack-attack)
- cave_tool_sandbox_entry_required: cave_tool_sandbox_entry_required: sandboxed tools need entryPath (JuliusBrussee/caveman)
- Missing project or config from '--from=project/config' option (basecamp/kamal)
- FLUX 3 video requires an explicit duration when ${UNTIMED_KEYFRAMES_NEEDING_DURATION} or more keyframes are sent without a timestamp. (vercel/ai)
- Missing --repo <owner/repo>. (affaan-m/ECC)
- key class or comparator option must be set (apache/hadoop)
- Missing required option '--account' (basecamp/kamal)
- cave_budget_controller_without_budget: cave_budget_controller_without_budget (JuliusBrussee/caveman)
- Option "implements" is required. (angular/angular-cli)
- A context is required to translate attributes (activerecord-hackery/ransack)
- must supply type for coerce_with (ruby-grape/grape)
- Failed to execute 'observe' on 'PerformanceObserver': Either 'entryTypes' or 'type' must be specified. (denoland/deno)
- option --%{opt} must be specified (puppetlabs/puppet)
- Deno.autoUpdate: missing 'url' option, skipping (denoland/deno)
- Redirect URI is required for SSO login (mastra-ai/mastra)
- ERR_TRACE_EVENTS_CATEGORY_REQUIRED: At least one category is required (denoland/deno)
- No template selected (mastra-ai/mastra)
- Either expectedTool or expectedToolOrder must be provided (mastra-ai/mastra)
- Semantic recall requires an embedder to be configured. https://mastra.ai/en/docs/memory/semantic-recall (mastra-ai/mastra)
…and 86 more across the corpus — use search.
Honest provenance: generated on 2026-08-30 from AI-assisted analysis of the linked records. See how records are made.