I just bootstrapped a new set of VMs using ‘knife’ (0.9.8). When my
cookbooks are executed, I get errors on the apt-get command of the
package provider. See the following gist for an example:
If I execute the apt-get command manually, the command succeeds
without any problem. At the following chef-client run, the cookbook
barfs at the next package. Is there any way to debug why the apt-get
lines fail via Chef, but succeed manually?
Just sending a notice to folks that the Chef bootstrap process doesn’t work on the new EC2 micro instances when running Ubuntu 10.04. It fails on the Java recipe, specifically the openjdk-6-jre-headless package. This is a known bug (see https://bugs.launchpad.net/ubuntu/+source/linux-ec2/+bug/634487/). The same bootstrap runs perfectly on an m1.small instance type. I lost a good day’s work on this, so I’m passing it along so others don’t bang their heads against this, too
Just sending a notice to folks that the Chef bootstrap process doesn't work
on the new EC2 micro instances when running Ubuntu 10.04. It fails on the
Java recipe, specifically the openjdk-6-jre-headless package. This is a
known bug (see Bug #634487 “t1.micro instance hangs when installing java” : Bugs : linux-ec2 package : Ubuntu). The
same bootstrap runs perfectly on an m1.small instance type. I lost a good
day's work on this, so I'm passing it along so others don't bang their heads
against this, too
I'm surprised the t1.micro worked at all. In my limited testing thus far,
the CPU was almost always 99% stolen by hypervisor. Took something like 35
minutes to install emacs.
I just bootstrapped a new set of VMs using 'knife' (0.9.8). When my
cookbooks are executed, I get errors on the apt-get command of the
package provider. See the following gist for an example:
If I execute the apt-get command manually, the command succeeds
without any problem. At the following chef-client run, the cookbook
barfs at the next package. Is there any way to debug why the apt-get
lines fail via Chef, but succeed manually?
I have a perfectly reproducible case. Bootstrapping new VMs have
apt-package install errors just after knife bootstrap. If I restart
chef-client on these nodes, all apt-get works fine.
I looked in the Knife wiki page, but couldn't find how I can get the
chef-client configured in debug logging via knife bootstrap. Since the
problem disappears after chef-client restart, I really want that first
run in debug logging. Any info on how to do this?
You'll have to modify the bootstrap script. Knife supports templates,
including user-defined ones, for bootstrap scripts. So copy the
bootstrap script from the source:
I just bootstrapped a new set of VMs using 'knife' (0.9.8). When my
cookbooks are executed, I get errors on the apt-get command of the
package provider. See the following gist for an example:
If I execute the apt-get command manually, the command succeeds
without any problem. At the following chef-client run, the cookbook
barfs at the next package. Is there any way to debug why the apt-get
lines fail via Chef, but succeed manually?
I have a perfectly reproducible case. Bootstrapping new VMs have
apt-package install errors just after knife bootstrap. If I restart
chef-client on these nodes, all apt-get works fine.
I looked in the Knife wiki page, but couldn't find how I can get the
chef-client configured in debug logging via knife bootstrap. Since the
problem disappears after chef-client restart, I really want that first
run in debug logging. Any info on how to do this?
I just bootstrapped a new set of VMs using 'knife' (0.9.8). When my
cookbooks are executed, I get errors on the apt-get command of the
package provider. See the following gist for an example:
I just bootstrapped a new set of VMs using 'knife' (0.9.8). When my
cookbooks are executed, I get errors on the apt-get command of the
package provider. See the following gist for an example:
On Thu, Sep 30, 2010 at 9:35 AM, AJ Christensen aj@junglist.gen.nz wrote:
Isn't error code 100 a general underlying-subsystem failure?
Half-configured packages (dpkg --configure -a) or half-fetched APT sources
(apt-get update), as well!
Yeah, a 404 on any sources.list entry will cause apt-get update to return 100.
A key issue will still return 0.
It's common to have apt-get fail on an initial chef run if someone is
modifying sources.list because you have to make sure it happens in the
right order; get everything into the sources.list, get the keys,
trigger an immediate apt-get update execute.
You'll have to modify the bootstrap script. Knife supports templates,
including user-defined ones, for bootstrap scripts. So copy the
bootstrap script from the source:
to ~/.chef/bootstrap/debug.erb and modify it to run chef-client with -l debug. Then run knife bootstrap with -d debug
I did this, but it is still not what I want. Using the -l option, the
knife bootstrap runs in debug mode, but at that point in time,
everything is still OK. At the end of the run, the bootstrap
daemonizes the chef-client, and that first run gives apt-update and
apt-get errors. However, I bootstrap using apt packages and the
/etc/chef/client.rb file has logging set to :info. How can I get the
logging set to :debug in that file at bootstrap time? I tried to set
the log_level via debconf-set-selections (I bootstrap the APT way),
but that isn't set in the initial client.rb file.
Any idea how to set log_level to :debug in the initial /etc/chef/client.rb file?
Are you using any repositories that would not be signed by the
upstream keys, such as a local mirror or additional local package
repository?
No. The apt bootstrap process adds apt.opscode.com, but that is OK as
the key is also added. See my response to Dan's suggestion for a more
detailed description of where it fails: the first daemonized
chef-client run just after knife bootstrap!
I did this, but it is still not what I want. Using the -l option, the
knife bootstrap runs in debug mode, but at that point in time,
everything is still OK. At the end of the run, the bootstrap
daemonizes the chef-client, and that first run gives apt-update and
apt-get errors. However, I bootstrap using apt packages and the
/etc/chef/client.rb file has logging set to :info. How can I get the
logging set to :debug in that file at bootstrap time? I tried to set
the log_level via debconf-set-selections (I bootstrap the APT way),
but that isn't set in the initial client.rb file.
Here you can find the log file when chef-client is run the first time
in daemonized way:
Even the "apt-get update" fails already, while chef install via apt
worked flawlessly during the bootstrap process...
You'll have to modify the bootstrap script. Knife supports templates,
including user-defined ones, for bootstrap scripts. So copy the
bootstrap script from the source:
to ~/.chef/bootstrap/debug.erb and modify it to run chef-client with -l debug. Then run knife bootstrap with -d debug
I did this, but it is still not what I want. Using the -l option, the
knife bootstrap runs in debug mode, but at that point in time,
everything is still OK. At the end of the run, the bootstrap
daemonizes the chef-client, and that first run gives apt-update and
apt-get errors. However, I bootstrap using apt packages and the
/etc/chef/client.rb file has logging set to :info. How can I get the
logging set to :debug in that file at bootstrap time? I tried to set
the log_level via debconf-set-selections (I bootstrap the APT way),
but that isn't set in the initial client.rb file.
Any idea how to set log_level to :debug in the initial /etc/chef/client.rb file?
You'll have to modify the bootstrap script. Knife supports templates,
including user-defined ones, for bootstrap scripts. So copy the
bootstrap script from the source:
to ~/.chef/bootstrap/debug.erb and modify it to run chef-client with -l debug. Then run knife bootstrap with -d debug
I did this, but it is still not what I want. Using the -l option, the
knife bootstrap runs in debug mode, but at that point in time,
everything is still OK. At the end of the run, the bootstrap
daemonizes the chef-client, and that first run gives apt-update and
apt-get errors. However, I bootstrap using apt packages and the
/etc/chef/client.rb file has logging set to :info. How can I get the
logging set to :debug in that file at bootstrap time? I tried to set
the log_level via debconf-set-selections (I bootstrap the APT way),
but that isn't set in the initial client.rb file.
Any idea how to set log_level to :debug in the initial
/etc/chef/client.rb file?
This is possible with the gem based bootstrap method, but you can't
override the log level with the apt based bootstrap method. I tried
the same way as setting the chef server, but to no avail?