hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.27k stars 4.43k forks source link

ERROR warden: Error occurred: not opened for reading #1212

Closed johntdyer closed 11 years ago

johntdyer commented 11 years ago

any idea what this is about? I get it when I run

vagrant up

The basic exception is as follows:

DEBUG ssh: Exit status: 0
 INFO interface: info: Generating chef JSON and uploading...
[default] Generating chef JSON and uploading...
ERROR warden: Error occurred: not opened for reading
ERROR warden: Error occurred: not opened for reading
ERROR warden: Error occurred: not opened for reading
ERROR warden: Error occurred: not opened for reading
ERROR warden: Error occurred: not opened for reading
ERROR warden: Error occurred: not opened for reading
ERROR warden: Error occurred: not opened for reading
ERROR warden: Error occurred: not opened for reading
ERROR warden: Error occurred: not opened for reading
ERROR warden: Error occurred: not opened for reading
ERROR warden: Error occurred: not opened for reading
ERROR warden: Error occurred: not opened for reading
/Users/jdyer/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/json/encoding.rb:207:in `each': not opened for reading (IOError)
    from /Users/jdyer/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/json/encoding.rb:207:in `to_a'
    from /Users/jdyer/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/json/encoding.rb:207:in `as_json'
    from /Users/jdyer/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/json/encoding.rb:55:in `block in as_json'

My VagrantFile is:

require 'berkshelf/vagrant'

Vagrant::Config.run do |config|

  config.vm.host_name = "tropo-gateway.local"

  config.vm.forward_port 8080, 18080

  config.vm.network :hostonly, "192.168.56.100"

  # CentOS 6.3
  config.vm.box         =  "Berkshelf-CentOS-6.3-x86_64-minimal"
  config.vm.box_url     =  "https://dl.dropbox.com/u/31081437/Berkshelf-CentOS-6.3-x86_64-minimal.box"

  config.ssh.max_tries  =  40
  config.ssh.timeout    =  120

  config.vm.provision :chef_solo do |chef|
    chef.provisioning_path = "/var/chef/cache"
    chef.log_level = :debug
    chef.json = {}
    chef.run_list = ["recipe[base]"]
  end

end

The full failure logs can be found below: https://gist.github.com/cf3d2f612c7d18bfab11

mitchellh commented 11 years ago

I think I talked to you in IRC?

Anyways, the fix is to gem uninstall vagrant and then use the installer. ActiveSupport is screwing you up.

johntdyer commented 11 years ago

Yea, this is still an issue for me because a gem I am using pulls in Vagrant every time I run bundler. Still trying to work that out

sneal commented 11 years ago

I'm having the same problem. I'm trying to use Berkshelf RC1 with Vagrant and the documented Berkshelf workflow wants to use the vagrant gem.

bundle install bundle exec vagrant up

...which installs the Vagrant 1.0.5 gem. Is this an activesupport problem or can vagrant be patched to fix this or ??

sneal commented 11 years ago

I think I understand the problem better now. Its an issue with Berkshelf using ActiveSupport which they already fixed.

https://github.com/RiotGames/berkshelf/issues/193

reset commented 11 years ago

@mitchellh why are you suggesting that users do not install Vagrant by gem?

Berkshelf is a dependency resolver for Chef and it integrates with Vagrant by an included plugin. We have a dependency on Vagrant to ensure that the plugin is running against a known version of Vagrant and installing by installer would mean this dependency would no longer be pinned.