Issue #2516 has been updated by Brice Figureau.

Status changed from Ready for Testing to Ready for Checkin
Assigned to changed from Brice Figureau to James Turnbull

Approved and correct this time :-)
----------------------------------------
Bug #2516: Client startup failure with 0.25.0rc1/Passenger
http://projects.reductivelabs.com/issues/2516

Author: John A. Barbuto
Status: Ready for Checkin
Priority: Normal
Assigned to: James Turnbull
Category: network
Target version: 0.25.0
Complexity: Trivial
Affected version: 0.25.0rc1
Keywords: 


My freshly installed 0.25.0rc1 client running against a 
0.25.0rc1/Passenger2.2.2 server was terminating silently after startup.  Doing 
an strace of puppetd turned up this error:

<pre>
/usr/lib/ruby/site_ruby/1.8/puppet/network/format_handler.rb:89:in 
`format_to_canonical_name'
undefined method `name' for nil:NilClass
NoMethodError
from /usr/lib/ruby/site_ruby/1.8/puppet/network/format_handler.rb:68:in 
`protected_format'
from /usr/lib/ruby/site_ruby/1.8/puppet/network/format_handler.rb:99:in 
`convert_from'
from /usr/lib/ruby/site_ruby/1.8/puppet/indirector/rest.rb:48:in `deserialize'
from /usr/lib/ruby/site_ruby/1.8/puppet/indirector/rest.rb:67:in `find'
from /usr/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:198:in `find'
from /usr/lib/ruby/site_ruby/1.8/puppet/indirector.rb:51:in `find'
from /usr/lib/ruby/site_ruby/1.8/puppet/ssl/host.rb:174:in `certificate'
from /usr/lib/ruby/site_ruby/1.8/puppet/ssl/host.rb:238:in `wait_for_cert'
from /usr/lib/ruby/site_ruby/1.8/puppet/application/puppetd.rb:243:in 
`run_setup'
from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:216:in `run'
from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:306:in `exit_on_fail'
from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:216:in `run'
from /usr/sbin/puppetd:159
</pre>

This wasn't happening with WEBrick, so I added some debugging output on the 
client to try to discern the difference, in this spot:

http://github.com/reductivelabs/puppet/blob/1e83aadc749aea9d52281d4f4041f6144a7229c7/lib/puppet/network/format_handler.rb#L79

At the time the client failed with Passenger, the @format@ variable was 
_"text/plain; charset=UTF-8"_, but when it worked with WEBrick, it was just 
_"text/plain"_.   I suspected the charset was the problem, so I removed it with 
this patch:

<pre>
--- a/lib/puppet/network/format_handler.rb
+++ b/lib/puppet/network/format_handler.rb
@@ -59,6 +59,8 @@ module Puppet::Network::FormatHandler
     # Return a format capable of handling the provided mime type.
     def self.mime(mimetype)
         mimetype = mimetype.to_s.downcase
+        # we only want the mime type, not the charset or anything else
+        mimetype = mimetype.split(';')[0]
         @formats.values.find { |format| format.mime == mimetype }
     end
 
</pre>

This indeed fixed the problem.  Please consider this fix for us Passenger 
users. :)

Also, I may be wrong, but you might want to patch this empty @when@ statement 
here:

<pre>
--- a/lib/puppet/network/format_handler.rb
+++ b/lib/puppet/network/format_handler.rb
@@ -81,7 +83,7 @@ module Puppet::Network::FormatHandler
             out = format
         when %r{\w+/\w+}
             out = mime(format)
-        when
+        else
             out = format(format)
         end
         out.name
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to