Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when running 'vagrant up' -- Too many open files - getcwd (Errno::EMFILE)

I have a very basic Vagrantfile, and when I call 'vagrant up' for the first time (after destroying the box) I get the error below just about every time. Any ideas why? I'm at a loss. I'm on OSX.

Vagrantfile:

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.hostname = "myapp-berkshelf"
  config.vm.box = "precise64_provisioned"
  config.vm.box_url = "http://dl.dropbox.com/u/1537815/precise64.box"
  config.omnibus.chef_version = :latest
  config.vm.network :private_network, ip: "33.33.33.10"

  config.vm.provision :chef_solo do |chef|
    chef.cookbooks_path = ["cookbooks", "my-cookbooks"]
    chef.add_recipe "nginx"
  end

  config.berkshelf.enabled = true

  config.vm.provision :chef_solo do |chef|
    chef.json = {
      :mysql => {
        :server_root_password => 'rootpass',
        :server_debian_password => 'debpass',
        :server_repl_password => 'replpass'
      }
    }

    chef.run_list = [
        "recipe[myapp::default]"
    ]
  end
end

Backtrace:

INFO global: Vagrant version: 1.3.1
 ...<VagrantPlugins::Omnibus::Action::InstallChef:0x00000108507c98>
 INFO warden: Calling action: #<Berkshelf::Vagrant::Action::Install:0x00000108507c20>
 INFO interface: warn: This version of the Berkshelf plugin has not been fully tested on this version of Vagrant.
[Berkshelf] This version of the Berkshelf plugin has not been fully tested on this version of Vagrant.
 INFO interface: warn: You should check for a newer version of vagrant-berkshelf.
[Berkshelf] You should check for a newer version of vagrant-berkshelf.
 INFO interface: warn: If you encounter any errors with this version, please report them at https://github.com/RiotGames/vagrant-berkshelf/issues
[Berkshelf] If you encounter any errors with this version, please report them at https://github.com/RiotGames/vagrant-berkshelf/issues
 INFO interface: warn: You can also join the discussion in #berkshelf on Freenode.
[Berkshelf] You can also join the discussion in #berkshelf on Freenode.
 INFO interface: info: Updating Vagrant's berkshelf: '/Users/macm/.berkshelf/default/vagrant/berkshelf-20130913-24059-1ex15i6-default'
[Berkshelf] Updating Vagrant's berkshelf: '/Users/macm/.berkshelf/default/vagrant/berkshelf-20130913-24059-1ex15i6-default'
 INFO interface: info: Using application_ruby (2.1.0)
[Berkshelf] Using application_ruby (2.1.0)
 INFO interface: info: Using postgresql (3.0.4)
[Berkshelf] Using postgresql (3.0.4)
 INFO interface: info: Using apt (2.1.1)
[Berkshelf] Using apt (2.1.1)
 INFO interface: info: Using user (0.3.0)
[Berkshelf] Using user (0.3.0)
 INFO interface: info: Using ruby_build (0.8.0)
[Berkshelf] Using ruby_build (0.8.0)
 INFO interface: info: Using nginx (1.8.0)
[Berkshelf] Using nginx (1.8.0)
 INFO interface: info: Using application (3.0.0)
[Berkshelf] Using application (3.0.0)
 INFO interface: info: Using unicorn (1.3.0)
[Berkshelf] Using unicorn (1.3.0)
 INFO interface: info: Using apache2 (1.7.0)
[Berkshelf] Using apache2 (1.7.0)
 INFO interface: info: Using passenger_apache2 (2.0.4)
[Berkshelf] Using passenger_apache2 (2.0.4)
 INFO interface: info: Using build-essential (1.4.2)
[Berkshelf] Using build-essential (1.4.2)
 INFO interface: info: Using runit (1.2.0)
[Berkshelf] Using runit (1.2.0)
 INFO interface: info: Using yum (2.3.2)
[Berkshelf] Using yum (2.3.2)
 INFO interface: info: Using openssl (1.1.0)
