Bug #9941

REST API indirection should be more specific when a host cannot be reached

Added by Jeff McCune 8 months ago. Updated 8 months ago.

Status:Accepted Start date:10/06/2011
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:usability
Target version:2.7.x
Affected Puppet version:2.7.0 Branch:https://github.com/jeffmccune/puppet/tree/ticket/master/9941_rest_api_indirection_should_be_more_specific_when_a_host_cannot_be_reached
Keywords:indirection, exception, error
Votes: 1

Description

Overview

(For Jeff – Shave this Yak)

This exception seems wrong to me. It’s not a FormatError but rather a network reachability issue.

Puppet::Network::FormatHandler::FormatError: Could not render to pson: getaddrinfo: Name or service not known
        from /opt/puppet/lib/ruby/1.8/net/http.rb:560:in `initialize'
        from /opt/puppet/lib/ruby/1.8/net/http.rb:560:in `open'
        from /opt/puppet/lib/ruby/1.8/net/http.rb:560:in `connect'
        from /opt/puppet/lib/ruby/1.8/timeout.rb:67:in `timeout'
        from /opt/puppet/lib/ruby/1.8/timeout.rb:101:in `timeout'
        from /opt/puppet/lib/ruby/1.8/net/http.rb:560:in `connect'
        from /opt/puppet/lib/ruby/1.8/net/http.rb:553:in `do_start'
        from /opt/puppet/lib/ruby/1.8/net/http.rb:542:in `start'
        from /opt/puppet/lib/ruby/1.8/net/http.rb:1035:in `request'
        from /opt/puppet/lib/ruby/1.8/net/http.rb:772:in `get'
        from /opt/puppet/lib/site_ruby/1.8/puppet/indirector/rest.rb:94:in `send'
        from /opt/puppet/lib/site_ruby/1.8/puppet/indirector/rest.rb:94:in `http_request'
        from /opt/puppet/lib/site_ruby/1.8/puppet/indirector/rest.rb:76:in `http_get'
        from /opt/puppet/lib/site_ruby/1.8/puppet/indirector/rest.rb:118:in `find'
        from /opt/puppet/lib/site_ruby/1.8/puppet/indirector/certificate/rest.rb:11:in `find'
        from /opt/puppet/lib/site_ruby/1.8/puppet/indirector/indirection.rb:189:in `find'
        from /opt/puppet/lib/site_ruby/1.8/puppet/ssl/host.rb:243:in `to_pson'
        from /opt/puppet/lib/site_ruby/1.8/puppet/network/format.rb:67:in `send'
        from /opt/puppet/lib/site_ruby/1.8/puppet/network/format.rb:67:in `render'
        from /opt/puppet/lib/site_ruby/1.8/puppet/network/format_handler.rb:12:in `send'
        from /opt/puppet/lib/site_ruby/1.8/puppet/network/format_handler.rb:12:in `protect'
        from /opt/puppet/lib/site_ruby/1.8/puppet/network/format_handler.rb:26:in `render'
        from /opt/puppet/lib/site_ruby/1.8/puppet/network/format_handler.rb:166:in `render'
        from /opt/puppet/lib/site_ruby/1.8/puppet/indirector/rest.rb:152:in `save'
        from /opt/puppet/lib/site_ruby/1.8/puppet/indirector/indirection.rb:265:in `save'
        from /vagrant/src_pe_only/envpuppet/cloud-provisioner/lib/puppet/cloudpack.rb:677:in `attempt_to_sign_certificate'

History

Updated by Daniel Pittman 8 months ago

  • Status changed from Needs More Information to Accepted
  • Target version set to 2.7.x

Should be fixed, indeed.

Updated by Jeff McCune 8 months ago

Tracing this down it appears that puppet/network/format_handler.rb is masking the underlying network connectivity exception.

  5 module Puppet::Network::FormatHandler
  6   class FormatError < Puppet::Error; end
  7 
  8   class FormatProtector
  9     attr_reader :format
 10   
 11     def protect(method, args)
 12         Puppet::Network::FormatHandler.format(format).send(method, *args)
 13     rescue => details
 14         direction = method.to_s.include?("intern") ? "from" : "to"
 15         error = FormatError.new("Could not #{method} #{direction} #{format}: #{details}")
 16         error.set_backtrace(details.backtrace)
 17         raise error
 18     end

I’ll take care of this ticket.

Updated by Jeff McCune 8 months ago

  • Assignee deleted (Jeff McCune)
  • Branch set to https://github.com/jeffmccune/puppet/tree/ticket/master/9941_rest_api_indirection_should_be_more_specific_when_a_host_cannot_be_reached

Shelving

For the time being.

Also available in: Atom PDF