Jira (FACT-3079) Caching not working for some custom facts

1 view
Skip to first unread message

Tom Parker (Jira)

unread,
Oct 6, 2021, 10:32:03 AM10/6/21
to puppe...@googlegroups.com
Tom Parker created an issue
 
Facter / Bug FACT-3079
Caching not working for some custom facts
Issue Type: Bug Bug
Assignee: Unassigned
Attachments: facter.conf, yum, yum-facter-debug.log
Created: 2021/10/06 7:31 AM
Environment:

Puppet 7.11 on CentOS 7

Priority: Normal Normal
Reporter: Tom Parker

I have configured facter to cache and block several core and custom facts (puppet 7.11) and I am finding that the behaviour is odd.   The example that I have attached here is from the puppetlabs-yum module that declares 3 custom facts:

- yum_package_updates (This is the primary fact that does all the work)
- yum_has_updates (returns the value of yum_package_updates.any?)

  • yum_updates (returns the value of yum_package_updates.length)

My facter.conf file (attached) declares a yum group that contains these 3 facts but when I run puppet only the yum_package_updates fact is cached (cache file attached).

This seems to cause the other two dependent facts (yum_has_updates and yum_updates) to force the resolution (not from cache) of the main yum_package_updates fact.

I can also see in the debug logs that it seems to use the cache sometimes but then lose the cached value and resolve it again.  It also states that the cache file is expired, missing or corrupt but the file is fresh, created by facter itself and the ttl is 6 hours.

If I specify all 3 facts in the cache individually (not in a group) the caching behaviour seems to work properly.  

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

Ciprian Badescu (Jira)

unread,
Oct 11, 2021, 10:15:03 AM10/11/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Oct 11, 2021, 10:15:03 AM10/11/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Oct 18, 2021, 10:20:02 AM10/18/21
to puppe...@googlegroups.com
Ciprian Badescu updated an issue
Change By: Ciprian Badescu
Sprint: NW - 2021-11-17

Ciprian Badescu (Jira)

unread,
Oct 19, 2021, 8:40:02 AM10/19/21
to puppe...@googlegroups.com
Ciprian Badescu commented on Bug FACT-3079
 
Re: Caching not working for some custom facts

Reproduced this bellow:

 

# cat /etc/puppetlabs/facter/facter.conf               
facts : {
    ttls : [
        { "yum" : 6 hours },
    ]
}
fact-groups : {
 yum : ["yum_package_updates", "yum_has_updates", "yum_updates"],
}
 
# date
Tue Oct 19 12:30:48 UTC 2021
# ls -l /opt/puppetlabs/facter/cache/cached_facts/yum
-rw-r--r-- 1 root root 6959 Oct 19 12:29 /opt/puppetlabs/facter/cache/cached_facts/yum
# puppet facts &>/dev/null                           
# ls -l /opt/puppetlabs/facter/cache/cached_facts/yum
-rw-r--r-- 1 root root 6959 Oct 19 12:31 /opt/puppetlabs/facter/cache/cached_facts/yum
 

 

Ciprian Badescu (Jira)

unread,
Oct 19, 2021, 8:41:03 AM10/19/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Nov 3, 2021, 5:35:06 AM11/3/21
to puppe...@googlegroups.com

Dorin Pleava (Jira)

unread,
Nov 3, 2021, 9:17:02 AM11/3/21
to puppe...@googlegroups.com
Dorin Pleava assigned an issue to Dorin Pleava
Change By: Dorin Pleava
Assignee: Dorin Pleava

Ciprian Badescu (Jira)

unread,
Nov 16, 2021, 8:08:03 AM11/16/21
to puppe...@googlegroups.com
 
Re: Caching not working for some custom facts

Could be tested with full config from https://tickets.puppetlabs.com/browse/FACT-3080 to check for performance change

Ciprian Badescu (Jira)

unread,
Nov 17, 2021, 4:14:03 AM11/17/21
to puppe...@googlegroups.com
Ciprian Badescu updated an issue
Change By: Ciprian Badescu
Sprint: NW - 2021-11-17 , NW - 2021-12-06

Ciprian Badescu (Jira)

unread,
Dec 6, 2021, 2:51:01 PM12/6/21
to puppe...@googlegroups.com
Ciprian Badescu updated an issue
Change By: Ciprian Badescu
Fix Version/s: FACT 4.2.6

Parker Leach (Jira)

unread,
Dec 8, 2021, 11:53:03 AM12/8/21
to puppe...@googlegroups.com
Parker Leach updated an issue
Change By: Parker Leach
Labels: docs_reviewed
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

otheus (Jira)

unread,
Oct 7, 2022, 1:47:01 PM10/7/22
to puppe...@googlegroups.com
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

otheus (Jira)

unread,
Oct 7, 2022, 1:55:02 PM10/7/22
to puppe...@googlegroups.com
otheus commented on Bug FACT-3079

This ought to be fixed for facter 3, not only "ng". 

Reply all
Reply to author
Forward
0 new messages