The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Bug #3101

Unhelpful message "undefined method `closed?' for nil:NilClass" when DNS misconfigured

Added by Derek Lewis over 6 years ago. Updated about 6 years ago.

Status:ClosedStart date:01/23/2010
Priority:NormalDue date:
Assignee:Derek Lewis% Done:

0%

Category:error reporting
Target version:0.25.5
Affected Puppet version:0.25.4 Branch:git@github.com:MarkusQ/puppet.git ticket/0.25.x/3101
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com


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

trace.gz (2.26 KB) martin krafft, 03/10/2010 05:42 pm


Related issues

Duplicated by Puppet - Bug #3041: undefined method `name=' for #<Puppet::FileServing::Conte... Closed 01/12/2010
Duplicated by Puppet - Bug #3083: Failed to retrieve current state of resource: undefined m... Closed 01/17/2010

History

#1 Updated by James Turnbull over 6 years ago

  • Status changed from Unreviewed to Duplicate

Duplicates #3083.

Can you update that ticket with:

  • Platform
  • Ruby version

#2 Updated by Derek Lewis over 6 years 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,
    }

}

#3 Updated by Derek Lewis over 6 years 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

#4 Updated by Markus Roberts over 6 years 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.

#5 Updated by Markus Roberts over 6 years 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?

#6 Updated by Derek Lewis over 6 years 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.

#7 Updated by Markus Roberts over 6 years 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

#8 Updated by Derek Lewis over 6 years ago

Markus,

Yes, that’s correct. Thanks for looking at it, anyway.

Regards

#9 Updated by Markus Roberts over 6 years 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

#10 Updated by Markus Roberts about 6 years ago

  • Status changed from Investigating to Closed

#11 Updated by martin krafft about 6 years ago

  • File trace.gz added
  • Status changed from Closed to Re-opened
  • Affected Puppet 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.

#12 Updated by James Turnbull about 6 years ago

Just use < pre > and < /pre> tags. Works fine for me. I’ve updated your entry.

#13 Updated by martin krafft about 6 years 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.

#14 Updated by martin krafft about 6 years ago

I think it would make sense to convert this bug report into a wishlist requesting better error reporting.

#15 Updated by James Turnbull about 6 years ago

So the fix for young players was specifying in puppet.conf:

server=f.q.d.n

Concur with Martin on error reporting.

#16 Updated by Brian Keifer about 6 years 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.

#17 Updated by Markus Roberts about 6 years ago

For reference: This is a known bug in 1.8.7. See: http://redmine.ruby-lang.org/issues/show/2708

#18 Updated by Markus Roberts about 6 years ago

  • Status changed from Re-opened to In Topic Branch Pending Review
  • Branch set to git@github.com:MarkusQ/puppet.git ticket/0.25.x/3101

#19 Updated by James Turnbull about 6 years ago

  • Status changed from In Topic Branch Pending Review to Closed

Fixes issue for me also + Jesse.

Pushing in commit:ae0b0bf23e418e8c6665e9dc135148b78bdbd913 in branch 0.25.x

Also available in: Atom PDF