← Back to team overview

yahoo-eng-team team mailing list archive

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

 

Reviewed:  https://review.opendev.org/744035
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=e92193d246c8ea30d42a064297bb7a1955c62a98
Submitter: Zuul
Branch:    master

commit e92193d246c8ea30d42a064297bb7a1955c62a98
Author: Dan Radez <dradez@xxxxxxxxxx>
Date:   Thu Jul 30 15:21:34 2020 -0400

    Updating the pecan version requirement
    
    There's a fix in pecan 1.4 to handle accept headers that have
    extra parameters included.
    
    Closes-Bug: #1829042
    Change-Id: Id7d78d77da8dfd1620936e437d862c1d60e8eb25


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
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:
  Fix Released

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


References