softlayer / knife-softlayer

Other
25 stars 22 forks source link

ERROR: Excon::Error::BadRequest: Expected([200, 201]) <=> Actual(400 Bad Request) #61

Closed pmafias closed 4 years ago

pmafias commented 4 years ago

Hi ! ,

I'm getting error while provisioning servers using Softlayer API.

ERROR: Excon::Error::BadRequest: Expected([200, 201]) <=> Actual(400 Bad Request) excon.error.response :body => "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n\n400 Bad Request\n\n

Bad Request

\n

Your browser sent a request that this server could not understand.
\n

\n

Additionally, a 400 Bad Request\nerror was encountered while trying to use an ErrorDocument to handle the request.

\n
\n
Apache Server at appdb.dal01.softlayer.local Port 443
\n\n" :cookies => [ ] :headers => { "Connection" => "close" "Content-Type" => "text/html; charset=iso-8859-1" "Date" => "Mon, 10 Feb 2020 18:43:39 GMT" "Server" => "Apache" "Strict-Transport-Security" => "max-age=31536000" "X-Frame-Options" => "SAMEORIGIN" } :host => "api.softlayer.com" :local_address => "xxx.xxx.xxxx.xxx" :local_port => xxxx :path => "xxxx.json" :port => xxx :reason_phrase => "Bad Request" :remote_ip => "xxx.xxx.xxx.xxx" :status => 400 :status_line => "HTTP/1.1 400 Bad Request\r\n"

Anyone can help me please ? Thanks !

pmafias commented 4 years ago

[ /usr/local/rvm/gems/ruby-2.2.5/gems/excon-0.57.0/lib/excon/middlewares/expects.rb:7:in `response_call'

15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/gems/excon-0.57.0/lib/excon/middlewares/response_parser.rb:9:in response_call' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/gems/excon-0.57.0/lib/excon/connection.rb:388:inresponse' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/gems/excon-0.57.0/lib/excon/connection.rb:252:in request' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/gems/fog-core-1.44.3/lib/fog/core/connection.rb:81:inrequest' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/gems/fog-softlayer-1.1.4/lib/fog/softlayer/slapi.rb:55:in slapi_request' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/gems/fog-softlayer-1.1.4/lib/fog/softlayer/compute.rb:137:inrequest' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/gems/fog-softlayer-1.1.4/lib/fog/softlayer/requests/compute/delete_vm.rb:36:in delete_vm' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/gems/fog-softlayer-1.1.4/lib/fog/softlayer/models/compute/server.rb:99:indestroy' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/gems/knife-softlayer-0.4.7/lib/chef/knife/softlayer_server_destroy.rb:106:in run' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/gems/chef-12.5.1/lib/chef/knife.rb:405:inblock in run_with_pretty_exceptions' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/gems/chef-12.5.1/lib/chef/local_mode.rb:44:in with_server_connectivity' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/gems/chef-12.5.1/lib/chef/knife.rb:404:inrun_with_pretty_exceptions' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/gems/chef-12.5.1/lib/chef/knife.rb:203:in run' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/gems/chef-12.5.1/lib/chef/application/knife.rb:142:inrun' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/gems/chef-12.5.1/bin/knife:25:in <top (required)>' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/bin/knife:23:inload' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/bin/knife:23:in <main>' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/bin/ruby_executable_hooks:15:ineval' 15:20:08 |   |   | /usr/local/rvm/gems/ruby-2.2.5/bin/ruby_executable_hooks:15:in `

'

](url)

allmightyspiff commented 4 years ago

I believe this issue was resolved on Tuesday, but if you are still getting this error can you provide the following?

1) The exact API call you are making. If your not comfortable posting that on the public internet, making a softlayer support ticket also works. 2) Having the knife-softlayer command you used is also helpful.

allmightyspiff commented 4 years ago

This looks to be related to an upgrade we are in the processes of doing, and should be resolved today.

allmightyspiff commented 4 years ago

This was resolved a bit ago, but for reference this was related to an upgrade we were doing. A misconfiguration in the newer loadbalancer caused some of these requests to be routed with a bad Host header. This only seems to have effected clients explicitly listing the port in the Host header, of which only the ruby client seems to be doing.

Should all be working now though, so no worries there.