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

puppet inspect is using wrong path for catalog data

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: PUP 4.2.1
    • Fix Version/s: PUP 4.4.1
    • Component/s: None
    • Labels:
      None
    • Template:
    • Story Points:
      2
    • Sprint:
      Client 2016-03-23
    • Zendesk Ticket IDs:
      33271
    • Zendesk Ticket Count:
      1
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      In Puppet 3 the catalog cache end-point changed to JSON, but {{puppet inspect}} was not updated to take that into account. Fix {{puppet inspect}} so it successfully finds the cached catalog. There are still known issues with {{inspect}} (PUP-6041).
      Show
      In Puppet 3 the catalog cache end-point changed to JSON, but {{puppet inspect}} was not updated to take that into account. Fix {{puppet inspect}} so it successfully finds the cached catalog. There are still known issues with {{inspect}} ( PUP-6041 ).

      Description

      Deploying Puppet 4 at a client which makes heavy use of puppet inspect and found that Puppet 4 uses the wrong path to find the client catalog.

      [vagrant@client ~]$ sudo puppet agent --test
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Loading facts
      Info: Caching catalog for client.example.com
      Info: Applying configuration version '1442215415'
      Notice: /Stage[main]/Main/File[/etc/hosts]/content: audit change: previously recorded value {md5}e2b06541983600068fff455f8c11861a has been changed to {md5}28c9f9f5a3d060a500d4b57f9875ba32
      Notice: Applied catalog in 0.39 seconds
       
      [vagrant@client ~]$ sudo puppet inspect
      Error: Could not run: Could not find catalog for client.example.com
      

      Strace shows us that it's looking in the client_yaml directory instead of client_data.

      [pid  7817] lstat("/opt/puppetlabs", {st_mode=S_IFDIR|0755, st_size=42, ...}) = 0
      [pid  7817] lstat("/opt/puppetlabs/puppet", {st_mode=S_IFDIR|0755, st_size=102, ...}) = 0
      [pid  7817] lstat("/opt/puppetlabs/puppet/lib", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
      [pid  7817] lstat("/opt/puppetlabs/puppet/lib/ruby", {st_mode=S_IFDIR|0755, st_size=47, ...}) = 0
      [pid  7817] lstat("/opt/puppetlabs/puppet/lib/ruby/vendor_ruby", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
      [pid  7817] lstat("/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
      [pid  7817] lstat("/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
      [pid  7817] lstat("/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/yaml.rb", {st_mode=S_IFREG|0644, st_size=1940, ...}) = 0
      [pid  7817] stat("/etc/puppetlabs/puppet/routes.yaml", 0x7fff96c96bd0) = -1 ENOENT (No such file or directory)
      [pid  7817] stat("/opt/puppetlabs/puppet/cache/client_yaml/catalog/client.example.com.yaml", 0x7fff96c96bd0) = -1 ENOENT (No such file or directory)
      [pid  7817] write(2, "\33[1;31mError: Could not run: Cou"..., 78Error: Could not run: Could not find catalog for client.example.com) = 78
      

      The catalog is actually stored in /opt/puppetlabs/puppet/cache/client_data/catalog/.

      Furthermore, the catalog is now in JSON format not YAML, and there's no documented command line option to read this properly.

      $ ls -la /opt/puppetlabs/puppet/cache/client_data/catalog/
      total 24
      drwxr-xr-x 2 root root    64 Sep 14 07:46 .
      drwxr-x--- 3 root root    20 Aug  2 22:49 ..
      -rw-rw---- 1 root root 16947 Sep 14 07:46 client.example.com.json
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                halim.wijaya Halim Wijaya
                Reporter:
                jorhett Jo Rhett
              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support