Unable to run unicorn app server on a vagrant box - ruby

I have a vagrant box on which RVM is already installed with ruby 2.0.0-p247. I have packaged the vagrant box and using that box as a base box.
Now I am trying to git clone a github private repo and start the unicorn app server, chef is errors out,here is the output of the error
==> default: stdin: is not a tty
==> default: /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find chef (>= 0) amongst [bundler-1.7.7, bundler-unload-1.0.2, executable-hooks-1.3.2, gem-wrappers-1.2.7, rubygems-bundler-1.4.4, rvm-1.11.3.9] (Gem::LoadError)
==> default: from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
==> default: from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
==> default: from /usr/bin/chef-solo:22:in `<main>'
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
I am not able to debug the issue. Its ubuntu 14.04 box. Kindly help me out

Use the vagrant-omnibus plugin to install Chef. This will give Chef its own isolated Ruby environment separate from your RVM setup.

Related

Chef solo with berkshelf: cookbook not resolved

I've created this Vagrantfile's provioner section:
config.vm.provision "chef_solo" do |chef|
chef.add_recipe "wildfly"
end
I'm getting this error:
==> default: Error Resolving Cookbooks for Run List:
==> default:
==> default: Missing Cookbooks:
==> default: ------------------
==> default: No such cookbook: wildfly
So, I've created a Berksfile and a metadata.rb files:
Berksfile:
source 'https://supermarket.chef.io'
metadata
metadata.rb:
name 'webapi'
maintainer 'The Authors'
maintainer_email 'you#example.com'
license 'all_rights'
description 'Installs/Configures webapi'
long_description 'Installs/Configures webapi'
version '0.1.0'
depends 'java_se', '~> 9.0.1'
depends 'wildfly', '~> 0.4.0'
So, then I've performed berks install command. The first issue I've detected is that I don't quite detect where berks has placed cookbooks. It seems that it works right, nevertheless, I don't find where cookbooks dependencies are located, I mean, a .\cookbooks folder is not created after performing berks install command.
Resolving cookbook dependencies...
Fetching 'olingo' from source at .
Fetching cookbook index from https://supermarket.chef.io...
Using apt (6.1.4)
Using homebrew (4.2.0)
Using java (1.50.0)
Using java_se (9.0.1)
Using ohai (5.2.0)
Using olingo (0.1.0) from source at .
Using wildfly (0.4.0)
Using yum (5.1.0)
Using windows (3.4.0)
Regardless of that, I've performed vagrant provision again, and wildfly cookbook is not resolved:
The cookbook path 'D:/projects/swiller/querydsl/olingo/infrastructure/cookbooks' doesn't exist. Ignoring...
Running provisioner: chef_solo...
==> default: Error Resolving Cookbooks for Run List:
==> default:
==> default: Missing Cookbooks:
==> default: ------------------
==> default: No such cookbook: wildfly
You either need to use the vagrant-berkshelf plugin, or use the berks vendor command to write all the cookbooks to a folder and then point Vagrant at that (which is what the plugin does internally). berks install only downloads them to your workstation, it doesn't put the cookbooks in a place/format that anything other than Berkshelf understands.

Chef template file file not found

My vagrant failed when provisioning with template.
template "/var/.s3cfg" do
source "s3cfg.erb"
owner "root"
group "root"
mode "0644"
end
in that cookbook directory, file templates/default/s3cfg.erb exists.
But strangely it's work successfully on opswork amazon, so it might be vagrant, vagrant-cachier, vagrant-berkshelf, berkshelf, or chef error.
Any idea how to check?
My environment:
$: vagrant -v
Vagrant 1.6.5
$: vagrant plugin list
vagrant-berkshelf (3.0.1)
vagrant-cachier (0.9.0)
vagrant-login (1.0.1, system)
vagrant-omnibus (1.4.1)
vagrant-share (1.1.1, system)
$: chef -v
Chef Development Kit Version: 0.2.2
$: berks -v
3.1.5
vagrant box is ubuntu-precise 12.04
Apparently the cause is because chef default location of provisioning path located at /tmp/vagrant-chef. In the middle of the chef execution, somehow the /tmp/ folder cleaned. Hence the missing file.
By changing the location of chef.provisioning_path to other folder than /tmp/, it worked normally.

Vagrant: Unknown configuration section 'omnibus' but vagrant-omnibus plugin is installed

I've followed the instructions at: http://berkshelf.com/ after installing the latest ChefDK (from here: http://downloads.getchef.com/chef-dk/mac/#/). When I do "vagrant up", I get the error:
Vagrant:
* Unknown configuration section 'omnibus'.
Various posts (e.g. Vagrant Install chef-client on top of base image) have suggested this means that the vagrant-omnibus plugin is not installed. In my case, I have installed it. "vagrant plugin list" displays:
vagrant-berkshelf (2.0.1)
- Version Constraint: 2.0.1
vagrant-login (1.0.1, system)
vagrant-omnibus (1.4.1)
vagrant-share (1.1.1, system)
Any suggestions as to how I can get this example cookbook to run on a new VM instance launched with "vagrant up"?
It turns out the issue for me was that while ~/.vagrant.d/plugins.json included the vagrant-omnibus plugin, the ~/.vagrant.d/gems/gems and ~/.vagrant.d/gems/specifications directories did not contain the appropriate GEM or gemspec files. Not sure how this happened, but I suspect it was due to accidentally typing ^C in the middle of execution of the vagrant plugin install command and then reexecuting that command.
It would appear vagrant plugin install does not do appropriate ^C handling and that it writes the contents of plugins.json before it has stored the gem and gemspec.
Subsequent vagrant plugin install commands don't fix the problem. Manually editing plugins.json to remove the plugin and then reexecuting the vagrant plugin install vagrant-omnibus command fixed the issue.
I personally went inside the vagrant file using VI editor
and commented out the line that has omni bus script
and then run "
vagrant status" and then "vagrant up"
1.vi Vagrant
2.?omnibus
3."insert" I omnibus
4.insert # to comment out the line
5. wq! to come out of vi editor
** this issue can also be related with the type of OS one is using ,i am using a mac

vagrant omnibus behind proxy

Ok, I'm trying to update chef-client with vagrant omnibus and proxyconf. I figured it would pull the proxy from the proxyconf, but it doesn't look that way. Here is my plugin list:
vagrant plugin list
vagrant-login (1.0.1, system)
vagrant-omnibus (1.4.1)
- Version Constraint: 1.4.1
vagrant-proxyconf (1.3.2)
- Version Constraint: 1.3.2
vagrant-share (1.1.0, system)
and my Vagrant file:
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.omnibus.chef_version = :latest
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.http = "my proxy"
config.proxy.https = "my proxy"
end
When i run it with vagrant up, the machine does not have an updated chef-client. I tried using the recipe[omnibus_updater] in my run list it still fails because another recipe is failing with a compile failure (because of the older version of chef-client, what a pain in the butt). Any ideas? Other than creating a new virtual box?
Update:
Running in debug mode doesn't show any errors using :latest. Updating to 11.12.8 gives the below error
vagrant-omnibus:
* '11.12.8' is not a valid version of Chef.
Logging into the vm shows $HTTP_PROXY and $HTTPS_PROXY set properly. Running the commands on the built vm works:
chef-client -v
Chef: 10.14.2
sudo gem update chef
chef-client -v
Chef: 11.12.8
Thing 1:
:latest does not error out when it fails to grab the artifact. Switching to a named version starts to fail to find the artifact which leads me to believe that it isn't getting through the proxy.
Thing 2:
I think this is a problem with omnibus in windows. I've found this pull that may fix it? https://github.com/schisamo/vagrant-omnibus/pull/89. I think this plug-in isn't using the settings set by poxy-conf.
CURRENTLY USING THIS WORKAROUND:
Set you http proxy in the windows cmd line
SET HTTP_PROXY=http://username:password#proxy:port

Can't create digital ocean droplet by vagrant

To use digital ocean as a vagrant provider, I followed instruction here.
But I get this error.
$ vagrant up --provider=degital_ocean
The provider 'degital_ocean' could not be found, but was requested to
back the machine 'default'. Please use a provider that exists.
This is a result of $ vagrant plugin list
sahara (0.0.16)
vagrant-berkshelf (1.3.7)
vagrant-digitalocean (0.5.3)
vagrant-hostsupdater (0.0.11)
vagrant-omnibus (1.2.1)
What have I missed?
You misspelled "digital". $ vagrant up --provider=digital_ocean

Resources