Bug #3101
Unhelpful message "undefined method `closed?' for nil:NilClass" when DNS misconfigured
| Status: | Closed | Start: | 01/23/2010 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | error reporting | |||
| Target version: | 0.25.5 | |||
| Affected version: | 0.25.4 | Branch: | git@github.com:MarkusQ/puppet.git ticket/0.25.x/3101 | |
| Keywords: | ||||
| Votes: | 0 |
Description
Getting the following trace from puppetd:
debug: Using cached certificate_revocation_list for ca, good until
debug: catalog supports formats: b64_zlib_yaml marshal pson raw yaml; using pson
/opt/chsfw/lib/ruby/1.8/net/http.rb:1060:in request'
/opt/chsfw/lib/ruby/1.8/net/http.rb:772:inget'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/indirector/rest.rb:69:in find'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:195:infind'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/indirector.rb:51:in find'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/configurer.rb:106:inretrieve_catalog'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/util.rb:418:in thinmark'
/opt/chsfw/lib/ruby/1.8/benchmark.rb:308:inrealtime'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/util.rb:417:in thinmark'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/configurer.rb:105:inretrieve_catalog'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/configurer.rb:158:in run'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/agent.rb:53:inrun'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/agent/locker.rb:21:in lock'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/agent.rb:53:inrun'
/opt/chsfw/lib/ruby/1.8/sync.rb:230:in synchronize'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/agent.rb:53:inrun'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/agent.rb:130:in with_client'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/agent.rb:51:inrun'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/application/puppetd.rb:103:in onetime'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/application.rb:226:insend'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/application.rb:226:in run_command'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/application.rb:217:inrun'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/application.rb:306:in exit_on_fail'
/opt/chsfw/lib/ruby/site_ruby/1.8/puppet/application.rb:217:inrun'
/opt/chsfw/sbin/puppetd:159
err: Could not retrieve catalog from remote server: undefined method `closed?‘ for nil:NilClass
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
Debug output from puppetmasterd:
[root@vulcan classes]# puppetmasterd —debug —no-daemonize debug: Failed to load library ‘selinux’ for feature ‘selinux’ debug: Failed to load library ‘shadow’ for feature ‘libshadow’ debug: Puppet::Type::User::ProviderLdap: true value when expecting false debug: Puppet::Type::User::ProviderPw: file pw does not exist debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl does not exist debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not exist debug: Failed to load library ‘ldap’ for feature ‘ldap’ debug: /File[/var/puppet/state]: Autorequiring File[/var/puppet] debug: /File[/var/puppet/lib]: Autorequiring File[/var/puppet] debug: /File[/var/puppet/facts]: Autorequiring File[/var/puppet] debug: /File[/etc/puppet/ssl/certs]: Autorequiring File[/etc/puppet/ssl] debug: /File[/var/puppet/log]: Autorequiring File[/var/puppet] debug: /File[/etc/puppet/ssl/certs/ca.pem]: Autorequiring File[/etc/puppet/ssl/certs] debug: /File[/etc/puppet/ssl/private]: Autorequiring File[/etc/puppet/ssl] debug: /File[/etc/puppet/ssl/certificate_requests]: Autorequiring File[/etc/puppet/ssl] debug: /File[/etc/puppet/manifests/site.pp]: Autorequiring File[/etc/puppet/manifests] debug: /File[/var/puppet/yaml]: Autorequiring File[/var/puppet] debug: /File[/etc/puppet/manifests]: Autorequiring File[/etc/puppet] debug: /File[/etc/puppet/ssl/private_keys]: Autorequiring File[/etc/puppet/ssl] debug: /File[/var/puppet/run]: Autorequiring File[/var/puppet] debug: /File[/var/puppet/bucket]: Autorequiring File[/var/puppet] debug: /File[/etc/puppet/ssl/private_keys/vulcan.solnetworks.net.pem]: Autorequiring File[/etc/puppet/ssl/private_keys] debug: /File[/etc/puppet/ssl/crl.pem]: Autorequiring File[/etc/puppet/ssl] debug: /File[/var/puppet/rrd]: Autorequiring File[/var/puppet] debug: /File[/etc/puppet/ssl/certs/vulcan.solnetworks.net.pem]: Autorequiring File[/etc/puppet/ssl/certs] debug: /File[/etc/puppet/ssl/public_keys/vulcan.solnetworks.net.pem]: Autorequiring File[/etc/puppet/ssl/public_keys] debug: /File[/var/puppet/reports]: Autorequiring File[/var/puppet] debug: /File[/etc/puppet/ssl/public_keys]: Autorequiring File[/etc/puppet/ssl] debug: /File[/etc/puppet/ssl]: Autorequiring File[/etc/puppet] debug: /File[/var/puppet/log/masterhttp.log]: Autorequiring File[/var/puppet/log] debug: Finishing transaction -614092538 with 0 changes debug: /File[/etc/puppet/ssl/ca/private/ca.pass]: Autorequiring File[/etc/puppet/ssl/ca/private] debug: /File[/etc/puppet/ssl/ca/ca_crl.pem]: Autorequiring File[/etc/puppet/ssl/ca] debug: /File[/etc/puppet/ssl/ca/ca_crt.pem]: Autorequiring File[/etc/puppet/ssl/ca] debug: /File[/etc/puppet/ssl/ca/private]: Autorequiring File[/etc/puppet/ssl/ca] debug: /File[/etc/puppet/ssl/ca/serial]: Autorequiring File[/etc/puppet/ssl/ca] debug: /File[/etc/puppet/ssl/ca/requests]: Autorequiring File[/etc/puppet/ssl/ca] debug: /File[/etc/puppet/ssl/ca/inventory.txt]: Autorequiring File[/etc/puppet/ssl/ca] debug: /File[/etc/puppet/ssl/ca/ca_pub.pem]: Autorequiring File[/etc/puppet/ssl/ca] debug: /File[/etc/puppet/ssl/ca/ca_key.pem]: Autorequiring File[/etc/puppet/ssl/ca] debug: /File[/etc/puppet/ssl/ca/signed]: Autorequiring File[/etc/puppet/ssl/ca] debug: Finishing transaction -614333248 with 0 changes debug: Using cached certificate for ca, good until Wed Jan 21 23:08:42 UTC 2015 debug: Using cached certificate for ca, good until Wed Jan 21 23:08:42 UTC 2015 debug: Using cached certificate for vulcan.solnetworks.net, good until Wed Jan 21 23:08:42 UTC 2015 notice: Starting Puppet server version 0.25.4 debug: No file server configuration file; autocreating modules mount with default permissions debug: No file server configuration file; autocreating plugins mount with default permissions debug: Creating interpreter debug: Finishing transaction -615169438 with 0 changes debug: Finishing transaction -615171408 with 0 changes
History
Updated by James Turnbull 7 months ago
- Status changed from Unreviewed to Duplicate
Updated by Derek Lewis 7 months ago
[root@vulcan ~]# puppetd —version 0.25.4 [root@vulcan ~]# puppetmasterd —version 0.25.4 [root@vulcan ~]# ruby —version ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-linux]
Test case:
site.pp
[root@vulcan ~]# cat /etc/puppet/manifests/site.pp import “classes/*”
node default {
include foo
}
foo.pp
[root@vulcan ~]# cat /etc/puppet/manifests/classes/foo.pp class foo {
file { "/etc/hosts":
owner => "root",
group => "root",
mode => 644,
}
}
Updated by Derek Lewis 7 months ago
Platform:
[root@vulcan ~]# cat /etc/redhat-release Red Hat Enterprise Linux AS release 3 (Taroon) [root@vulcan ~]# uname -a Linux vulcan 2.4.21-4.EL #1 Fri Oct 3 17:52:56 EDT 2003 i686 athlon i386 GNU/Linux
Updated by Markus Roberts 7 months ago
- Status changed from Duplicate to Investigating
This ticket appear to offer a cleaner route to a fix, so I’m reversing the duplicated/duplicates direction.
Updated by Markus Roberts 7 months ago
- Status changed from Investigating to Needs more information
- Assignee set to Derek Lewis
When I try this in as close the same environment as I can at the moment, it works. Is there anything in you puppet.conf that may be of interest, are you doing anything with clever links or mounts in your puppet directories, or are there any other items that you can think of that might shed some light on this?
Updated by Derek Lewis 7 months ago
- Assignee deleted (
Derek Lewis)
Had an issue with name resolution on this system. The system was setup with a different IP than what the DNS A and PTR specified. In any case, ruby 1.8.7p72 generated a trace that contained a getaddrinfo error, which tipped me off. p286 generates the trace pasted above. puppet’s exception handling for getaddrinfo could probably be handled better, but I think this can be closed now.
Updated by Markus Roberts 7 months ago
- Assignee set to Derek Lewis
Derek —
Just to clarify: did fixing the DNS resolve the issue (you no longer get the “undefined method `closed?‘ for nil:NilClass” error)?
— Markus
Updated by Derek Lewis 7 months ago
Markus,
Yes, that’s correct. Thanks for looking at it, anyway.
Regards
Updated by Markus Roberts 7 months ago
- Subject changed from undefined method `closed?' for nil:NilClass to Unhelpful message "undefined method `closed?' for nil:NilClass" when DNS misconfigured
- Category set to error reporting
- Status changed from Needs more information to Investigating
- Priority changed from High to Normal
- Target version set to 0.25.5
Derek —
Thanks for you help clarifying this issue.
— Markus
Updated by Markus Roberts 7 months ago
- Status changed from Investigating to Closed
Updated by martin krafft 6 months ago
- File trace.gz added
- Status changed from Closed to Re-opened
- Affected version changed from 0.25.4rc2 to 0.25.4
Just need to chime in: I am trying to set up puppetmaster&puppet on my laptop for easy offline hacking, and I am running into the same problem, in addition to two other weird errors that seem related (+trace attached):
# puppetd --no-daemonize --onetime --verbose err: Could not retrieve catalog from remote server: undefined method `closed?' for nil:NilClass notice: Using cached catalog info: Applying configuration version '1268237961' err: //puppet/File[/etc/default/puppet]: Failed to retrieve current state of resource: undefined method `closed?' for nil:NilClass Could not retrieve file metadata for puppet:///modules/puppet/etc_default_puppet: undefined method `closed?' for nil:NilClass at /etc/puppet/modules/puppet/manifests/init.pp:75 err: //puppet::server/File[/etc/puppet/auth.conf]: Failed to retrieve current state of resource: undefined method `closed?' for nil:NilClass Could not retrieve file metadata for puppet:///modules/puppet/auth.conf: undefined method `closed?' for nil:NilClass at /etc/puppet/modules/puppet/manifests/server.pp:75 notice: //puppet/Service[puppet]: Dependency file[/etc/default/puppet] has 1 failures warning: //puppet/Service[puppet]: Skipping because of failed dependencies notice: Finished catalog run in 0.63 seconds
The configuration is identical to what’s running on puppetmaster.madduck.net, where everything is working fine.
I specifically configured DNS to make everything work backwards and forwards:
% facter fqdn lapse.rw.madduck.net % dig @localhost +short a lapse.rw.madduck.net 127.0.0.1 % dig @localhost +short -x 127.0.0.1 lapse.rw.madduck.net. localhost. % dig @localhost +short a localhost 127.0.0.1
Therefore, DNS cannot be the real cause of this problem, right?
PS: the WYSIWIG markup editor is useless and doesn’t let me do pre-formatted text. Sorry about that.
Updated by James Turnbull 6 months ago
Just use < pre > and < /pre> tags. Works fine for me. I’ve updated your entry.
Updated by martin krafft 6 months ago
I found my problem with ruby debug mode. Running puppetd with ruby —debug is enlightening (“there is other code out there that generates more warnings than my own!”), but it did include this gem (not sure whether pun intended):
Exception `OpenSSL::SSL::SSLError' at /usr/lib/ruby/1.8/openssl/ssl.rb:123 - hostname was not match with the server certificate
Sure thing, once I started connecting to the proper hostname (which still resolves to localhost), everything was fine.
Updated by martin krafft 6 months ago
I think it would make sense to convert this bug report into a wishlist requesting better error reporting.
Updated by James Turnbull 6 months ago
So the fix for young players was specifying in puppet.conf:
server=f.q.d.n
Concur with Martin on error reporting.
Updated by Brian Keifer 6 months ago
I can also reproduce the SSL error Martin got, but when using my fqdn as the server name, I still get the following. It happens randomly for anywhere from none to all of my file definitions:
info: Applying configuration version '1268253124'
debug: file_metadata supports formats: b64_zlib_yaml marshal pson raw yaml; using pson
Exception `Errno::ECONNRESET' at /usr/local/lib/ruby/1.8/openssl/buffering.rb:237 - Connection reset by peer
Exception `Errno::ECONNRESET' at /usr/local/lib/ruby/1.8/net/http.rb:1061 - Connection reset by peer
Exception `NoMethodError' at /usr/local/lib/ruby/1.8/net/http.rb:1060 - undefined method `closed?' for nil:NilClass
Exception `Puppet::Error' at /usr/local/lib/ruby/gems/1.8/gems/puppet-0.25.4/lib/puppet/parameter.rb:401 - undefined method `closed?' for nil:NilClass Could not retrieve file metadata for puppet:///modules/inspircd/inspircd.conf: undefined method `closed?' for nil:NilClass at /home/puppetmaster/conf/modules/inspircd/manifests/init.pp:8
err: //inspircd/File[/home/procrast/inspircd/conf/inspircd.conf]: Failed to retrieve current state of resource: undefined method `closed?' for nil:NilClass Could not retrieve file metadata for puppet:///modules/inspircd/inspircd.conf: undefined method `closed?' for nil:NilClass at /home/puppetmaster/conf/modules/inspircd/manifests/init.pp:8
This only happens when making a connection to a puppetmasterd on the same machine as the puppetd. Clients on other machines have zero problems.
Updated by Markus Roberts 5 months ago
For reference: This is a known bug in 1.8.7. See: http://redmine.ruby-lang.org/issues/show/2708
Updated by Markus Roberts 5 months ago
- Status changed from Re-opened to Ready for Testing
- Branch set to git@github.com:MarkusQ/puppet.git ticket/0.25.x/3101
Updated by James Turnbull 5 months ago
- Status changed from Ready for Testing to Closed
Fixes issue for me also + Jesse.
Pushing in commit:“ae0b0bf23e418e8c6665e9dc135148b78bdbd913” in branch 0.25.x