puppetlabs/puppet · error

Exiting now because the waitforcert setting is set to 0.

Error message

Exiting now because the waitforcert setting is set to 0.

What it means

Emitted by the Wait SSL state's next_state when waitforcert is less than 1: the agent is configured not to wait for certificate signing, so instead of retrying it logs this error and exits with status 1. It is a deliberate configuration-driven termination, not a failure inside TLS itself.

Solutions

  1. Set waitforcert to a positive number of seconds so the agent waits for the CA to sign its certificate
  2. Sign the agent's certificate on the CA (puppet cert sign <name>) before running the agent
  3. Use --waitforcert on the command line for a one-off wait
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at lib/puppet/ssl/state_machine.rb:409 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21). Data as JSON: /api/errors/bfaea86780ca588b. Report an issue: GitHub.

Appendix: source

Thrown at lib/puppet/ssl/state_machine.rb:409

      end
      Done.new(@machine, @ssl_context)
    rescue => e
      Puppet.warning(_("Unable to automatically renew certificate: %{message}") % { message: e.message })
      Done.new(@machine, @ssl_context)
    end
  end

  # We cannot make progress, so wait if allowed to do so, or exit.
  #
  class Wait < SSLState
    def initialize(machine)
      super(machine, nil)
    end

    def next_state
      time = @machine.waitforcert
      if time < 1
        log_error(_("Exiting now because the waitforcert setting is set to 0."))
        exit(1)
      elsif Time.now.to_i > @machine.wait_deadline
        log_error(_("Couldn't fetch certificate from CA server; you might still need to sign this agent's certificate (%{name}). Exiting now because the maxwaitforcert timeout has been exceeded.") % { name: Puppet[:certname] })
        exit(1)
      else
        Puppet.info(_("Will try again in %{time} seconds.") % { time: time })

        # close http/tls and session state before sleeping
        Puppet.runtime[:http].close
        @machine.session = Puppet.runtime[:http].create_session

        @machine.unlock
        Kernel.sleep(time)
        NeedLock.new(@machine)
      end
    end
  end

View on GitHub (pinned to e227c27540)