- From: David Montgomery <
>
- To:
- Subject: [chef] Chef-client and HTTPServerException: 401 "Unauthorized"
- Date: Sat, 16 Jun 2012 23:08:41 +0800
Hi,
I need to booststap an node and I do not want to use knife.
I have a script that installed chef and then I run chef client as follows.
chef-client -E development -K /etc/chef/ips1-validator.pem -N
Tracker_east_development_1_2_1339695020 -j /etc/chef/first-boot.json
1) the ips1-validator.pem is correct. It is placed in /etc/chef
2) Here is my client.rb that is in /etc/chef
log_level :info
log_location STDOUT
chef_server_url "
https://api.opscode.com/organizations/ips1"
validation_client_name "ips1-validator"
validation_key "/etc/chef/ips1-validator.pem"
3) Here is the first-boot.json
{"run_list":["role[nginx_server]"]}
Given that it appears that I did everything correct, why do I get the
below error? This randomly works or fails. The node name is based on
a time stamp.
:/home/ubuntu#
chef-client -E development -K
/etc/chef/ips1-validator.pem -N
Tracker_east_development_1_2_1339695020 -j /etc/chef/first-boot.json
[Thu, 14 Jun 2012 17:41:28 +0000] INFO: *** Chef 0.10.10 ***
[Thu, 14 Jun 2012 17:41:30 +0000] FATAL: Stacktrace dumped to
/var/chef/cache/chef-stacktrace.out
[Thu, 14 Jun 2012 17:41:30 +0000] FATAL: Net::HTTPServerException: 401
"Unauthorized"
My bash script for installing chef is the below
mkdir /etc/chef
cp /tmp/ips1-validator.pem /etc/chef
cp /tmp/client.rb /etc/chef
cp /tmp/first-boot.json /etc/chef
echo "deb
http://apt.opscode.com/ `lsb_release -cs`-0.10 main" |
sudo tee /etc/apt/sources.list.d/opscode.list
mkdir -p /etc/apt/trusted.gpg.d
gpg --keyserver keys.gnupg.net --recv-keys 83EF826A
gpg --export
| sudo tee
/etc/apt/trusted.gpg.d/opscode-keyring.gpg > /dev/null
sudo apt-get -y update
sudo apt-get -y install opscode-keyring
sudo apt-get -y upgrade
echo "chef chef/chef_server_url string
https://api.opscode.com/organizations/ips1" | sudo
debconf-set-selections && sudo apt-get install chef -y
- [chef] Chef-client and HTTPServerException: 401 "Unauthorized", David Montgomery, 06/16/2012
Archive powered by MHonArc 2.6.16.