[Berkshelf] Using openssl (1.1.0)
 INFO interface: info: Using ohai (1.1.12)
[Berkshelf] Using ohai (1.1.12)
 INFO warden: Calling action: #<Berkshelf::Vagrant::Action::Upload:0x00000108507bf8>
 INFO warden: Calling action: #<Vagrant::Action::Builtin::EnvSet:0x00000108507bd0>
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::PrepareForwardedPortCollisionParams:0x00000108507ba8>
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "list", "vms"]
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "72dd1e43-2966-4b2a-96ea-e25df6ee7d5e", "--machinereadable"]
 INFO warden: Calling action: #<Vagrant::Action::Builtin::HandleForwardedPortCollisions:0x00000108507b80>
 INFO handle_port_collisions: Detecting any forwarded port collisions...
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::PruneNFSExports:0x00000100b1ae08>
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "list", "vms"]
 INFO warden: Calling action: #<Vagrant::Action::Builtin::NFS:0x00000100b1ade0>
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::PrepareNFSSettings:0x000001084eea68>
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::ClearSharedFolders:0x000001084d9f50>
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "f31f231f-b99d-45ac-91cf-0929308714e9", "--machinereadable"]
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::ShareFolders:0x000001084d9f28>
 INFO interface: info: Creating shared folders metadata...
[default] Creating shared folders metadata...
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "sharedfolder", "add", "f31f231f-b99d-45ac-91cf-0929308714e9", "--name", "/vagrant", "--hostpath", "/Users/macm/Documents/Development/chef-repo/my-cookbooks/measureful"]
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "setextradata", "f31f231f-b99d-45ac-91cf-0929308714e9", "VBoxInternal2/SharedFoldersEnableSymlinksCreate//vagrant", "1"]
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "sharedfolder", "add", "f31f231f-b99d-45ac-91cf-0929308714e9", "--name", "/tmp/vagrant-chef-1/chef-solo-1/cookbooks", "--hostpath", "/Users/macm/.berkshelf/default/vagrant/berkshelf-20130913-24059-1ex15i6-default"]
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "setextradata", "f31f231f-b99d-45ac-91cf-0929308714e9", "VBoxInternal2/SharedFoldersEnableSymlinksCreate//tmp/vagrant-chef-1/chef-solo-1/cookbooks", "1"]
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::ClearNetworkInterfaces:0x00000106ba6650>
 INFO interface: info: Clearing any previously set network interfaces...
[default] Clearing any previously set network interfaces...
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "modifyvm", "f31f231f-b99d-45ac-91cf-0929308714e9", "--nic2", "none", "--nic3", "none", "--nic4", "none", "--nic5", "none", "--nic6", "none", "--nic7", "none", "--nic8", "none"]
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::Network:0x00000106ba6628>
 INFO network: Determining network adapters required for high-level configuration...
 INFO network:  -- Slot 2: hostonly
 INFO network: Determining adapters and compiling network configuration...
 INFO network: Network slot 1. Type: nat.
 INFO network: Network slot 2. Type: hostonly.
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "list", "bridgedifs"]
 INFO network: Searching for matching hostonly network: 33.33.33.10
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "list", "dhcpservers"]
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "list", "hostonlyifs"]
 INFO network: Enabling adapters...
 INFO interface: info: Preparing network interfaces based on configuration...
[default] Preparing network interfaces based on configuration...
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "modifyvm", "f31f231f-b99d-45ac-91cf-0929308714e9", "--nic1", "nat", "--nic2", "hostonly", "--hostonlyadapter2", "vboxnet0"]
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::ForwardPorts:0x00000100b07da8>
 INFO interface: info: Forwarding ports...
[default] Forwarding ports...
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "f31f231f-b99d-45ac-91cf-0929308714e9", "--machinereadable"]
 INFO interface: info: -- 22 => 2222 (adapter 1)
