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

Puppet exec timeout does not match documentation



    • Bug
    • Status: Accepted
    • Normal
    • Resolution: Unresolved
    • PUP 5.5.14, PUP 6.6.0
    • None
    • None
    • Needs Assessment


      *Puppet Version: 5.5.14-1xenial
      *Puppet Server Version: 5.3.8-1xenial
      *OS Name/Version: Ubuntu 16.04 Xenial

      Describe your issue in as much detail as possible…

      When using tries in an exec resource the documentation states that the timeout parameter of the exec block applies to each try, but the code currently does not implement the functionality in that way. The timeout should apply to each try.

      Slack community chat snippet

      natemccurdy [11 minutes ago]
      The timeout is for the entire exec, not for each try. (edited)

      Jason Grammenos [10 minutes ago]
      `Note that the timeout parameter applies to each try rather than to the complete set of tries.`

      natemccurdy [10 minutes ago]
      err.. sorry, You’re right.

      natemccurdy [10 minutes ago]
      Read that wrong.

      josh [9 minutes ago]
      The docs are wrong unfortunately

      Jason Grammenos [9 minutes ago]

      natemccurdy [9 minutes ago]
      Oh, hah :slightly_smiling_face:

      josh [8 minutes ago]
      maybe it used to apply to each try at some point?

      natemccurdy [8 minutes ago]
      Either way, try removing the `timeout` or set it to `0` and see what happens.

      josh [6 minutes ago]
      Looks like it's been broken since https://github.com/puppetlabs/puppet/commit/e0e6b642c4e

      josh [5 minutes ago]
      The begin/rescue needs to be inside `tries.times do |try|`

      Desired Behavior:

      exec { 'test':
        command   => '/bin/false',
        tries     => 10,
        try_sleep => 5,
        timeout   => 10,

      This should have a per try timeout of 10 seconds as per the documentation.

      Actual Behavior:

      The exec time's out because the current implementation applies the timeout to the whole set of tries.

      current documentation:

      Please take a moment and attach any relevant log output and/or manifests. This will help us immensely when troubleshooting the issue.

       Exec try 1/10 /etc/puppetlabs/code/modules/mm/manifests/graylog/graylog.pp:83
       Jul 15 2019 - 14:10:34 Exec[configure-ldap](provider=posix) Executing 'curl -s -v -i --netrc-file /etc/graylog/server/configure_ldap.netrc -o /etc/graylog/server/configure_ldap.log -H "Content-Type: application/json" -H "X-Requested-By: puppet" -X PUT [http://localhost:9000/api/system/ldap/settings] --data @/etc/graylog/server/configure_ldap_data.json 2>&1 | grep 'HTTP/1.1 204''
      Jul 15 2019 - 14:10:34 Puppet debug Executing: 'curl -s -v -i --netrc-file /etc/graylog/server/configure_ldap.netrc -o /etc/graylog/server/configure_ldap.log -H "Content-Type: application/json" -H "X-Requested-By: puppet" -X PUT [http://localhost:9000/api/system/ldap/settings] --data @/etc/graylog/server/configure_ldap_data.json 2>&1 | grep 'HTTP/1.1 204'' 
       Jul 15 2019 - 14:10:44 Puppet err Command exceeded timeout




            Unassigned Unassigned
            jason.grammenos.agilitypr Jason Grammenos
            0 Vote for this issue
            4 Start watching this issue



              Zendesk Support