流量调配失败,关闭流(IOError)

时间:2012-07-30 07:13:57

标签: chef puppet vagrant

在Mac OS X上尝试按照Vagrant教程配置厨师时,我收到以下错误。如果我使用木偶代替,则会出现同样的问题,如果我使用lucid32,则会出现同样的问题。帮助

[default] Importing base box 'lucid64'...
[default] The guest additions on this VM do not match the install version of
VirtualBox! This may cause things such as forwarded ports, shared
folders, and more to not work properly. If any of those things fail on
this machine, please update the guest additions and repackage the
box.

Guest Additions Version: 4.1.16
VirtualBox Version: 4.1.18
[default] Matching MAC address for NAT networking...
[default] Clearing any previously set forwarded ports...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Mounting shared folders...
[default] -- v-root: /vagrant
[default] Running provisioner: Vagrant::Provisioners::ChefSolo...
[default] Generating chef JSON and uploading...
[default] Running chef-solo...
stdin: is not a tty
[Mon, 30 Jul 2012 08:55:18 +0200] INFO: *** Chef 0.10.10 ***
[Mon, 30 Jul 2012 08:55:18 +0200] INFO: Setting the run_list to ["recipe[vagrant_main]"] from JSON
[Mon, 30 Jul 2012 08:55:18 +0200] INFO: Run List is [recipe[vagrant_main]]
[Mon, 30 Jul 2012 08:55:18 +0200] INFO: Run List expands to [vagrant_main]
[Mon, 30 Jul 2012 08:55:18 +0200] INFO: Starting Chef Run for lucid64
[Mon, 30 Jul 2012 08:55:18 +0200] INFO: Running start handlers
[Mon, 30 Jul 2012 08:55:18 +0200] INFO: Start handlers complete.
[Mon, 30 Jul 2012 08:55:18 +0200] INFO: Processing execute[apt-get update] action run (apt::default line 20)
[default] Destroying VM and associated drives...
/Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/ruby_compat.rb:33:in `select': closed stream (IOError)
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/ruby_compat.rb:33:in `io_select'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/ruby_compat.rb:32:in `synchronize'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/ruby_compat.rb:32:in `io_select'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/transport/packet_stream.rb:73:in `available_for_read?'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/transport/packet_stream.rb:85:in `next_packet'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/transport/session.rb:171:in `poll_message'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/transport/session.rb:166:in `loop'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/transport/session.rb:166:in `poll_message'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/connection/session.rb:451:in `dispatch_incoming_packets'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/connection/session.rb:213:in `preprocess'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/connection/session.rb:197:in `process'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/connection/session.rb:161:in `loop'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/connection/session.rb:161:in `loop_forever'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/connection/session.rb:161:in `loop'
    from /Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/connection/channel.rb:269:in `wait'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/communication/ssh.rb:213:in `shell_execute'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/communication/ssh.rb:53:in `execute'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/communication/ssh.rb:110:in `connect'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/communication/ssh.rb:52:in `execute'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/communication/ssh.rb:72:in `sudo'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/provisioners/chef_solo.rb:196:in `run_chef_solo'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/provisioners/chef_solo.rb:189:in `times'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/provisioners/chef_solo.rb:189:in `run_chef_solo'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/provisioners/chef_solo.rb:96:in `provision!'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/provision.rb:34:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/provision.rb:31:in `each'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/provision.rb:31:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/forward_ports.rb:24:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/check_port_collisions.rb:42:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/env/set.rb:16:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/clear_forwarded_ports.rb:13:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/clean_machine_folder.rb:17:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/check_accessible.rb:18:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/general/validate.rb:13:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/general/check_virtualbox.rb:23:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/match_mac_address.rb:16:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/default_name.rb:17:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/check_guest_additions.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/import.rb:31:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/check_box.rb:28:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/vm/check_accessible.rb:18:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/general/validate.rb:13:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/general/check_virtualbox.rb:23:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/builder.rb:92:in `call'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/runner.rb:49:in `run'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/util/busy.rb:19:in `busy'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/action/runner.rb:49:in `run'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/vm.rb:192:in `run_action'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/vm.rb:145:in `up'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/command/up.rb:31:in `execute'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/command/base.rb:116:in `with_target_vms'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/command/base.rb:111:in `each'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/command/base.rb:111:in `with_target_vms'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/command/up.rb:24:in `execute'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/cli.rb:42:in `execute'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/lib/vagrant/environment.rb:167:in `cli'
    from /Library/Ruby/Gems/1.8/gems/vagrant-1.0.3/bin/vagrant:43
    from /usr/bin/vagrant:23:in `load'
    from /usr/bin/vagrant:23

2 个答案:

答案 0 :(得分:2)

https://github.com/mitchellh/vagrant/issues/516

有一张开放式门票

对我有用的是:

  1. 已更新至 VirtualBox 4.1.20 (来自在Ubuntu 12.04主机上运行的4.1.18)
  2. 更新了所有宝石(我使用rbenv。值得注意的是我的 net-ssh 宝石已过时)
  3. 使用https://github.com/jedi4ever/veewee/blob/master/doc/vagrant.md
  4. 上的说明创建了新的basebox

    我不再遇到“封闭流(IOError)”问题,可以在没有任何问题的情况下进行多VM流浪汉部署。

答案 1 :(得分:0)

请参阅:https://github.com/dcarley/vbox_natbug

config.vm.define :ubuntu_amd do |c|
  c.vm.box = "lucid64"
  c.vm.customize(["modifyvm", :id, "--nictype1", "Am79C973"])
end

也许它可以帮助...