Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-5362

`puppet agent` errors out if it can't get a catalog and there's no catalog in the cache

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Duplicate
    • Affects Version/s: PUP 3.4.3, PUP 3.8.3, PUP 4.2.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:

      All platforms

    • Template:
    • Team:
      Coremunity

      Description

      When `puppet agent` is run without the `--no-usecacheonfailure` option (as is the case when running puppet resource service puppet ensure=running, and there is no catalog available in the cache, puppet will explode with:

      /root/puppet/lib/puppet/agent.rb:77:in `exit': no implicit conversion from nil to integer (TypeError)
              from /root/puppet/lib/puppet/agent.rb:77:in `block in run_in_fork'
              from /root/puppet/lib/puppet/agent.rb:74:in `fork'
              from /root/puppet/lib/puppet/agent.rb:74:in `run_in_fork'
              from /root/puppet/lib/puppet/agent.rb:41:in `block in run'
              from /root/puppet/lib/puppet/application.rb:179:in `call'
              from /root/puppet/lib/puppet/application.rb:179:in `controlled_run'
              from /root/puppet/lib/puppet/agent.rb:39:in `run'
              from /root/puppet/lib/puppet/daemon.rb:163:in `block in run_event_loop'
              from /root/puppet/lib/puppet/scheduler/job.rb:49:in `call'
              from /root/puppet/lib/puppet/scheduler/job.rb:49:in `run'
              from /root/puppet/lib/puppet/scheduler/scheduler.rb:39:in `block in run_ready'
              from /root/puppet/lib/puppet/scheduler/scheduler.rb:34:in `each'
              from /root/puppet/lib/puppet/scheduler/scheduler.rb:34:in `run_ready'
              from /root/puppet/lib/puppet/scheduler/scheduler.rb:11:in `run_loop'
              from /root/puppet/lib/puppet/daemon.rb:186:in `run_event_loop'
              from /root/puppet/lib/puppet/daemon.rb:142:in `start'
              from /root/puppet/lib/puppet/application/agent.rb:369:in `main'
              from /root/puppet/lib/puppet/application/agent.rb:330:in `run_command'
              from /root/puppet/lib/puppet/application.rb:344:in `block in run'
              from /root/puppet/lib/puppet/util.rb:446:in `exit_on_fail'
              from /root/puppet/lib/puppet/application.rb:344:in `run'
              from /root/puppet/lib/puppet/util/command_line.rb:128:in `run'
              from /root/puppet/lib/puppet/util/command_line.rb:72:in `execute'
              from /root/puppet/bin/puppet:5:in `<top (required)>'
              from /usr/local/share/gems/bin/puppet:23:in `load'
              from /usr/local/share/gems/bin/puppet:23:in `<main>'
      

      This is only one set of circumstances that can cause this to happen. If anything in the process of getting a catalog raises an error and returns nil at any point, the same thing will happen.

      This was introduced by https://github.com/puppetlabs/puppet/commit/fa4a1d9, a commit merged over 3 years ago.

      As a consequence of this, if puppet resource service puppet ensure=running is used and this happens, the service cannot be stopped using normal means, other than killing the process.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              whopper William Hopper
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support