More problems with remote_file


Chronological Thread 
  • From: Jeppe Nejsum Madsen <jeppe@ingolfs.dk>
  • To: chef@lists.opscode.com
  • Subject: More problems with remote_file
  • Date: Mon, 8 Jun 2009 19:16:35 +0200

Hi,

I seem to occasionally get some errors with remote_file when running chef-solo. It is not consistently reproducible, but seems to occur when I rerun a chef-solo command and the target file already exists.

This is the stack trace:

Mon, 08 Jun 2009 18:16:20 +0200] DEBUG: /helloworld-1.war 100% done (7565054 of 7565054)
[Mon, 08 Jun 2009 18:16:20 +0200] ERROR: remote_file[test3] (/var/lib/ gems/1.8/gems/chef-0.6.2/lib/chef/recipe.rb line 187) had an error:
closed stream
/var/lib/gems/1.8/gems/chef-0.6.2/lib/chef/provider/remote_file.rb: 76:in `close'/var/lib/gems/1.8/gems/chef-0.6.2/lib/chef/provider/ remote_file.rb:76:in `do_remote_file'/var/lib/gems/1.8/gems/chef-0.6.2/ lib/chef/provider/remote_file.rb:34:in `action_create'/var/lib/gems/ 1.8/gems/chef-0.6.2/lib/chef/runner.rb:87:in `send'/var/lib/gems/1.8/ gems/chef-0.6.2/lib/chef/runner.rb:87:in `converge'/var/lib/gems/1.8/ gems/chef-0.6.2/lib/chef/runner.rb:85:in `each'/var/lib/gems/1.8/gems/ chef-0.6.2/lib/chef/runner.rb:85:in `converge'/var/lib/gems/1.8/gems/ chef-0.6.2/lib/chef/resource_collection.rb:58:in `each'/var/lib/gems/ 1.8/gems/chef-0.6.2/lib/chef/resource_collection.rb:57:in `each'/var/ lib/gems/1.8/gems/chef-0.6.2/lib/chef/runner.rb:63:in `converge'/var/ lib/gems/1.8/gems/chef-0.6.2/lib/chef/client.rb:348:in `converge'/var/ lib/gems/1.8/gems/chef-0.6.2/lib/chef/client.rb:96:in `run_solo'/var/ lib/gems/1.8/gems/chef-0.6.2/bin/chef-solo:118/sbin/chef-solo:19:in `load'/sbin/chef-solo:19
/var/lib/gems/1.8/gems/chef-0.6.2/lib/chef/provider/remote_file.rb: 76:in `close': closed stream (IOError)
from /var/lib/gems/1.8/gems/chef-0.6.2/lib/chef/provider/ remote_file.rb:76:in `do_remote_file'
from /var/lib/gems/1.8/gems/chef-0.6.2/lib/chef/provider/ remote_file.rb:34:in `action_create'
        from /var/lib/gems/1.8/gems/chef-0.6.2/lib/chef/runner.rb:87:in `send'
from /var/lib/gems/1.8/gems/chef-0.6.2/lib/chef/runner.rb:87:in `converge'
        from /var/lib/gems/1.8/gems/chef-0.6.2/lib/chef/runner.rb:85:in `each'
from /var/lib/gems/1.8/gems/chef-0.6.2/lib/chef/runner.rb:85:in `converge'
from /var/lib/gems/1.8/gems/chef-0.6.2/lib/chef/ resource_collection.rb:58:in `each'
from /var/lib/gems/1.8/gems/chef-0.6.2/lib/chef/ resource_collection.rb:57:in `each'
from /var/lib/gems/1.8/gems/chef-0.6.2/lib/chef/runner.rb:63:in `converge'
from /var/lib/gems/1.8/gems/chef-0.6.2/lib/chef/client.rb:348:in `converge'
from /var/lib/gems/1.8/gems/chef-0.6.2/lib/chef/client.rb:96:in `run_solo'
        from /var/lib/gems/1.8/gems/chef-0.6.2/bin/chef-solo:118
        from /sbin/chef-solo:19:in `load'
        from /sbin/chef-solo:19


I'm not a ruby guy, but took a quick look at the code (chef 0.6.2) and at a first glance it seems that the filehandle may be closed twice (rest.rb:189) and in remote_file:76. But if this is true, why doesn't it always fail?

/Jeppe



Archive powered by MHonArc 2.6.16.

§