Issue #4922 has been updated by Markus Roberts.

Hmmm.

I started out agreeing with Brice, but after thinking about it a bit I'm 
leaning towards Nico's position.  We fixed the cause for these particular 404 
errors, but didn't address the bigger question of what the client ought to do 
should an error occur fetching the content.  

404 is the only error response that doesn't raise an exception:

<pre>
    def chunk_file_from_source(source_or_content)
      request = Puppet::Indirector::Request.new(:file_content, :find, 
source_or_content.full_path.sub(/^\//,''))
      connection = 
Puppet::Network::HttpPool.http_instance(source_or_content.server, 
source_or_content.port)
      connection.request_get(indirection2uri(request), 
add_accept_encoding({"Accept" => "raw"})) do |response|
        case response.code
        when "404"; nil
        when /^2/;  uncompress(response) { |uncompressor| response.read_body { 
|chunk| yield uncompressor.uncompress(chunk) } }
        else
          # Raise the http error if we didn't get a 'success' of some kind.
          message = "Error #{response.code} on SERVER: 
#{(response.body||'').empty? ? response.message : uncompress_body(response)}"
          raise Net::HTTPError.new(message, response)
        end
      end
    end
</pre>

but there are various other reasons that a 404 might occur (dns snafus anyone?) 
and nulling the files in such cases seems suboptimal.  Is there a reason we are 
silently absorbing 404s?

----------------------------------------
Bug #4922: Puppetd creates empty files, if it gets a 404
http://projects.puppetlabs.com/issues/4922

Author: Nico Schottelius
Status: Needs more information
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected version: 2.6.0
Keywords: 
Branch: 


bFull report can be found at 
http://www.nico.schottelius.org/blog/puppet-empties-new-and-existing-files/


-- 
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://projects.puppetlabs.com/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