[chef] Re: Re: Problem with remote_file downloading?


Chronological Thread 
  • From: Ash Berlin < >
  • To:
  • Subject: [chef] Re: Re: Problem with remote_file downloading?
  • Date: Wed, 8 Sep 2010 10:40:17 +0100

n 8 Sep 2010, at 03:38, Joshua Miller wrote:
Can you wget or curl the file? 

curl -O works fine.

Its using ubuntu's system ruby, specifically  1.8.7.249-2

ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]

And I'm using the apt packages for chef - 0.9.8+dfsg

And yes this is reproduceable ever time on my server right now. The remote_file block is:

 remote_file "#{rvm_path}/src/rvm-#{ver}.tar.gz" do
   owner "rvm"
   group "rvm"
   mode 0644
   source "http://rvm.beginrescueend.com/releases/rvm-#{ver}.tar.gz"

   not_if do
     begin
       require "#{rvm_path}/lib/rvm/version.rb"
       RVM::Version::STRING == ver
     rescue Exception
       false
     end
   end
 end

ver in this case is "1.0.5"

Okay. I manually fixed the bug in net/http. The problem is the destination directory doesn't exist. Given that chef papers over any exception that happens in the processing block one step of the chef functions needs to rescue the exception and handle it more gracefully.

/usr/lib/ruby/1.8/fileutils.rb:1263:in `initialize': No such file or directory - /opt/rvm/src/rvm-1.0.5.tar.gz (Errno::ENOENT)
from /usr/lib/ruby/1.8/fileutils.rb:1263:in `open'
from /usr/lib/ruby/1.8/fileutils.rb:1263:in `copy_file'
from /usr/lib/ruby/1.8/fileutils.rb:1262:in `open'
from /usr/lib/ruby/1.8/fileutils.rb:1262:in `copy_file'
from /usr/lib/ruby/1.8/fileutils.rb:463:in `copy_file'
from /usr/lib/ruby/1.8/fileutils.rb:383:in `cp'
from /usr/lib/ruby/1.8/fileutils.rb:1396:in `fu_each_src_dest'
from /usr/lib/ruby/1.8/fileutils.rb:1412:in `fu_each_src_dest0'
from /usr/lib/ruby/1.8/fileutils.rb:1394:in `fu_each_src_dest'
from /usr/lib/ruby/1.8/fileutils.rb:382:in `cp'
from /usr/lib/ruby/1.8/chef/provider/remote_file.rb:49:in `action_create'
from /usr/lib/ruby/1.8/chef/rest.rb:135:in `fetch'
from /usr/lib/ruby/1.8/chef/rest.rb:249:in `streaming_request'
from /usr/lib/ruby/1.8/chef/rest/rest_request.rb:62:in `call'
from /usr/lib/ruby/1.8/net/http.rb:1053:in `request'
from /usr/lib/ruby/1.8/net/http.rb:2140:in `reading_body'
from /usr/lib/ruby/1.8/net/http.rb:1052:in `request'
from /usr/lib/ruby/1.8/net/http.rb:1037:in `request'
from /usr/lib/ruby/1.8/net/http.rb:543:in `start'
from /usr/lib/ruby/1.8/net/http.rb:1035:in `request'
from /usr/lib/ruby/1.8/chef/rest/rest_request.rb:60:in `call'
from /usr/lib/ruby/1.8/chef/rest/rest_request.rb:75:in `hide_net_http_bug'
from /usr/lib/ruby/1.8/chef/rest/rest_request.rb:59:in `call'
from /usr/lib/ruby/1.8/chef/rest.rb:245:in `streaming_request'
from /usr/lib/ruby/1.8/chef/rest.rb:280:in `retriable_rest_request'
from /usr/lib/ruby/1.8/chef/rest.rb:243:in `streaming_request'
from /usr/lib/ruby/1.8/chef/rest.rb:135:in `fetch'
from /usr/lib/ruby/1.8/chef/provider/remote_file.rb:43:in `action_create'



Archive powered by MHonArc 2.6.16.

§