HTTP Request Returned 400 Bad Request: error

375 views
Skip to first unread message

risk...@gmail.com

unread,
Jan 2, 2016, 4:18:26 PM1/2/16
to scalr-discuss
We're getting the following error while launching instances during the BeforeHostUp phase.   
This error started occurring after we moved our scalr and chef servers to a new instance
type (by stopping and restarting after changing the type).

We can temporarily fix the problem by deleting the chef node and associate client with knife

knife client delete client-name
knife node delete client-name

which should clear the key for scalr but the error reappears upon subsequent relaunches.  
Can anyone suggest a permanent fix?  Do we need to remove all *.pem on the chef server located
under /etc/chef and then restart the server.


[Scalr built-in] Chef bootstrap failed: [2016-01-02T20:00:12+00:00] INFO: Forking chef instance to converge...
[2016-01-02T20:00:12+00:00] INFO: *** Chef 12.4.1 ***
[2016-01-02T20:00:12+00:00] INFO: Chef-client pid: 1385
[2016-01-02T20:00:14+00:00] INFO: Client key /etc/chef/client.pem is not present - registering
[2016-01-02T20:00:14+00:00] INFO: HTTP Request Returned 409 Conflict: Client already exists
[2016-01-02T20:00:14+00:00] INFO: HTTP Request Returned 400 Bad Request: error
[0m
================================================================================ [0m
[31mChef encountered an error attempting to create the client "pre01-2" [0m
================================================================================ [0m

[0mInvalid Request Data: [0m
--------------------- [0m
The data in your request was invalid (HTTP 400).
[0m
[0mServer Response: [0m
---------------- [0m
Since Server API v1, all keys must be updated via the keys endpoint. [0m

[0m[2016-01-02T20:00:14+00:00] ERROR: Running exception handlers
[2016-01-02T20:00:14+00:00] ERROR: Exception handlers complete
[2016-01-02T20:00:14+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2016-01-02T20:00:14+00:00] ERROR: 400 "Bad Request"
[2016-01-02T20:00:14+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

risk...@gmail.com

unread,
Jan 2, 2016, 10:12:47 PM1/2/16
to scalr-discuss
Forgot to mention that we upgraded to scalr 5.10.21 from an earlier version when we switched instance type
so that may have caused the error.

risk...@gmail.com

unread,
Jan 6, 2016, 12:01:29 AM1/6/16
to scalr-discuss

Upon further investigation I found the following error which I believe is triggering the ERROR: 400 "Bad Request".
Scalr can't delete the chef node due to  SSL certificate issues.  When I run 

knife ssl check

It seems to indicate Successfully verified certificates.   So not sure why scalr has problems with the SSL certificate.
The system log shows the following:

Caller: 4b5fcf9f-de4f-4863-bcdb-492b052c500c/FarmLog

Message: Unable to remove chef node 'pre02-slave-test-1' from chef server: http\Client::send(): Peer certificate cannot be authenticated with given CA certificates; SSL certificate problem, verify that the CA cert is OK. 
Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed 

Igor Savchenko

unread,
Jan 6, 2016, 12:04:58 AM1/6/16
to scalr-...@googlegroups.com
On what server you're executing: "knife ssl check"?

You need to check CA certs on Scalr server itself, not on the instances.

Regards,
Igor
> --
> You received this message because you are subscribed to the Google Groups
> "scalr-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scalr-discus...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

risk...@gmail.com

unread,
Jan 6, 2016, 1:08:30 PM1/6/16
to scalr-discuss
We ran the ssl check on the Chef server as defined in knife.rb, however I just checked the ssclar server and
 it also came back with "Successfully verified certificates".

risk...@gmail.com

unread,
Jan 12, 2016, 5:08:06 PM1/12/16
to scalr-discuss
Just wanted to let everyone know that we fixed the HTTP Request Returned 400 Bad Request: error
by updating the cert file on the chef server.


Reply all
Reply to author
Forward
0 new messages