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

Executable external facts broken in 4.0.0: not executable on agent

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Done
    • PUP 4.0.0
    • PUP 4.1.0
    • None
    • None
    • 3
    • Client 2015-05-13, Client 2015-05-27
    • Bug Fix

    Description

      While investigating 3.x->4.x compatibility for SERVER-526 I tried to use an executable external fact, but this did not work in 4.0.0 (it worked in 3.7.5). The file is no longer executable on the agent side, so the agent run spits out a warning saying the fact file was parsed but returned an empty data set.

      When looking at the HTTP traffic for my executable external fact file, I see the file_metadata response does in fact specify a different mode between 3.7.5 and 4.0.0.

      Below you'll find the request+response for the external fact - notice the mode is different in the responses.

      3.7.5

      REQUEST
      GET /production/file_metadatas/pluginfacts?links=manage&recurse=true&ignore=.svn&ignore=CVS&ignore=.git&checksum_type=md5 HTTP/1.1
      Accept: pson, msgpack, yaml, b64_zlib_yaml, raw
      Accept-Encoding: identity
      User-Agent: Ruby
      Host: localhost:8666
       
      RESPONSE
      HTTP/1.1 200 OK 
      X-Puppet-Version: 3.7.5
      Content-Type: text/pson
      Server: WEBrick/1.3.1 (Ruby/1.9.3/2014-11-13) OpenSSL/0.9.8za
      Date: Tue, 14 Apr 2015 23:49:29 GMT
      Content-Length: 696
      Connection: Keep-Alive
       
      [
          {
              "document_type": "FileMetadata",
              "data": {
                  "path": "\/Users\/nwolfe\/workspace\/puppetlabs\/conf\/master\/v3\/conf\/modules\/tmpfiles\/facts.d",
                  "relative_path": ".",
                  "links": "manage",
                  "owner": 501,
                  "group": 20,
                  "mode": 493,
                  "checksum": {
                      "type": "ctime",
                      "value": "{ctime}2015-04-14 16:31:21 -0700"
                  },
                  "type": "directory",
                  "destination": null
              },
              "metadata": {
                  "api_version": 1
              }
          },
          {
              "document_type": "FileMetadata",
              "data": {
                  "path": "\/Users\/nwolfe\/workspace\/puppetlabs\/conf\/master\/v3\/conf\/modules\/tmpfiles\/facts.d",
                  "relative_path": "external_fact_date",
                  "links": "manage",
                  "owner": 501,
                  "group": 20,
                  "mode": 493,
                  "checksum": {
                      "type": "md5",
                      "value": "{md5}abec184c543c4dadfa4bf4e70c0b3000"
                  },
                  "type": "file",
                  "destination": null
              },
              "metadata": {
                  "api_version": 1
              }
          }
      ]
      

      4.0.0

      REQUEST
      GET /puppet/v3/file_metadatas/pluginfacts?environment=production&links=follow&recurse=true&ignore=.svn&ignore=CVS&ignore=.git&checksum_type=md5 HTTP/1.1
      Accept: pson, msgpack, yaml, binary
      X-Puppet-Version: 4.0.0
      Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
      User-Agent: Ruby
      Host: localhost:8666
       
      RESPONSE
      HTTP/1.1 200 OK 
      X-Puppet-Version: 4.0.0
      Content-Type: text/pson
      Server: WEBrick/1.3.1 (Ruby/1.9.3/2014-11-13) OpenSSL/0.9.8za
      Date: Tue, 14 Apr 2015 23:56:14 GMT
      Content-Length: 606
      Connection: Keep-Alive
       
      [
          {
              "path": "\/Users\/nwolfe\/workspace\/puppetlabs\/conf\/master\/v4\/code\/environments\/production\/modules\/tmpfiles\/facts.d",
              "relative_path": ".",
              "links": "follow",
              "owner": 501,
              "group": 20,
              "mode": 420,
              "checksum": {
                  "type": "ctime",
                  "value": "{ctime}2015-04-14 16:31:21 -0700"
              },
              "type": "directory",
              "destination": null
          },
          {
              "path": "\/Users\/nwolfe\/workspace\/puppetlabs\/conf\/master\/v4\/code\/environments\/production\/modules\/tmpfiles\/facts.d",
              "relative_path": "external_fact_date",
              "links": "follow",
              "owner": 501,
              "group": 20,
              "mode": 420,
              "checksum": {
                  "type": "md5",
                  "value": "{md5}abec184c543c4dadfa4bf4e70c0b3000"
              },
              "type": "file",
              "destination": null
          }
      ]
      

      I came across some tickets that may be related:

      I verified this behavior in our newly-released 4.0.0 packages (PC1).

      QA


      risk: high (regression)
      severity: high
      probability: high
      test layer: acceptance

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nwolfe Nate Wolfe
              Eric Thompson Eric Thompson
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support