Jira (FACT-1581) Facter 3 & 4 report an error when JSON external facts are empty

4 views
Skip to first unread message

Josh Cooper (Jira)

unread,
Jan 9, 2023, 3:14:02 PM1/9/23
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Facter / Bug FACT-1581
Facter 3 & 4 report an error when JSON external facts are empty
Change By: Josh Cooper
Summary: Facter reports 3 & 4 report an error when JSON external facts are empty
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Josh Cooper (Jira)

unread,
Jan 9, 2023, 3:14:02 PM1/9/23
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Component/s: Facter 4
Component/s: Facter 3

Josh Cooper (Jira)

unread,
Jan 9, 2023, 3:15:02 PM1/9/23
to puppe...@googlegroups.com
Josh Cooper commented on Bug FACT-1581
 
Re: Facter 3 & 4 report an error when JSON external facts are empty

Puppet 6/Facter 3 will be EOL at the end of February, so we won't have plans on fixing that version.

The issue also occurs in Puppet 7/Facter 4:

 

# facter --version 4.2.14
 
# cat /opt/puppetlabs/facter/facts.d/packages.json
 
# facter os.name
[2023-01-09 20:12:41.840516 ] ERROR Facter - Failed to handle /opt/puppetlabs/facter/facts.d/packages.json as LegacyFacter::Util::Parser::JsonParser facts: 783: unexpected token at ''
backtrace:
/opt/puppetlabs/puppet/lib/ruby/2.7.0/json/common.rb:156:in `parse'
/opt/puppetlabs/puppet/lib/ruby/2.7.0/json/common.rb:156:in `parse'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/custom_facts/util/parser.rb:146:in `parse_results'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/custom_facts/util/parser.rb:60:in `results'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/custom_facts/util/directory_loader.rb:117:in `block in resolve_fact'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/framework/benchmarking/timer.rb:18:in `measure'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/custom_facts/util/directory_loader.rb:117:in `resolve_fact'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/custom_facts/util/directory_loader.rb:91:in `block in load_searched_facts'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/custom_facts/util/directory_loader.rb:87:in `each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/custom_facts/util/directory_loader.rb:87:in `load_searched_facts'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/custom_facts/util/directory_loader.rb:50:in `load'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/custom_facts/util/collection.rb:180:in `load_external_facts'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/custom_facts/util/collection.rb:95:in `external_facts'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/framework/core/fact_loaders/external_fact_loader.rb:35:in `load_external_facts'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/framework/core/fact_loaders/external_fact_loader.rb:10:in `external_facts'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/framework/core/fact_loaders/fact_loader.rb:64:in `load_external_facts'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/framework/core/fact_loaders/fact_loader.rb:24:in `load'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/framework/core/fact_manager.rb:20:in `resolve_facts'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter.rb:521:in `resolve_facts_for_user_query'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter.rb:454:in `to_user_output'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/framework/cli/cli.rb:124:in `query'
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/framework/cli/cli_launcher.rb:23:in `start'
/opt/puppetlabs/puppet/bin/facter:10:in `<main>' 
RedHat

Reply all
Reply to author
Forward
0 new messages