[PUP-8048] puppet / facter fails randomly in low memory situations Created: 2017/10/13  Updated: 2019/10/01  Resolved: 2019/10/01

Status: Closed
Project: Puppet
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Normal
Reporter: Florian Klink Assignee: Florian Klink
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Method Found: Needs Assessment
QA Risk Assessment: Needs Assessment

 Description   

I accidentially created a VM with only 128MB RAM. Puppet run looks like this:

{{Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not autoload puppet/provider/service/init: undefined method `downcase' for nil:NilClass
Error: Could not autoload puppet/provider/service/openbsd: Could not autoload puppet/provider/service/init: undefined method `downcase' for nil:NilClass
Error: Could not retrieve local facts: Could not autoload puppet/provider/service/openbsd: Could not autoload puppet/provider/service/init: undefined method `downcase' for nil:NilClass
Error: Failed to apply catalog: Could not retrieve local facts: Could not autoload puppet/provider/service/openbsd: Could not autoload puppet/provider/service/init: undefined method `downcase' for nil:NilClass}}

This is due to Facter.value(:operatingsystem) being NilClass. When running with --debug, I see a lot of the following messages:Debug: Facter: value for <foo> is still nil

It took me a while to find out the puppet run succeeds with more memory just fine. I didn't see any OOM-Killings in dmesg. Of course, it might be not supported/advised to run puppet on such low memory, but I'd still expect puppet to somehow fail in a better way… This might boil down to facter failing in weird ways, puppet not noticing that, or something in between.

puppet-4.8.2-5 on Debian Stretch with packages provided by Debian directly.



 Comments   
Comment by Eric Sorenson [ 2017/11/06 ]

Florian - this will be a bit hard to reproduce, and you're right that it's not really "supported" to run puppet in 128mb RAM. Ruby is probably going to fail in bizarre ways that Puppet does not have visibility into. Can you confirm that running facter --debug by itself fails on this system?

Comment by Florian Klink [ 2017/11/07 ]

Running facter --debug alone doesn't fail, and shows a value for operatingsystem.

Doing the initial puppet run fails reproducible on a VM with 128MB RAM.

Comment by Josh Cooper [ 2019/10/01 ]

The Debian packages of puppet install facter 2.4.6 (the ruby version). It is entirely possible that the old ruby facter implementation required more/excessive amount of memory due to the way it executed the same facts multiple times. We don’t have the engineering resources to investigate this issue, so I'm going to close it. Feel free to reopen if you see the same issue with the puppet-agent packages provided by Puppet.

Generated at Thu Nov 21 03:31:50 PST 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.