Jira (FACT-2941) 'puppet facts diff' logs error when apt module is installed

26 views
Skip to first unread message

Gheorghe Popescu (Jira)

unread,
Feb 17, 2021, 2:25:04 AM2/17/21
to puppe...@googlegroups.com
Gheorghe Popescu created an issue
 
Facter / Bug FACT-2941
'puppet facts diff' logs error when apt module is installed
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2021/02/16 11:24 PM
Priority: Normal Normal
Reporter: Gheorghe Popescu

Platforms: OS X, Centos 7 (as tested by me), might be on all

Step to reproduce:

  • install latest puppet 6
  • install puppetlabs-apt module
  • run `puppet facts diff`

❯ puppet --version
p6.21.1
❯ puppet facts diff
{"hypervisors.vmware.version":{"new_value":"ESXi 6.7","old_value":""}}
 
 
Notice: Preparing to install into /etc/puppetlabs/code/environments/production/modules ...
Notice: Downloading from https://forgeapi.puppet.com ...
Notice: Installing -- do not interrupt ...
/etc/puppetlabs/code/environments/production/modules
└── puppetlabs-stdlib (v6.6.0)
 
❯ puppet facts diff
{"hypervisors.vmware.version":{"new_value":"ESXi 6.7","old_value":""}}
❯ puppet module install puppetlabs-apt
Notice: Preparing to install into /etc/puppetlabs/code/environments/production/modules ...
Notice: Downloading from https://forgeapi.puppet.com ...
Notice: Installing -- do not interrupt ...
/etc/puppetlabs/code/environments/production/modules
└─┬ puppetlabs-apt (v7.7.1)
  ├── puppetlabs-stdlib (v6.6.0)
  └── puppetlabs-translate (v2.2.0)
 
