Bug #2030
launchd service provider getting set to Nil
| Status: | Duplicate | Start date: | 02/26/2009 | |
|---|---|---|---|---|
| Priority: | Low | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | OSX | |||
| Target version: | 0.24.8 | |||
| Affected Puppet version: | 0.24.7 | Branch: | ||
| Keywords: | ||||
| Votes: | 0 |
Description
I have been hunting this bug for a while. I can reproduce this bug on some machines, other identical machines have no problems.
Puppet version 0.24.7, ruby 1.8.6
When I set up a service like so:
class puppetclient {
package { “puppet”: ensure => present } service { “puppet”: name => “puppet”, ensure => running, enable => true }
}
Some clients work just fine, others error out with the following trace:
debug: Calling puppetmaster.getconfig
debug: Retrieved catalog in 2.62 seconds
debug: Puppet::Type::Package::ProviderRpm: Executing ‘/bin/rpm —version’
debug: Puppet::Type::Package::ProviderYum: Executing ‘/bin/rpm —version’
debug: Puppet::Type::Package::ProviderAptrpm: Executing ‘/bin/rpm -ql rpm’
debug: Puppet::Type::Package::ProviderUrpmi: Executing ‘/bin/rpm -ql rpm’
err: Could not create puppet: undefined method controllable?' for nil:NilClass
/usr/lib/ruby/site_ruby/1.8/puppet/type/service.rb:174:indefault'
/usr/lib/ruby/site_ruby/1.8/puppet/type.rb:651:in setdefaults'
/usr/lib/ruby/site_ruby/1.8/puppet/type.rb:140:ineachattr'
/usr/lib/ruby/site_ruby/1.8/puppet/type.rb:135:in each'
/usr/lib/ruby/site_ruby/1.8/puppet/type.rb:135:ineachattr'
/usr/lib/ruby/site_ruby/1.8/puppet/type.rb:641:in setdefaults'
/usr/lib/ruby/site_ruby/1.8/puppet/type.rb:2362:ininitialize'
/usr/lib/ruby/site_ruby/1.8/puppet/type.rb:1131:in new'
/usr/lib/ruby/site_ruby/1.8/puppet/type.rb:1131:increate'
/usr/lib/ruby/site_ruby/1.8/puppet/transportable.rb:91:in to_type'
/usr/lib/ruby/site_ruby/1.8/puppet/transportable.rb:198:into_catalog'
to_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:172:ingetconfig'
/usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:245:in run'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:425:inthinmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in measure'
/usr/lib/ruby/1.8/benchmark.rb:307:inrealtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:424:in thinmark'
/usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:244:inrun'
/usr/lib/ruby/1.8/sync.rb:229:in synchronize'
/usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:237:inrun'
/usr/sbin/puppetd:417
warning: Not using cache on failed catalog
warning: Configuration could not be instantiated: undefined method `controllable?‘ for nil:NilClass
I can narrow this down to the launchd.rb service provider file, as removing it makes the problem magically vanish. Putting the file back makes the problem reappear. Using strace -e open , here is the lead-up to the problem:
[pid 5932] open(“/usr/lib/ruby/site_ruby/1.8/puppet/type/service.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 5932] open(“/usr/lib/ruby/site_ruby/1.8/puppet/type/service.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 5932] open(“/usr/lib/ruby/site_ruby/1.8/puppet/type/service.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 5932] open(“/etc/puppet/modules”, O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) [pid 5932] open(“/etc/puppet/modules”, O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) [pid 5932] open(“/usr/share/puppet/modules”, O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) [pid 5932] open(“/usr/share/puppet/modules”, O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) [pid 5932] open(“/usr/lib/ruby/site_ruby/1.8/puppet/provider/service”, O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 6 [pid 5932] open(“/usr/lib/ruby/site_ruby/1.8/puppet/provider/service/launchd.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 5932] open(“/usr/lib/ruby/site_ruby/1.8/puppet/provider/service/launchd.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 5932] open(“/usr/lib/ruby/site_ruby/1.8/puppet/provider/service/launchd.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 5932] open(“/usr/lib/ruby/site_ruby/1.8/puppet/provider/service/launchd.rb”, O_RDONLY|O_LARGEFILE) = 6 err: Could not create snmpd: undefined method `controllable?‘ for nil:NilClass
On a good host, here is the same snippet of time/module loading: [pid 31010] open(“/usr/lib/ruby/site_ruby/1.8/puppet/type/service.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 31010] open(“/usr/lib/ruby/site_ruby/1.8/puppet/type/service.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 31010] open(“/usr/lib/ruby/site_ruby/1.8/puppet/type/service.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 31010] open(“/etc/puppet/modules”, O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) [pid 31010] open(“/etc/puppet/modules”, O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) [pid 31010] open(“/usr/share/puppet/modules”, O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) [pid 31010] open(“/usr/share/puppet/modules”, O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) [pid 31010] open(“/usr/lib/ruby/site_ruby/1.8/puppet/provider/service”, O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 6 [pid 31010] open(“/usr/lib/ruby/site_ruby/1.8/puppet/provider/service/gentoo.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 31010] open(“/usr/lib/ruby/site_ruby/1.8/puppet/provider/service/gentoo.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 31010] open(“/usr/lib/ruby/site_ruby/1.8/puppet/provider/service/gentoo.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 31010] open(“/usr/lib/ruby/site_ruby/1.8/puppet/provider/service/gentoo.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 31010] open(“/etc/puppet/modules”, O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) [pid 31010] open(“/etc/puppet/modules”, O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) [pid 31010] open(“/usr/share/puppet/modules”, O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) [pid 31010] open(“/usr/share/puppet/modules”, O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) [pid 31010] open(“/usr/lib/ruby/site_ruby/1.8/puppet/provider/service/init.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 31010] open(“/usr/lib/ruby/site_ruby/1.8/puppet/provider/service/init.rb”, O_RDONLY|O_LARGEFILE) = 6 [pid 31010] open(“/usr/lib/ruby/site_ruby/1.8/puppet/provider/service/init.rb”, O_RDONLY|O_LARGEFILE) = 6
The good host then follows-through to load service/base.rb, confine/variable.rb, confine.rb, service/redhat.rb, service/debian.rb, then service/launch.rb, then the thread exits correctly.
My guess is the order of loading of launchd.rb is what is screwing the pooch here. I can reproduce at will.
Please help me find the source of my aggravation.
Related issues
History
Updated by Samuel Stringham almost 3 years ago
- Priority changed from Normal to Low
So, I found the problem:
require ‘facter/util/plist’
Line 1 in launchd.rb. This is dependant upon a higher version of facter than I had installed. Puppet 0.24.7 requires facter > 1.3.7 ; 1.5.4 works fine.
I would still like to see a better error message though, as silently failing on a require leading to a null class instantiation was troublesome to track down.
Updated by James Turnbull almost 3 years ago
- Category set to OSX
- Status changed from Unreviewed to Accepted
- Assignee set to Nigel Kersten
- Target version set to 0.24.8
Updated by James Turnbull almost 3 years ago
- Subject changed from Service provider getting set to Nil to launchd service provider getting set to Nil
Updated by Nigel Kersten almost 3 years ago
Updated by James Turnbull almost 3 years ago
- Status changed from Accepted to Duplicate
Fixed in 0.24.8.