[default] -- 22 => 2222 (adapter 1)
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "modifyvm", "f31f231f-b99d-45ac-91cf-0929308714e9", "--natpf1", "ssh,tcp,127.0.0.1,2222,,22"]
 INFO warden: Calling action: #<Vagrant::Action::Builtin::SetHostname:0x00000100b07d80>
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::SaneDefaults:0x00000100b07d58>
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "storagectl", "f31f231f-b99d-45ac-91cf-0929308714e9", "--name", "SATA Controller", "--hostiocache", "on"]
 INFO sanedefaults: Enabling the Host I/O cache on the SATA controller... (exit status = 0)
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "modifyvm", "f31f231f-b99d-45ac-91cf-0929308714e9", "--rtcuseutc", "on"]
 INFO sanedefaults: Enabling rtcuseutc... (exit status = 0)
 INFO sanedefaults: Automatically figuring out whether to enable/disable NAT DNS proxy...
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "modifyvm", "f31f231f-b99d-45ac-91cf-0929308714e9", "--natdnsproxy1", "on"]
 INFO sanedefaults: Enable the NAT DNS proxy on adapter 1... (exit status = 0)
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::Customize:0x00000100c3ab08>
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::Boot:0x00000100c3aae0>
 INFO interface: info: Booting VM...
[default] Booting VM...
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "startvm", "f31f231f-b99d-45ac-91cf-0929308714e9", "--type", "headless"]
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::Customize:0x00000100c3aab8>
 INFO warden: Calling action: #<Vagrant::Action::Builtin::WaitForCommunicator:0x00000100c3aa90>
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "f31f231f-b99d-45ac-91cf-0929308714e9", "--machinereadable"]
 INFO interface: info: Waiting for machine to boot. This may take a few minutes...
[default] Waiting for machine to boot. This may take a few minutes...
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "f31f231f-b99d-45ac-91cf-0929308714e9", "--machinereadable"]
 INFO ssh: Attempting SSH connnection...
 INFO ssh: Attempting to connect to SSH...
 INFO ssh:   - Host: 127.0.0.1
 INFO ssh:   - Port: 2222
 INFO ssh:   - Username: vagrant
 INFO ssh:   - Key Path: /Users/macm/.vagrant.d/insecure_private_key
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "f31f231f-b99d-45ac-91cf-0929308714e9", "--machinereadable"]

ERROR warden: Error occurred: Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.ssh.timeout" value) time period. This can
mean a number of things.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.ssh.timeout") value.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.

