mitchellh/vagrant — Issue #788: Exception when downloading box and no content-length HTTP header
Author: dansimau
Created: 2012-03-09 11:08:55+00:00
State: open

When doing `vagrant up` where the Vagrantfile specifies a URL to a box that is not present on the system, Vagrant retrieves and imports the box from the URL in the Vagrantfile.

Vagrant makes a HTTP request to the box URL and uses the HTTP `content-length` header from the response to show the download progress.

However, If no content-length header is present, a FloatDomainError exception is thrown and Vagrant terminates:

from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/ui.rb:74:in `report_progress'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/downloaders/http.rb:59:in `download!'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/protocol.rb:383:in `call_block'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/protocol.rb:374:in `<<'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/protocol.rb:84:in `read'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:2236:in `read_chunked'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:2211:in `read_body_0'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:2177:in `read_body'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/downloaders/http.rb:50:in `download!'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1053:in `request'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:2140:in `reading_body'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1052:in `request'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:948:in `request_get'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/downloaders/http.rb:36:in `download!'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:543:in `start'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/downloaders/http.rb:28:in `download!'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/box/download.rb:79:in `download_to'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/box/download.rb:56:in `download'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/box/download.rb:70:in `with_tempfile'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/box/download.rb:69:in `open'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/box/download.rb:69:in `with_tempfile'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/box/download.rb:55:in `download'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/box/download.rb:22:in `call'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/warden.rb:33:in `call'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/general/check_virtualbox.rb:23:in `call'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/warden.rb:33:in `call'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/builder.rb:92:in `call'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/runner.rb:49:in `run'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/util/busy.rb:19:in `busy'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/runner.rb:49:in `run'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/box_collection.rb:38:in `add'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/vm/check_box.rb:20:in `call'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/warden.rb:33:in `call'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/vm/check_accessible.rb:18:in `call'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/warden.rb:33:in `call'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/general/validate.rb:13:in `call'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/warden.rb:33:in `call'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/general/check_virtualbox.rb:23:in `call'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/warden.rb:33:in `call'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/builder.rb:92:in `call'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/runner.rb:49:in `run'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/util/busy.rb:19:in `busy'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/action/runner.rb:49:in `run'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/vm.rb:192:in `run_action'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/vm.rb:145:in `up'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/command/up.rb:46:in `execute'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/command/base.rb:106:in `with_target_vms'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/command/base.rb:101:in `each'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/command/base.rb:101:in `with_target_vms'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/command/up.rb:39:in `execute'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/cli.rb:38:in `execute'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/lib/vagrant/environment.rb:163:in `cli'
from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.0/bin/vagrant:43
from /usr/bin/vagrant:19:in `load'
from /usr/bin/vagrant:19