Jira (FACT-3036) Null value custom facts don't load

17 views
Skip to first unread message

Brian Gibson (Jira)

unread,
May 10, 2021, 2:36:04 PM5/10/21
to puppe...@googlegroups.com
Brian Gibson created an issue
 
Facter / Bug FACT-3036
Null value custom facts don't load
Issue Type: Bug Bug
Affects Versions: FACT 4.0.44
Assignee: Unassigned
Components: Facter 4
Created: 2021/05/10 11:35 AM
Environment:

I'm running Centos 7 with Puppet 7.6.1-1.

Fix Versions: FACT 3.y
Priority: Normal Normal
Reporter: Brian Gibson

In Facter 3, if I have a custom fact, a simple one in a txt file in /etc/puppetlabs/facter/facts.d/ where the variable = null, it will show up in facts, and I can use it in my code checking for the null value.  In Facter 4, the variable doesn't load at all.

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

Gheorghe Popescu (Jira)

unread,
May 11, 2021, 2:09:04 AM5/11/21
to puppe...@googlegroups.com
Gheorghe Popescu commented on Bug FACT-3036
 
Re: Null value custom facts don't load

Hi Brian Gibson I've tried to reproduce the issue with the following file, but I can access the fact:

 

 

❯ cat /etc/puppetlabs/facter/facts.d/test.txt
var=null
❯ /opt/puppetlabs/puppet/bin/facter --version
4.1.1
❯ /opt/puppetlabs/puppet/bin/facter var
null
❯ puppet apply -e 'notice($facts["var"])'
Notice: Scope(Class[main]): null

 

 

Can you provide a bit more of details?

 

 

Brian Gibson (Jira)

unread,
May 11, 2021, 7:16:05 AM5/11/21
to puppe...@googlegroups.com
Brian Gibson commented on Bug FACT-3036

Okay I see that behavior as well, the problem I'm having results from accessing information from puppetdb specifically.

On my puppet master server I have the following versions:

puppetserver 6.15.3

puppetdb 6.16.1

 

We're using a python script against puppetdb.  When we have facts that are set with a null value, with puppet agent 6.22.1 they show  up in puppetdb also with the null value, but when my puppet agents were upgraded to version 7 my facts with null values no longer populate in puppetdb.

Gheorghe Popescu (Jira)

unread,
May 11, 2021, 8:26:02 AM5/11/21
to puppe...@googlegroups.com

I've upgraded to the latest puppet/server/pdb and I can see the fact.

❯ curl -X GET http://localhost:8080/pdb/query/v4/facts/var | jq .
 
[
  {
    "certname": "my_host",
    "environment": "production",
    "name": "var",
    "value": "null"
  }
]

 

 

 

Mihai Buzgau (Jira)

unread,
May 11, 2021, 10:51:03 AM5/11/21
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
 
Change By: Mihai Buzgau
Team: Night's Watch

Mihai Buzgau (Jira)

unread,
May 11, 2021, 10:51:04 AM5/11/21
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Labels: community

Josh Cooper (Jira)

unread,
Apr 21, 2022, 1:42:04 PM4/21/22
to puppe...@googlegroups.com
Josh Cooper commented on Bug FACT-3036
 
Re: Null value custom facts don't load

bgibson710 have you been able to reproduce the error? Note I found some discrepancies between facter 3 and 4, see FACT-3111. Not sure it's related?

This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Brian Gibson (Jira)

unread,
Oct 5, 2022, 7:49:03 AM10/5/22
to puppe...@googlegroups.com
Brian Gibson commented on Bug FACT-3036

To be honest this has been so long ago I don't recall it anymore.  If others are saying that it's working as intended I guess just close it out.

This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Josh Cooper (Jira)

unread,
Oct 5, 2022, 12:19:03 PM10/5/22
to puppe...@googlegroups.com
Josh Cooper commented on Bug FACT-3036

Ok thanks for checking back in Brian Gibson I'll close for now, but feel free to reopen if you can reproduce.

Reply all
Reply to author
Forward
0 new messages