I think I am almost there.
I created an instance of AWS BeanStalk and added an oracle DB instance to it.
When I found the log, I saw the driver was loaded but it keeps saying that URL is
invalid.
Here are my RDS info and log message.
[RDS Info]
Endpoint = aa1c9autjaqoufk.c2k1ch01futy.ap-northeast-2.rds.amazonaws.com
Port = 1521
Public Access = yes
[System Log]
25-Jun-2018 02:42:56.759 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
25-Jun-2018 02:42:56.787 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
25-Jun-2018 02:42:56.796 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
25-Jun-2018 02:42:56.799 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
25-Jun-2018 02:42:56.800 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1366 ms
25-Jun-2018 02:42:56.842 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
25-Jun-2018 02:42:56.848 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.50
25-Jun-2018 02:42:56.872 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /var/lib/tomcat8/webapps/ROOT
25-Jun-2018 02:42:58.613 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
25-Jun-2018 02:42:58.689 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /var/lib/tomcat8/webapps/ROOT has finished in 1,817 ms
25-Jun-2018 02:42:58.693 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
25-Jun-2018 02:42:58.720 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
25-Jun-2018 02:42:58.736 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 1935 ms
Loading driver...
Driver loaded!
jdbc:oracle:oci://aa1c9autjaqoufk.c2k1ch01futy.ap-northeast-2.rds.amazonaws.com:1521/ebdb?user=username&password=password
SQLException: Invalid Oracle URL specified
SQLState: 99999
VendorError: 17067
Closing the connection.
SQLException: Invalid Oracle URL specified
SQLState: 99999
VendorError: 17067
Closing the connection.
I included ojdbc8 drvier in my web project library and made a build.
Is this about driver? What am I doing wrong?
Message clearly says your URL is incorrect,
It should be something like below.
//step1 load the driver class
Class.forName("oracle.jdbc.driver.OracleDriver");
//step2 create the connection object
Connection con=DriverManager.getConnection(
"jdbc:oracle:thin:#aa1c9autjaqoufk.c2k1ch01futy.ap-northeast-2.rds.amazonaws.com:1521:edb","username","password");
`
It is so werid that I can connect to AWS RDS with sqldeveloper but can't with my java application(java source code or jsp)
When I try to access to RDS, there are errors like:
coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
26-Jun-2018 04:24:33.203 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
26-Jun-2018 04:24:33.212 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
26-Jun-2018 04:24:33.215 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
26-Jun-2018 04:24:33.219 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1387 ms
26-Jun-2018 04:24:33.265 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
26-Jun-2018 04:24:33.266 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.50
26-Jun-2018 04:24:33.286 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /var/lib/tomcat8/webapps/ROOT
26-Jun-2018 04:24:35.020 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
26-Jun-2018 04:24:35.097 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /var/lib/tomcat8/webapps/ROOT has finished in 1,811 ms
26-Jun-2018 04:24:35.100 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
26-Jun-2018 04:24:35.106 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
26-Jun-2018 04:24:35.108 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 1888 ms
Loading driver...
Driver loaded!
jdbc:oracle:thin://IP:1521/ORCL?user=username&password=password
SQLException: Invalid Oracle URL specified
SQLState: 99999
VendorError: 17067
Closing the connection.
SQLException: Invalid Oracle URL specified
SQLState: 99999
VendorError: 17067
Closing the connection.
But the URL is just the same value as I tried with sqldeveloper.
Is there anything wrong?
Please enlighten me since I've been suffering for this about a week! :(
I'm not sure how your application is set up, but I'm using Maven & Spring Boot and I got it working like this:
I mainly followed this guide, ignoring the .sql files, thymeleaf UI, "model.addAttribute("cities", cities);" part, and the html file:
https://zetcode.com/springboot/postgresql/
My application.properties file looks like this
postgres.comment.aa=https://zetcode.com/springboot/postgresql/
spring.main.banner-mode=off
logging.level.org.springframework=ERROR
spring.jpa.hibernate.ddl-auto=none
spring.datasource.initialization-mode=always
spring.datasource.platform=postgres
spring.datasource.url=jdbc:postgresql://your-rds-url-here.us-east-1.rds.amazonaws.com:yourDbPortHere/postgres
spring.datasource.username=postgres
spring.datasource.password=<your db password here>
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
If you have custom schemas, you can append "?currentSchema=users" to the url:
spring.datasource.url=jdbc:postgresql://your-rds-url-here.us-east-1.rds.amazonaws.com:yourDbPortHere/postgres?currentSchema=users
Thanks to this SO answer for the schema:
Is it possible to specify the schema when connecting to postgres with JDBC?
These other couple links also helped
https://turreta.com/2015/03/01/how-to-specify-a-default-schema-when-connecting-to-postgresql-using-jdbc/
https://doc.cuba-platform.com/manual-latest/db_schema_connection.html
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'
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.
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.
The easiest work around that I've found is to always run vagrant up in a fresh terminal window.