← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1829042] [NEW] Some API requests (GET networks) fail with "Accept: application/json; charset=utf-8" header and WebOb>=1.8.0

 

Public bug reported:

Original downstream bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1706222

On versions newer than Rocky, we have WebOb 1.8 in requirements. This causes the following API calls to end with 500 error:
GET http://localhost:9696/v2.0/ports
GET http://localhost:9696/v2.0/subnets
GET http://localhost:9696/v2.0/networks

when setting an Accept header with charset like "Accept:
application/json; charset=utf-8"

These calls do not go through neutron.api.v2 and wsgi.request as other
resources, is it something that should be fixed too?

To reproduce (on master too):
$ curl -s -H "Accept: application/json; charset=utf-8" -H "X-Auth-Token: $OS_TOKEN" "http://localhost:9696/v2.0/ports"; | python -mjson.tool        
{
    "NeutronError": {
        "detail": "",
        "message": "The server could not comply with the request since it is either malformed or otherwise incorrect.",
        "type": "HTTPNotAcceptable"
    }
}

mai 14 18:16:19 devstack neutron-server[1519]: DEBUG neutron.wsgi [-] (1533) accepted ('127.0.0.1', 47790) {{(pid=1533) server /usr/lib/python2.7/site-packages/eventlet/wsgi.py:956}}
mai 14 18:16:19 devstack neutron-server[1519]: ERROR pecan.core [None req-0848fbc9-5c8a-4713-b436-029814f89a32 None demo] content type None
mai 14 18:16:19 devstack neutron-server[1519]: ERROR pecan.core [None req-0848fbc9-5c8a-4713-b436-029814f89a32 None demo] Controller 'index' defined does not support content_type 'None'. Supported type(s): ['application/json']
mai 14 18:16:19 devstack neutron-server[1519]: INFO neutron.pecan_wsgi.hooks.translation [None req-0848fbc9-5c8a-4713-b436-029814f89a32 None demo] GET failed (client error): The server could not comply with the request since it is either malformed or otherwise incorrect.
mai 14 18:16:19 devstack neutron-server[1519]: INFO neutron.wsgi [None req-0848fbc9-5c8a-4713-b436-029814f89a32 None demo] 127.0.0.1 "GET /v2.0/ports HTTP/1.1" status: 406  len: 360 time: 0.2243972

Relevant WebOb warning:
https://github.com/Pylons/webob/blob/master/docs/whatsnew-1.8.txt#L24

** Affects: neutron
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1829042

Title:
  Some API requests (GET networks) fail with "Accept: application/json;
  charset=utf-8" header and WebOb>=1.8.0

Status in neutron:
  New

Bug description:
  Original downstream bug:
  https://bugzilla.redhat.com/show_bug.cgi?id=1706222

  On versions newer than Rocky, we have WebOb 1.8 in requirements. This causes the following API calls to end with 500 error:
  GET http://localhost:9696/v2.0/ports
  GET http://localhost:9696/v2.0/subnets
  GET http://localhost:9696/v2.0/networks

  when setting an Accept header with charset like "Accept:
  application/json; charset=utf-8"

  These calls do not go through neutron.api.v2 and wsgi.request as other
  resources, is it something that should be fixed too?

  To reproduce (on master too):
  $ curl -s -H "Accept: application/json; charset=utf-8" -H "X-Auth-Token: $OS_TOKEN" "http://localhost:9696/v2.0/ports"; | python -mjson.tool        
  {
      "NeutronError": {
          "detail": "",
          "message": "The server could not comply with the request since it is either malformed or otherwise incorrect.",
          "type": "HTTPNotAcceptable"
      }
  }

  mai 14 18:16:19 devstack neutron-server[1519]: DEBUG neutron.wsgi [-] (1533) accepted ('127.0.0.1', 47790) {{(pid=1533) server /usr/lib/python2.7/site-packages/eventlet/wsgi.py:956}}
  mai 14 18:16:19 devstack neutron-server[1519]: ERROR pecan.core [None req-0848fbc9-5c8a-4713-b436-029814f89a32 None demo] content type None
  mai 14 18:16:19 devstack neutron-server[1519]: ERROR pecan.core [None req-0848fbc9-5c8a-4713-b436-029814f89a32 None demo] Controller 'index' defined does not support content_type 'None'. Supported type(s): ['application/json']
  mai 14 18:16:19 devstack neutron-server[1519]: INFO neutron.pecan_wsgi.hooks.translation [None req-0848fbc9-5c8a-4713-b436-029814f89a32 None demo] GET failed (client error): The server could not comply with the request since it is either malformed or otherwise incorrect.
  mai 14 18:16:19 devstack neutron-server[1519]: INFO neutron.wsgi [None req-0848fbc9-5c8a-4713-b436-029814f89a32 None demo] 127.0.0.1 "GET /v2.0/ports HTTP/1.1" status: 406  len: 360 time: 0.2243972

  Relevant WebOb warning:
  https://github.com/Pylons/webob/blob/master/docs/whatsnew-1.8.txt#L24

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1829042/+subscriptions


Follow ups