❯ puppet facts diff
E, [2021-02-17T07:14:34.049701 #1797] ERROR -- : Facter - Error while resolving custom fact fact='apt_package_updates', resolution='<anonymous>': undefined method `[]' for nil:NilClass
E, [2021-02-17T07:14:34.051667 #1797] ERROR -- : Facter - Error while resolving custom fact fact='apt_package_dist_updates', resolution='<anonymous>': undefined method `[]' for nil:NilClass
E, [2021-02-17T07:14:34.053433 #1797] ERROR -- : Facter - Error while resolving custom fact fact='apt_package_security_updates', resolution='<anonymous>': undefined method `[]' for nil:NilClass
E, [2021-02-17T07:14:34.055293 #1797] ERROR -- : Facter - Error while resolving custom fact fact='apt_package_security_dist_updates', resolution='<anonymous>': undefined method `[]' for nil:NilClass
E, [2021-02-17T07:14:34.057133 #1797] ERROR -- : Facter - Error while resolving custom fact fact='apt_updates', resolution='<anonymous>': undefined method `[]' for nil:NilClass
E, [2021-02-17T07:14:34.058807 #1797] ERROR -- : Facter - Error while resolving custom fact fact='apt_dist_updates', resolution='<anonymous>': undefined method `[]' for nil:NilClass
E, [2021-02-17T07:14:34.060489 #1797] ERROR -- : Facter - Error while resolving custom fact fact='apt_security_updates', resolution='<anonymous>': undefined method `[]' for nil:NilClass
E, [2021-02-17T07:14:34.062122 #1797] ERROR -- : Facter - Error while resolving custom fact fact='apt_security_dist_updates', resolution='<anonymous>': undefined method `[]' for nil:NilClass
{"hypervisors.vmware.version":{"new_value":"ESXi 6.7","old_value":""}}

/opt/puppetlabs/puppet/bin/facter-ng does not log any error so most likely it happens when resolving the facts added in puppet form modules.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Gheorghe Popescu (Jira)

unread,
Feb 17, 2021, 2:26:03 AM2/17/21
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
Change By: Gheorghe Popescu
Platforms: OS X, Centos 7 (as tested by me), might be on all

Step to reproduce:
- install latest puppet 6
- install puppetlabs-apt module
- run `puppet facts diff`


{noformat}
{noformat}

*/opt/puppetlabs/puppet/bin/facter-ng* does not log any error so most likely it happens when resolving the facts added in puppet
form , from modules.

Gheorghe Popescu (Jira)

unread,
Feb 17, 2021, 2:27:03 AM2/17/21
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
Platforms: OS X, Centos 7 (as tested by me), might be on all

Step to reproduce:
- install latest puppet 6
- install puppetlabs-apt module
- run `puppet facts diff`


{noformat}
❯ puppet --version
6.21.1

❯ puppet facts diff
{"hypervisors.vmware.version":{"new_value":"ESXi 6.7","old_value":""}}

❯ puppet module install puppetlabs-stdlib
*/opt/puppetlabs/puppet/bin/facter-ng* does not log any error so most likely it happens when resolving the facts added in puppet form modules.

Gheorghe Popescu (Jira)

unread,
Feb 17, 2021, 2:27:03 AM2/17/21
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
Platforms: OS X, Centos 7 (as tested by me), might be on all

Step to reproduce:
- install latest puppet 6
- install puppetlabs-apt module
- run `puppet facts diff`


{noformat}
❯ puppet --version
p6 6 .21.1

❯ puppet facts diff
{"hypervisors.vmware.version":{"new_value":"ESXi 6.7","old_value":""}}


*/opt/puppetlabs/puppet/bin/facter-ng* does not log any error so most likely it happens when resolving the facts added in puppet , from form modules.

Gheorghe Popescu (Jira)

unread,
Feb 17, 2021, 2:28:02 AM2/17/21
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
Platforms: OS X, Centos 7 (as tested by me), might be on all
pupptlabs-apt: 7.7.1(latest)

Step to reproduce:
- install latest puppet 6
- install puppetlabs-apt module
- run `puppet facts diff`


{noformat}
❯ puppet --version
6.21.1

❯ puppet facts diff
{"hypervisors.vmware.version":{"new_value":"ESXi 6.7","old_value":""}}

❯ puppet module install puppetlabs-stdlib
*/opt/puppetlabs/puppet/bin/facter-ng* does not log any error so most likely it happens when resolving the facts added in puppet form modules.

Mihai Buzgau (Jira)

unread,
Feb 17, 2021, 6:23:03 AM2/17/21
to puppe...@googlegroups.com

Gheorghe Popescu (Jira)

unread,
Feb 17, 2021, 6:28:02 AM2/17/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Feb 22, 2021, 4:43:03 AM2/22/21
to puppe...@googlegroups.com

Gheorghe Popescu (Jira)

unread,
Feb 22, 2021, 8:34:03 AM2/22/21
to puppe...@googlegroups.com
Gheorghe Popescu commented on Bug FACT-2941
 
Re: 'puppet facts diff' logs error when apt module is installed

This happens because in the `diff` action, `cfacter` is not removed before `facter-ng` is required: https://github.com/puppetlabs/puppet/blob/6.x/lib/puppet/face/facts.rb#L137-L138, which leads to methods that are defined in the Ruby C API of facter 3 to be accessible. It should be fixed if `Object.send(:remove_const, :Facter)`
is called before loading `facter-ng`.

Josh Cooper (Jira)

unread,
Mar 2, 2021, 7:03:56 PM3/2/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Fix Version/s: FACT 4.0.52

Claire Cadman (Jira)

unread,
Mar 11, 2021, 4:05:03 AM3/11/21
to puppe...@googlegroups.com

Luchian Nemes (Jira)

unread,
Apr 12, 2021, 2:52:02 AM4/12/21
to puppe...@googlegroups.com
Luchian Nemes updated an issue
Change By: Luchian Nemes
Fix Version/s: FACT 3.14.17
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Luchian Nemes (Jira)

unread,
Apr 14, 2021, 8:43:01 AM4/14/21
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages