Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading warning when fact values limit is exceeded #9226

Open
joshcooper opened this issue Jan 26, 2024 · 0 comments
Open

Misleading warning when fact values limit is exceeded #9226

joshcooper opened this issue Jan 26, 2024 · 0 comments
Labels
bug Something isn't working help wanted Issue has been reviewed & PRs are welcome

Comments

@joshcooper
Copy link
Contributor

Describe the Bug

Puppet agents print a warning if the number of fact values exceeds its soft limit:

Warning: The current total number of facts: 5787 exceeds the number of facts limit: 2048

However, the wording "total number of facts" is confusing, because it sounds like it's the number of facts, when really the problem is the number of values that the facts are producing, due to nested arrays and hashes like the _puppet_inventory_1 fact in PE.

Expected Behavior

The message should say something like

The total number of fact values X exceeds the fact values limit Y

See https://puppetcommunity.slack.com/archives/CFD8Z9A4T/p1705430272043379?thread_ts=1705428680.188929&cid=CFD8Z9A4T

The documentation for the number_of_facts_soft_limit should be updated so its clear we're counting the leaves of structured facts.

Steps to Reproduce

Steps to reproduce the behavior:

# cat <<END > /opt/puppetlabs/facter/facts.d/many.rb 
#!/opt/puppetlabs/puppet/bin/ruby
require 'json'
puts JSON.dump("many" => [*1..3000])
END
# puppet agent -t
/opt/puppetlabs/puppet/bin/puppet agent -t
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Warning: The current total number of facts: 3323 exceeds the number of facts limit: 2048

Environment

  • Version 8.4.0 and 7.28.0

Additional Context

This behavior is occurring because we corrected how fact values are counted, see f33de24

@joshcooper joshcooper added bug Something isn't working help wanted Issue has been reviewed & PRs are welcome labels Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Issue has been reviewed & PRs are welcome
Projects
None yet
Development

No branches or pull requests

1 participant