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

Can't load catalog that was previously saved as yaml

    XMLWordPrintable

Details

    • Bug
    • Status: Accepted
    • Normal
    • Resolution: Unresolved
    • PUP 5.5.6
    • None
    • None
    • OS: Mac OS X 10.13 (high sierra)

      Puppet: installed from the puppet-agent DMG for Puppet 5.5.6

       

    • Coremunity
    • Needs Assessment
    • Needs Assessment

    Description

      Using puppet apply, if you configure the catalog_cache_terminus to yaml, and apply a catalog twice, you'll get an error on the second attempt when attempting to build the catalog from the cache. Here's the stack trace gathered using the '–trace' option:

      Error: undefined method `virtual' for "Stage[main]":String
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:683:in `virtual_not_exported?'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:657:in `block in to_catalog'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:655:in `each'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:655:in `to_catalog'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:516:in `to_ral'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:269:in `block in main'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:260:in `override'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:233:in `main'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:174:in `run_command'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `block in run'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:663:in `exit_on_fail'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `run'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:136:in `run'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:73:in `execute'
      /opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
      

      From a quick browse through the code, it looks like to_catalog assumes that edge sources and targets have been converted from the original strings, but they haven't.

      If you use 'catalog_cache_terminus=json', you don't see the error; as far as I can tell, the JSON and YAML versions of the cached catalog look equivalent.

      I've attached a tarball containing a trivial manifest and a Makefile; the manifest creates a tiny text file in `/tmp/hello.txt`. Doing

      $ make clean
      $ make puppet
      $ make puppet
      

      should produce the error. Using

      $ make clean
      $ PUPPET_OPTS=--catalog_cache_terminus=json make -e puppet
      $ PUPPET_OPTS=--catalog_cache_terminus=json make -e puppet 
      

      seems to work as it should.

      I haven't been able to find another ticket that records this error – if I missed one, my apologies. I don't imagine that the 'yaml' terminus is much used, but thought I'd note the problem.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kevin.charter Kevin Charter
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Zendesk Support