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

blank/negative facter cache due to timed out EC2 metadata

    XMLWordPrintable

Details

    • Night's Watch
    • 3
    • PR - 2019-07-23, NW - 2019-08-07, NW - 2019-08-21, NW - 2019-09-03, NW - 2019-09-18
    • Needs Assessment
    • Enhancement
    • Hide
      Make the EC2 session timeout configurable via the {{EC2_SESSION_TIMEOUT}} environment variable (in milliseconds).

      If the environment variable does not exist or is set to an invalid value, Facter defaults it to 5000 (5 seconds).
      Show
      Make the EC2 session timeout configurable via the {{EC2_SESSION_TIMEOUT}} environment variable (in milliseconds). If the environment variable does not exist or is set to an invalid value, Facter defaults it to 5000 (5 seconds).
    • Needs Assessment

    Description

      We have a situation where our cloud metadata service (it's not AWS) takes longer than 5 seconds which puppet agent uses as metadata HTTP session timeout.

      In our case, this almost always produces:

      • In the EC2 cache-group JSON file, ec2_userdata populated, but ec2_metadata not populated
      • Blank results for all ec2_metadata facts (not so for ec2_userdata), until TTL reached and fact resolution retried

      Maybe this 'negative / partial-group' caching is by design, but as we cannot control the built-in EC2 facts timeout for the metadata queries, we cannot reliably populate the cache in a first/slow facter or agent run, thus turning the facter cache feature useless.

       

      ~# puppet agent --test  --noop
      Info: Using configured environment 'production'
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Loading facts
      Error: Facter: EC2 metadata request failed: Timeout was reached

      Notice: Caught INT; exiting

      ~# time facter ec2_metadata.ami-id

      real 0m0.093s
      user 0m0.082s
      sys 0m0.009s

       

       

      Attachments

        Activity

          People

            gabriel.nagy Gabriel Nagy
            randich Gustavo Randich
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support