Skip to content

Instantly share code, notes, and snippets.

@krames
Created June 20, 2013 18:07
Show Gist options
  • Select an option

  • Save krames/5825111 to your computer and use it in GitHub Desktop.

Select an option

Save krames/5825111 to your computer and use it in GitHub Desktop.
Hitting Cloud Block Storage with invalid authentication token. I expected a HTTP 401 instead of a 503. I was also wondering why the body of the response comes back as html rather than JSON.
excon.request {:chunk_size=>1048576, :connect_timeout=>60, :debug_request=>true, :debug_response=>true, :headers=>{"User-Agent"=>"fog/1.12.1", "Content-Type"=>"application/json", "Accept"=>"application/json",
"X-Auth-Token"=>"bad token", "Host"=>"ord.blockstorage.api.rackspacecloud.com:443"}, :idempotent=>false, :instrumentor_name=>"excon", :middlewares=>[Excon::Middleware::Expects, Excon::Middleware::Idempotent,
Excon::Middleware::Instrumentor, Excon::Middleware::Mock], :mock=>false, :nonblock=>true, :omit_default_port=>false, :read_timeout=>60, :retry_limit=>4,
:ssl_ca_file=>"/Users/kyle.rames/.rvm/gems/ruby-1.9.3-p392@fog_dev/gems/excon-0.24.0/data/cacert.pem", :ssl_verify_peer=>true, :tcp_nodelay=>false, :uri_parser=>URI, :write_timeout=>60,
:host=>"ord.blockstorage.api.rackspacecloud.com", :path=>"/v1/772045/volumes", :port=>"443", :query=>nil, :scheme=>"https", :user=>nil, :password=>"REDACTED", :instrumentor=>Excon::StandardInstrumentor, :expects=>[200],
:method=>"GET", :retries_remaining=>4, :connection=>#<Excon::Connection:7fed9c1d2810 @data={:chunk_size=>1048576, :connect_timeout=>60, :debug_request=>true, :debug_response=>true, :headers=>{"User-Agent"=>"fog/1.12.1"},
:idempotent=>false, :instrumentor_name=>"excon", :middlewares=>[Excon::Middleware::Expects, Excon::Middleware::Idempotent, Excon::Middleware::Instrumentor, Excon::Middleware::Mock], :mock=>false, :nonblock=>true,
:omit_default_port=>false, :read_timeout=>60, :retry_limit=>4, :ssl_ca_file=>"/Users/kyle.rames/.rvm/gems/ruby-1.9.3-p392@fog_dev/gems/excon-0.24.0/data/cacert.pem", :ssl_verify_peer=>true, :tcp_nodelay=>false,
:uri_parser=>URI, :write_timeout=>60, :host=>"ord.blockstorage.api.rackspacecloud.com", :path=>"/v1/772045", :port=>"443", :query=>nil, :scheme=>"https", :user=>nil, :password=>nil,
:instrumentor=>Excon::StandardInstrumentor} @socket_key="https://ord.blockstorage.api.rackspacecloud.com:443">, :stack=>#<Excon::Middleware::Expects:0x007fed9d119260 @stack=#<Excon::Middleware::Idempotent:0x007fed9d1192b0
@stack=#<Excon::Middleware::Instrumentor:0x007fed9d1192d8 @stack=#<Excon::Middleware::Mock:0x007fed9d119300 @stack=#<Excon::Connection:7fed9c1d2810 @data={:chunk_size=>1048576, :connect_timeout=>60, :debug_request=>true,
:debug_response=>true, :headers=>{"User-Agent"=>"fog/1.12.1"}, :idempotent=>false, :instrumentor_name=>"excon", :middlewares=>[Excon::Middleware::Expects, Excon::Middleware::Idempotent, Excon::Middleware::Instrumentor,
Excon::Middleware::Mock], :mock=>false, :nonblock=>true, :omit_default_port=>false, :read_timeout=>60, :retry_limit=>4, :ssl_ca_file=>"/Users/kyle.rames/.rvm/gems/ruby-1.9.3-p392@fog_dev/gems/excon-0.24.0/data/cacert.pem",
:ssl_verify_peer=>true, :tcp_nodelay=>false, :uri_parser=>URI, :write_timeout=>60, :host=>"ord.blockstorage.api.rackspacecloud.com", :path=>"/v1/772045", :port=>"443", :query=>nil, :scheme=>"https", :user=>nil,
:password=>nil, :instrumentor=>Excon::StandardInstrumentor} @socket_key="https://ord.blockstorage.api.rackspacecloud.com:443">>>>>}
excon.error {:error=>#<Excon::Errors::ServiceUnavailable: Expected([200]) <=> Actual(503 Service Unavailable) request => {:chunk_size=>1048576, :connect_timeout=>60, :debug_request=>true, :debug_response=>true,
:headers=>{"User-Agent"=>"fog/1.12.1", "Content-Type"=>"application/json", "Accept"=>"application/json", "X-Auth-Token"=>"bad token", "Host"=>"ord.blockstorage.api.rackspacecloud.com:443"}, :idempotent=>false,
:instrumentor_name=>"excon", :middlewares=>[Excon::Middleware::Expects, Excon::Middleware::Idempotent, Excon::Middleware::Instrumentor, Excon::Middleware::Mock], :mock=>false, :nonblock=>true, :omit_default_port=>false,
:read_timeout=>60, :retry_limit=>4, :ssl_ca_file=>"/Users/kyle.rames/.rvm/gems/ruby-1.9.3-p392@fog_dev/gems/excon-0.24.0/data/cacert.pem", :ssl_verify_peer=>true, :tcp_nodelay=>false, :uri_parser=>URI, :write_timeout=>60,
:host=>"ord.blockstorage.api.rackspacecloud.com", :path=>"/v1/772045/volumes", :port=>"443", :query=>nil, :scheme=>"https", :user=>nil, :password=>nil, :instrumentor=>Excon::StandardInstrumentor, :expects=>[200],
:method=>"GET", :retries_remaining=>4} response => #<Excon::Response:0x007fed9d12ab50 @data={:body=>"503 Service Unavailable\n\nThe server is currently unavailable. Please try again at a later time.\n\n ",
:headers=>{"Content-Length"=>"100", "Content-Type"=>"text/plain; charset=UTF-8", "Date"=>"Thu, 20 Jun 2013 18:00:48 GMT"}, :status=>503, :remote_ip=>"198.101.174.122"}, @body="503 Service Unavailable\n\nThe server is
currently unavailable. Please try again at a later time.\n\n ", @headers={"Content-Length"=>"100", "Content-Type"=>"text/plain; charset=UTF-8", "Date"=>"Thu, 20 Jun 2013 18:00:48 GMT"}, @status=503,
@remote_ip="198.101.174.122">>}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment