Issue with Linux Packages with Vagrant provision (chef-solo)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue with Linux Packages with Vagrant provision (chef-solo)

Brandon Parsons
Hi there,

I'm trying to use vagrant up / vagrant provision along with the Chef-solo provisioner to work on vagrant boxes.

I have the following code in a Chef recipe:

include_recipe "apt"
%w(libyaml-dev ruby rubygems ruby-dev irb libxslt-dev libxml2-dev bison).each do |pkg|
  package pkg
end

This fails when using vagrant provision, but the exact same code works just fine when I use chef-solo via knife bootstrap.  The fail code appears to have something to do with the apt update:

================================================================================
Error executing action `install` on resource 'package[rubygems]'
================================================================================

Chef::Exceptions::Exec
----------------------
apt-get -q -y install rubygems=1.8.24-1ubuntu1 returned 100, expected 0

Resource Declaration:
---------------------
# In /tmp/vagrant-chef/chef-solo-1/cookbooks/custom/recipes/system_ruby.rb

  7:   package pkg
  8: end

Compiled Resource:
------------------
# Declared in /tmp/vagrant-chef/chef-solo-1/cookbooks/custom/recipes/system_ruby.rb:7:in `block in from_file'

package("rubygems") do
  action :install
  retries 0
  retry_delay 2
  package_name "rubygems"
  version "1.8.24-1ubuntu1"
  cookbook_name :custom
  recipe_name "system_ruby"
end

[2013-03-21T20:59:40-06:00] ERROR: Running exception handlers
[2013-03-21T20:59:40-06:00] ERROR: Exception handlers complete
[2013-03-21T20:59:40-06:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef/chef-stacktrace.out
[2013-03-21T20:59:40-06:00] FATAL: Chef::Exceptions::Exec: package[rubygems] (custom::system_ruby line 7) had an error: Chef::Exceptions::Exec: apt-get -q -y install rubygems=1.8.24-1ubuntu1 returned 100, expected 0

Any help would be appreciated!!  I'd really like to use the "vagrant provision" capability of vagrant rather than messing around with knife solo on my vagrant boxes.  

Thanks!

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Linux Packages with Vagrant provision (chef-solo)

Teemu Matilainen
Hi Brandon,

On Fri, Mar 22, 2013 at 12:06 AM, Brandon Parsons
<[hidden email]> wrote:

> This fails when using vagrant provision, but the exact same code works just
> fine when I use chef-solo via knife bootstrap.  The fail code appears to
> have something to do with the apt update:
>
> apt-get -q -y install rubygems=1.8.24-1ubuntu1 returned 100, expected 0

You can ssh to the box and run the same apt-get command manually (with
sudo) to see if that gives you more information.

--
Cheers,
  Teemu

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: Issue with Linux Packages with Vagrant provision (chef-solo)

Mathieu Darse
Hi,

Got same issue here, typing command in ssh gives that :

vagrant@precise32:~$ apt-get -q -y install php5-cli=5.3.10-1ubuntu3.3
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
vagrant@precise32:~$ echo $?
100

As we get the same error code, how can we check the user running chef-solo provisioning is really root ?

Mathieu

Le vendredi 22 mars 2013 17:08:12 UTC+1, Teemu Matilainen a √©crit :
Hi Brandon,

On Fri, Mar 22, 2013 at 12:06 AM, Brandon Parsons
<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="u_1WbKKs7moJ">parsons...@...> wrote:

> This fails when using vagrant provision, but the exact same code works just
> fine when I use chef-solo via knife bootstrap.  The fail code appears to
> have something to do with the apt update:
>
> apt-get -q -y install rubygems=1.8.24-1ubuntu1 returned 100, expected 0

You can ssh to the box and run the same apt-get command manually (with
sudo) to see if that gives you more information.

--
Cheers,
  Teemu

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.