{"record":{"id":"6193c3c3338a9937","repo":"puppetlabs/puppet","slug":"an-action-must-be-specified","errorCode":null,"errorMessage":"An action must be specified.","messagePattern":"An action must be specified\\.","errorType":"validation","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/application/ssl.rb","lineNumber":112,"sourceCode":"  option('--debug', '-d')\n\n  def initialize(command_line = Puppet::Util::CommandLine.new)\n    super(command_line)\n\n    @cert_provider = Puppet::X509::CertProvider.new\n    @ssl_provider = Puppet::SSL::SSLProvider.new\n    @machine = Puppet::SSL::StateMachine.new\n    @session = Puppet.runtime[:http].create_session\n  end\n\n  def setup_logs\n    set_log_level(options)\n    Puppet::Util::Log.newdestination(:console)\n  end\n\n  def main\n    if command_line.args.empty?\n      raise Puppet::Error, _(\"An action must be specified.\")\n    end\n\n    if options[:target]\n      # Override the following, as per lib/puppet/application/device.rb\n      Puppet[:certname] = options[:target]\n      Puppet[:confdir]  = File.join(Puppet[:devicedir], Puppet[:certname])\n      Puppet[:vardir]   = File.join(Puppet[:devicedir], Puppet[:certname])\n      Puppet.settings.use(:main, :agent, :device)\n    else\n      Puppet.settings.use(:main, :agent)\n    end\n\n    Puppet::SSL::Oids.register_puppet_oids\n    Puppet::SSL::Oids.load_custom_oid_file(Puppet[:trusted_oid_mapping_file])\n\n    certname = Puppet[:certname]\n    action = command_line.args.first\n    case action","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/application/ssl.rb#L94-L130","documentation":"Puppet::Application::Ssl#main raises Puppet::Error when 'puppet ssl' is invoked with no action: the command is subcommand-driven (submit_request, download_cert, generate_request, verify, clean — dispatched in the case statement immediately after this check).","triggerScenarios":"Running plain 'puppet ssl'; a wrapper dropping the action word during quoting/expansion, e.g. an empty shell variable where the action should be.","commonSituations":"Users expecting 'puppet ssl' alone to do everything (the usual intent is 'puppet ssl bootstrap'); scripts building the command dynamically with an empty action variable.","solutions":["Run the intended action — for first-time setup: puppet ssl bootstrap; otherwise submit_request, download_cert, generate_request, verify, or clean","Check puppet ssl --help for the action list","Audit wrapper scripts so the action word is not an empty/unset shell variable"],"exampleFix":"# before\npuppet ssl\n\n# after\npuppet ssl bootstrap","handlingStrategy":"validation","validationCode":"action = ENV['SSL_ACTION'] or abort 'set SSL_ACTION (bootstrap|submit_request|download_cert|generate_request|verify|clean)'\nsystem('puppet', 'ssl', action)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always name the subcommand — 'puppet ssl bootstrap' for first-time setup","Fail loudly in wrappers when the action variable is empty instead of passing it through","Keep a cheat sheet of the five actions near provisioning scripts"],"tags":["cli","ssl","arguments","puppet"],"backgroundTag":"missing-required-arguments","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}