{"record":{"id":"bfa0961d2f0d983c","repo":"basecamp/kamal","slug":"missing-required-option-account","errorCode":null,"errorMessage":"Missing required option '--account'","messagePattern":"Missing required option '--account'","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"lib/kamal/secrets/adapters/base.rb","lineNumber":5,"sourceCode":"class Kamal::Secrets::Adapters::Base\n  delegate :optionize, to: Kamal::Utils\n\n  def fetch(secrets, account: nil, from: nil)\n    raise RuntimeError, \"Missing required option '--account'\" if requires_account? && account.blank?\n\n    check_dependencies!\n\n    session = login(account)\n    fetch_secrets(secrets, from: from, account: account, session: session)\n  end\n\n  def requires_account?\n    true\n  end\n\n  private\n    def login(...)\n      raise NotImplementedError\n    end\n\n    def fetch_secrets(...)\n      raise NotImplementedError","sourceCodeStart":1,"sourceCodeEnd":23,"githubUrl":"https://github.com/basecamp/kamal/blob/eee0083b38661c3707c6b6052cc89e85038a096c/lib/kamal/secrets/adapters/base.rb#L1-L23","documentation":"Adapters inheriting Kamal::Secrets::Adapters::Base default to requires_account? true (one_password, last_pass, bitwarden, etc.); Base#fetch raises RuntimeError when account is blank for those. Via the kamal CLI you normally hit the friendlier early return \"No value provided for required options '--account'\" (cli/secrets.rb:10) — this RuntimeError surfaces when calling the adapter programmatically or through other entry points that skip the CLI check.","triggerScenarios":"Calling Kamal::Secrets::Adapters.lookup(\"one_password\").fetch([\"KEY\"]) with no account: kwarg; kamal secrets fetch -a one_password with no --account on a version/path that bypasses the CLI pre-check; passing --account \"\" (blank string).","commonSituations":"Scripts or rake tasks invoking the adapter API directly; forgetting --account for 1Password/LastPass/Bitwarden while gcp/doppler/bitwarden-sm need none; confusion over which adapters need an account.","solutions":["Pass the account identifier: kamal secrets fetch -a one_password --account me@example.com KEY, or account: \"me@example.com\" in the Ruby API","For programmatic use, check adapter.requires_account? before calling fetch and supply account: accordingly","Switch to an adapter that does not need an account (bitwarden-sm, gcp_secret_manager, doppler) if that fits your vault"],"exampleFix":"# before\nKamal::Secrets::Adapters.lookup(\"one_password\").fetch([\"RAILS_MASTER_KEY\"])\n# => RuntimeError: Missing required option '--account'\n\n# after\nadapter = Kamal::Secrets::Adapters.lookup(\"one_password\")\nadapter.fetch([\"RAILS_MASTER_KEY\"], account: \"me@example.com\")","handlingStrategy":"type-guard","validationCode":"adapter = Kamal::Secrets::Adapters.lookup(\"one_password\")\nraise ArgumentError, \"this adapter needs an account\" if adapter.requires_account? && account.to_s.blank?","typeGuard":"def fetch_with_account!(adapter, names, account: nil)\n  raise ArgumentError, \"#{adapter.class} requires an account\" if adapter.requires_account? && account.blank?\n  adapter.fetch(names, account: account)\nend","tryCatchPattern":"begin\n  adapter.fetch(names, account: account)\nrescue RuntimeError => e\n  retry if e.message.include?(\"Missing required option '--account'\") && (account = prompt_for_account)\n  raise\nend","preventionTips":["Always check adapter.requires_account? in code that drives adapters generically","Note which adapters need --account (one_password, last_pass, bitwarden) and which don't (bitwarden-sm, gcp, doppler)"],"tags":["kamal","secrets","cli","adapter","missing-argument"],"backgroundTag":"missing-required-option","analyzedSha":"eee0083b38661c3707c6b6052cc89e85038a096c","analyzedAt":"2026-08-21T15:17:22.045Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}