ERROR warden: Error occurred: Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.ssh.timeout" value) time period. This can
mean a number of things.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.ssh.timeout") value.
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x0000010137f490>
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Recovery complete.
ERROR warden: Error occurred: Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.ssh.timeout" value) time period. This can
mean a number of things.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.ssh.timeout") value.
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x00000106b2e790>
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Recovery complete.
ERROR warden: Error occurred: Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.ssh.timeout" value) time period. This can
mean a number of things.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.ssh.timeout") value.
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x000001024b4558>
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x000001024b45f8>
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<VagrantPlugins::ProviderVirtualBox::Action::Import:0x000001075b8738>
ERROR warden: Error occurred: Too many open files - getcwd
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x000001024b4558>
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x000001024b45f8>
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<VagrantPlugins::ProviderVirtualBox::Action::Import:0x000001075b8738>
ERROR warden: Error occurred: Too many open files - getcwd
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x000001024b4558>
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x000001024b45f8>
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<VagrantPlugins::ProviderVirtualBox::Action::Import:0x000001075b8738>
ERROR warden: Error occurred: Too many open files - getcwd
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x000001024b4558>
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x000001024b45f8>
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<VagrantPlugins::ProviderVirtualBox::Action::Import:0x000001075b8738>
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "f31f231f-b99d-45ac-91cf-0929308714e9", "--machinereadable"]
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 2 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x000001026cea50>
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::CheckVirtualbox:0x00000106977d98>
 INFO base: VBoxManage path: VBoxManage
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "--version"]
 INFO meta: Using VirtualBox driver: VagrantPlugins::ProviderVirtualBox::Driver::Version_4_2
 INFO base: VBoxManage path: VBoxManage
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "list", "hostonlyifs"]
 INFO warden: Calling action: #<Vagrant::Action::Builtin::Call:0x00000106977e38>
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 2 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x000001086aeb28>
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::Created:0x0000010358a990>
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "f31f231f-b99d-45ac-91cf-0929308714e9", "--machinereadable"]
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 2 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Warden:0x0000010712a5e0>
 INFO warden: Calling action: #<Vagrant::Action::Builtin::Call:0x0000010712a540>
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 2 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x00000106acbd48>
 INFO warden: Calling action: #<Vagrant::Action::Builtin::DestroyConfirm:0x00000106acc608>
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 2 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Warden:0x00000100d29dc0>
 INFO warden: Calling action: #<Vagrant::Action::Builtin::EnvSet:0x00000100d29d20>
 INFO warden: Calling action: #<Berkshelf::Vagrant::Action::SetUI:0x00000100d29cf8>
 INFO warden: Calling action: #<Berkshelf::Vagrant::Action::LoadShelf:0x00000100d29cd0>
 INFO warden: Calling action: #<Berkshelf::Vagrant::Action::ConfigureChef:0x00000100d29ca8>
 INFO warden: Calling action: #<Vagrant::Action::Builtin::ConfigValidate:0x00000100d29c58>
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::CheckAccessible:0x00000100d29c30>
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "f31f231f-b99d-45ac-91cf-0929308714e9", "--machinereadable"]
 INFO warden: Calling action: #<Vagrant::Action::Builtin::EnvSet:0x00000100d29c08>
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::CheckVirtualbox:0x00000100d29be0>
 INFO base: VBoxManage path: VBoxManage
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "--version"]
 INFO meta: Using VirtualBox driver: VagrantPlugins::ProviderVirtualBox::Driver::Version_4_2
 INFO base: VBoxManage path: VBoxManage
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "list", "hostonlyifs"]
 INFO warden: Calling action: #<Vagrant::Action::Builtin::Call:0x00000100d29bb8>
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 2 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x00000108368090>
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::Created:0x0000010836d2c0>
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "f31f231f-b99d-45ac-91cf-0929308714e9", "--machinereadable"]
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 2 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Warden:0x00000100df0218>
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::CheckAccessible:0x00000100df01a0>
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "f31f231f-b99d-45ac-91cf-0929308714e9", "--machinereadable"]
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::DiscardState:0x00000100df0178>
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "f31f231f-b99d-45ac-91cf-0929308714e9", "--machinereadable"]
 INFO warden: Calling action: #<Vagrant::Action::Builtin::Call:0x00000100df0150>
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 2 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x000001074e9640>
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::IsPaused:0x000001074ee5a0>
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "f31f231f-b99d-45ac-91cf-0929308714e9", "--machinereadable"]
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 2 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Warden:0x00000108380e38>
 INFO warden: Calling action: #<Vagrant::Action::Builtin::Call:0x00000100df0100>
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 2 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x00000106b405d0>
 INFO warden: Calling action: #<Vagrant::Action::Builtin::GracefulHalt:0x00000108390b80>
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 2 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Warden:0x0000010681ec80>
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::ForcedHalt:0x0000010681ec08>
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "f31f231f-b99d-45ac-91cf-0929308714e9", "--machinereadable"]
 INFO interface: info: Forcing shutdown of VM...
[default] Forcing shutdown of VM...
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "controlvm", "f31f231f-b99d-45ac-91cf-0929308714e9", "poweroff"]
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::PruneNFSExports:0x00000100d29b40>
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "list", "vms"]
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::Destroy:0x00000100d29b18>
 INFO interface: info: Destroying VM and associated drives...
