Uploaded image for project: 'Facter'
  1. Facter
  2. FACT-3082

Regression: Runs with Puppet 6.25.0 take +2 minutes on non-EC2 VMs



    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • FACT 3.14.20
    • FACT 3.14.21
    • Facter 3
    • Night's Watch
    • NW - 2021-10-20
    • Needs Assessment
    • Bug Fix
    • Fix a regression where the AWS IMDSv2 endpoint was not called with the correct session and request timeouts, causing Facter to use a default timeout of 2 minutes.
    • Needs Assessment


      After upgrading from agent 6.24.0 to 6.25.0 and hence to facter version:

      3.14.20 (commit 28fd6cc7adae74c7748502e4d18d34f75be92f93)

      all our Puppet runs on non-EC2 VMs take +2 minutes spent in the fact collection phase. Debug logging reveals:

      Debug: Facter: executing command: /opt/puppetlabs/puppet/bin/virt-what
      Debug: Facter: kvm
      Debug: Facter: completed processing output: closing child pipes.
      Debug: Facter: process exited with status code 0.
      Debug: Facter: fact "is_virtual" has resolved to true.
      Debug: Facter: fact "virtual" has resolved to "kvm".
      Debug: Facter: not running under a Azure instance.
      Debug: Facter: resolving EC2 facts.
      Debug: Facter: requesting IMDSv2 token at
      Debug: Facter: requesting
      Debug: Facter: Trying
      Debug: Facter: connect to port 80 failed: Connection timed out
      Debug: Facter: Failed to connect to port 80: Connection timed out
      Debug: Facter: Closing connection 0
      Debug: Facter: EC2 IMDSv2 endpoint is unavailable
      Debug: Facter: querying EC2 instance metadata at
      Debug: Facter: requesting
      Debug: Facter: Trying
      Debug: Facter: Connection timed out after 600 milliseconds
      Debug: Facter: Closing connection 1
      Debug: Facter: EC2 facts are unavailable: not running under an EC2 instance or EC2 is not responding in a timely manner.

      Checking the IMDSv2 endpoint introduces a timeout of 2 minutes, and is the culprit here. Probably introduced by activating IMSDv2 checking by default:

      For the EC2 instance metadata check, a timeout of 600 ms is used, which is far more bearable.

      Would it be possible to add a bearable timeout also for the IMDSv2 check?


        Issue Links



              Unassigned Unassigned
              olifre Oliver Freyermuth
              2 Vote for this issue
              3 Start watching this issue



                Zendesk Support