Jira (PUP-9154) Can't load cached catalogs using the 'yaml' catalog_cache_terminus

10 views
Skip to first unread message

Kevin Charter (JIRA)

unread,
Sep 20, 2018, 6:39:03 PM9/20/18
to puppe...@googlegroups.com
Kevin Charter updated an issue
 
Puppet / Bug PUP-9154
Can't load cached catalogs using the 'yaml' catalog_cache_terminus
Change By: Kevin Charter
Summary: Can't load cached catalogs using the 'yaml' cache_catalog_terminus catalog_cache_terminus
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (Jira)

unread,
Jun 14, 2021, 5:01:02 PM6/14/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-9154
 
Re: Can't load cached catalogs using the 'yaml' catalog_cache_terminus

The problem is catalog_cache_terminus overrides the literal expression, and we try to load and apply the cached catalog from disk. When using the yaml terminus, we don't have a previously cached catalog (as the default terminus is JSON). So we return an empty catalog. When using the JSON terminus, we return the previously cached catalog, so it "seems" to work.

I think puppet apply should always evaluate the expression or manifest passed on the command line, instead of loading the previously cached catalog.

This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Josh Cooper (Jira)

unread,
Jun 14, 2021, 5:16:03 PM6/14/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-9154

This was broken in PUP-5340, see https://github.com/puppetlabs/puppet/commit/85bfe5f8d5e4b0c694c70157be42acb51367d12d. I don't understand the use case for reading a cached catalog when puppet apply. If you want to apply the cached catalog, then you can do:

puppet apply --catalog /opt/puppetlabs/puppet/cache/client_data/catalog/$(facter fqdn).json 

Or alternatively we could add a command line option to load from the cache, and it would be mutually exclusive with - or --catalog:

puppet apply --cache

Note we don't write to the cache during puppet apply, because we don't want puppet apply to "break" the cached catalog that puppet agent uses.

Josh Cooper (Jira)

unread,
Jun 14, 2021, 5:23:01 PM6/14/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Comment:
The problem is {{catalog_cache_terminus}} overrides the literal expression, and we try to load and apply the cached catalog from disk. When using the yaml terminus, we don't have a previously cached catalog (as the default terminus is JSON). So we return an empty catalog. When using the JSON terminus, we return the previously cached catalog, so it "seems" to work.

I think {{puppet apply}} should always evaluate the expression or manifest passed on the command line, instead of loading the previously cached catalog.

Josh Cooper (Jira)

unread,
Jun 14, 2021, 6:41:03 PM6/14/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-9154
 
Re: Can't load cached catalogs using the 'yaml' catalog_cache_terminus

The issue is Puppet::Resource::Catalog doesn't implement initialize_from_hash but it's super class does, so we end up with a partially deserialized catalog. The catalog class needs to implement initialize_from_hash like other domain objects (Report, etc) do, so they can be deserialized correctly via PsychSupport.

Reply all
Reply to author
Forward
0 new messages