[default] Destroying VM and associated drives...
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "unregistervm", "f31f231f-b99d-45ac-91cf-0929308714e9", "--delete"]
 INFO machine: New machine ID: nil
 INFO base: VBoxManage path: VBoxManage
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "--version"]
 INFO meta: Using VirtualBox driver: VagrantPlugins::ProviderVirtualBox::Driver::Version_4_2
 INFO base: VBoxManage path: VBoxManage
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::CleanMachineFolder:0x00000100d29af0>
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "list", "systemproperties"]
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::DestroyUnusedNetworkInterfaces:0x00000100d29ac8>
 INFO warden: Recovery complete.
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x000001024b4710>
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO environment: Running hook: environment_unload
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x00000107155c40>
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/util/subprocess.rb:44:in `pwd': Too many open files - getcwd (Errno::EMFILE)
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/util/subprocess.rb:44:in `execute'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/util/subprocess.rb:24:in `execute'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/plugins/providers/virtualbox/driver/base.rb:363:in `block in raw'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/util/busy.rb:19:in `busy'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/plugins/providers/virtualbox/driver/base.rb:362:in `raw'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/plugins/providers/virtualbox/driver/base.rb:292:in `block in execute'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/util/retryable.rb:17:in `retryable'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/plugins/providers/virtualbox/driver/base.rb:290:in `execute'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/plugins/providers/virtualbox/driver/version_4_2.rb:385:in `read_state'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/plugins/providers/virtualbox/provider.rb:70:in `state'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/plugins/providers/virtualbox/action/import.rb:36:in `recover'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/warden.rb:66:in `block in recover'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/warden.rb:63:in `each'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/warden.rb:63:in `recover'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/builtin/call.rb:62:in `recover'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/warden.rb:66:in `block in recover'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/warden.rb:63:in `each'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/warden.rb:63:in `recover'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/warden.rb:52:in `rescue in call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/warden.rb:28:in `call'
    from /Users/macm/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.3/lib/berkshelf/vagrant/action/set_ui.rb:12:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/builtin/env_set.rb:19:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/builtin/call.rb:57:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/builder.rb:116:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/runner.rb:61:in `block in run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/util/busy.rb:19:in `busy'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/action/runner.rb:61:in `run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/machine.rb:147:in `action'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/batch_action.rb:63:in `block (2 levels) in run'
like image 712
99miles Avatar asked Sep 15 '13 03:09

99miles


3 Answers

If you can't rebuild the Vagrant box, you can have Vagrant set the ulimit before it runs chef-solo.

Update your Vagrantfile to include:

config.vm.provision :shell, :inline => "ulimit -n 4048"

Make sure this occurs before the line:

config.vm.provision :chef_solo do |chef|
...

You may need to tweak the number, but this four times the default, so it should do the trick.

[Update] I have had issues with this working on different boxes. If you don't have time to make a new box, you can temporarily do this:

vagrant up
vagrant ssh
sudo su
ulimit -n 4048
exit
vagrant reload
vagrant provision

This is setting ulimit as root, reloading the virtual machine and rerunning Chef. The moment you run vagrant destroy, you will have to do this again.

like image 189
Jeff Devine Avatar answered Nov 13 '22 02:11

Jeff Devine


INFO runner: Running action: #<Vagrant::Action::Builder:0x00000107155c40>
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.1/lib/vagrant/util/subprocess.rb:44:in `pwd': Too many open files - getcwd (Errno::EMFILE)

The above error message indicated that you've hit the max number of open files limit in the Terminal Session.

Run ulimit -a and see the open files value, by default (OS X 10.7 is 2560, Ubuntu 1024). You may need to set it to a much larger value and then run vagrant up again. Hopefully it'll work.

like image 23
Terry Wang Avatar answered Nov 13 '22 02:11

Terry Wang


The easiest work around that I've found is to always run vagrant up in a fresh terminal window.

like image 2
M. Scott Ford Avatar answered Nov 13 '22 01:11

M. Scott Ford