- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: 400 bad request
- Date: Fri, 7 Aug 2015 10:21:56 -0700
On Thursday, August 6, 2015 at 8:36 PM, Nikhil Shah wrote:
>
Hey guys,
>
>
I've probably bootstrapped around 50 nodes by now and for some reason I've
>
been starting to get a 400 Bad Request error on all of the nodes i try to
>
bootstrap. I've also tried to run chef-client on the nodes, but still
>
getting the same error:
>
>
>
> qavapi01.qaorch.com (http://qavapi01.qaorch.com) Recipe: cron::chef
>
> qavapi01.qaorch.com (http://qavapi01.qaorch.com) *
>
> cookbook_file[/root/chef.sh (http://chef.sh)] action create (up to date)
>
> qavapi01.qaorch.com (http://qavapi01.qaorch.com) * cron_d[chef_script]
>
> action create (up to date)
>
> qavapi01.qaorch.com (http://qavapi01.qaorch.com) Recipe: <Dynamically
>
> Defined Resource>
>
> qavapi01.qaorch.com (http://qavapi01.qaorch.com) *
>
> template[/etc/cron.d/chef_script] action create (up to date)
>
> qavapi01.qaorch.com (http://qavapi01.qaorch.com)
>
> [2015-08-06T23:30:37-04:00] ERROR: Running exception handlers
>
> qavapi01.qaorch.com (http://qavapi01.qaorch.com)
>
> [2015-08-06T23:30:37-04:00] ERROR: Exception handlers complete
>
> qavapi01.qaorch.com (http://qavapi01.qaorch.com)
>
> [2015-08-06T23:30:37-04:00] FATAL: Stacktrace dumped to
>
> /var/chef/cache/chef-stacktrace.out
>
> qavapi01.qaorch.com (http://qavapi01.qaorch.com) Chef Client failed. 27
>
> resources updated
>
> qavapi01.qaorch.com (http://qavapi01.qaorch.com)
>
> [2015-08-06T23:30:37-04:00] ERROR: 400 "Bad Request"
>
> qavapi01.qaorch.com (http://qavapi01.qaorch.com)
>
> [2015-08-06T23:30:37-04:00] FATAL: Chef::Exceptions::ChildConvergeError:
>
> Chef run process exited unsuccessfully (exit code 1)
>
>
>
What would be the reason for this?
>
>
Here is the stack output from the node:
>
>
> Generated at 2015-08-06 23:34:11 -0400
>
> Net::HTTPServerException: 400 "Bad Request"
>
> /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2633:in `error!'
>
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/http.rb:140:in
>
> `request'
>
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/http.rb:113:in
>
> `put'
>
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/node.rb:497:in
>
> `save'
>
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/client.rb:262:in
>
> `save_updated_node'
>
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/client.rb:502:in
>
> `do_run'
>
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/client.rb:199:in
>
> `block in run'
>
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/client.rb:193:in
>
> `fork'
>
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/client.rb:193:in
>
> `run'
>
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/application.rb:208:in
>
> `run_chef_client'
>
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/application/client.rb:312:in
>
> `block in run_application'
>
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/application/client.rb:304:in
>
> `loop'
>
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/application/client.rb:304:in
>
> `run_application'
>
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/application.rb:66:in
>
> `run'
>
> /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/bin/chef-client:26:in
>
> `<top (required)>'
>
> /usr/bin/chef-client:23:in `load'
>
> /usr/bin/chef-client:23:in `<main>'
>
This means that your chef-client run is generally working okay, but when Chef
attempts to save the node data back to the server, the submitted data is
somehow invalid. There are several possibilities but the most common is that
there are invalid characters in the node data (JSON data must be valid
UTF-8). Several such bugs have been fixed in recent versions of Chef, you
should try installing a newer version and see if that resolves the issue. If
you’re totally unable to upgrade, you can try pretty printing the node data
and looking for any non-ascii characters; you might be able to delete that
data via a cookbook or prevent ohai from loading it with config.
>
>
>
>
>
--
>
Nikhil Shah • System Administrator
>
>
>
(mailto:
)
>
• p. (+1) 212 308-5648
--
Daniel DeLeo
Archive powered by MHonArc 2.6.16.