← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1626534] [NEW] request unsupport method to Placement API 500 returned

 

Public bug reported:

I get 500 return as below:

curl -g -i -X DELETE http://hp-pc:8778/placement/resource_providers -H
"User-Agent: python-novaclient" -H "Accept: application/json" -H "X
-Auth-Token: 79768b74827c40aebbcbf8c91e89e6cf"


HTTP/1.1 500 Internal Server Error
Date: Thu, 22 Sep 2016 12:54:10 GMT
Server: Apache/2.4.18 (Ubuntu)
Content-Length: 604
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at
 [no address given] to inform them of the time this error occurred,
 and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.4.18 (Ubuntu) Server at hp-pc Port 8778</address>
</body></html>


The error message get from server side:

2016-09-22 20:54:10.453 DEBUG nova.api.openstack.placement.requestlog [req-a70ddef7-745c-4fe6-84b6-e33f28b34af2 placement service] Starting request: 127.0.0.1 "DELETE /placement/resource_providers" from (pid=23252) __call__ /opt/stack/nova/nova/api/openstack/placement/requestlog.py:36
2016-09-22 20:54:10.638 ERROR nova.api.openstack.placement.handler [req-dbf43944-b6b6-4931-8754-b5d11bfe3974 admin admin] Uncaught exception
2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler Traceback (most recent call last):
2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler   File "/opt/stack/nova/nova/api/openstack/placement/handler.py", line 171, in __call__
2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler     try:
2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler   File "/opt/stack/nova/nova/api/openstack/placement/handler.py", line 98, in dispatch
2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler     return handler(environ, start_response)
2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler   File "/opt/stack/nova/nova/api/openstack/placement/handler.py", line 113, in handle_405
2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler     _('The method specified is not allowed for this resource.'),
2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler HTTPMethodNotAllowed: The method specified is not allowed for this resource.
2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler
2016-09-22 20:54:10.639 INFO nova.api.openstack.placement.requestlog [req-dbf43944-b6b6-4931-8754-b5d11bfe3974 admin admin] 127.0.0.1 "DELETE /placement/resource_providers" status: 405 len: 243
mod_wsgi (pid=23252): Exception occurred processing WSGI script '/usr/local/bin/nova-placement-api'.
Traceback (most recent call last):
  File "/opt/stack/nova/nova/api/openstack/placement/requestlog.py", line 38, in __call__
    return self._log_app(environ, start_response)
  File "/opt/stack/nova/nova/api/openstack/placement/requestlog.py", line 64, in _log_app
    return self.application(environ, replacement_start_response)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/webob/response.py", line 1037, in __call__
    start_response(self.status, headerlist)
  File "/opt/stack/nova/nova/api/openstack/placement/requestlog.py", line 62, in replacement_start_response
    return start_response(status, headers, exc_info)
TypeError: expected byte string object, value of type unicode found


This is due to the we have unicode in the response headers, in this case
the allow headers is unicode.

This is same as
https://groups.google.com/forum/?fromgroups=#!topic/modwsgi/HvD3TJbUkTc

** Affects: nova
     Importance: Undecided
     Assignee: Alex Xu (xuhj)
         Status: New

** Changed in: nova
     Assignee: (unassigned) => Alex Xu (xuhj)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1626534

Title:
  request unsupport method to Placement API 500 returned

Status in OpenStack Compute (nova):
  New

Bug description:
  I get 500 return as below:

  curl -g -i -X DELETE http://hp-pc:8778/placement/resource_providers -H
  "User-Agent: python-novaclient" -H "Accept: application/json" -H "X
  -Auth-Token: 79768b74827c40aebbcbf8c91e89e6cf"

  
  HTTP/1.1 500 Internal Server Error
  Date: Thu, 22 Sep 2016 12:54:10 GMT
  Server: Apache/2.4.18 (Ubuntu)
  Content-Length: 604
  Connection: close
  Content-Type: text/html; charset=iso-8859-1

  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  <html><head>
  <title>500 Internal Server Error</title>
  </head><body>
  <h1>Internal Server Error</h1>
  <p>The server encountered an internal error or
  misconfiguration and was unable to complete
  your request.</p>
  <p>Please contact the server administrator at
   [no address given] to inform them of the time this error occurred,
   and the actions you performed just before this error.</p>
  <p>More information about this error may be available
  in the server error log.</p>
  <hr>
  <address>Apache/2.4.18 (Ubuntu) Server at hp-pc Port 8778</address>
  </body></html>


  The error message get from server side:

  2016-09-22 20:54:10.453 DEBUG nova.api.openstack.placement.requestlog [req-a70ddef7-745c-4fe6-84b6-e33f28b34af2 placement service] Starting request: 127.0.0.1 "DELETE /placement/resource_providers" from (pid=23252) __call__ /opt/stack/nova/nova/api/openstack/placement/requestlog.py:36
  2016-09-22 20:54:10.638 ERROR nova.api.openstack.placement.handler [req-dbf43944-b6b6-4931-8754-b5d11bfe3974 admin admin] Uncaught exception
  2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler Traceback (most recent call last):
  2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler   File "/opt/stack/nova/nova/api/openstack/placement/handler.py", line 171, in __call__
  2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler     try:
  2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler   File "/opt/stack/nova/nova/api/openstack/placement/handler.py", line 98, in dispatch
  2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler     return handler(environ, start_response)
  2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler   File "/opt/stack/nova/nova/api/openstack/placement/handler.py", line 113, in handle_405
  2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler     _('The method specified is not allowed for this resource.'),
  2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler HTTPMethodNotAllowed: The method specified is not allowed for this resource.
  2016-09-22 20:54:10.638 TRACE nova.api.openstack.placement.handler
  2016-09-22 20:54:10.639 INFO nova.api.openstack.placement.requestlog [req-dbf43944-b6b6-4931-8754-b5d11bfe3974 admin admin] 127.0.0.1 "DELETE /placement/resource_providers" status: 405 len: 243
  mod_wsgi (pid=23252): Exception occurred processing WSGI script '/usr/local/bin/nova-placement-api'.
  Traceback (most recent call last):
    File "/opt/stack/nova/nova/api/openstack/placement/requestlog.py", line 38, in __call__
      return self._log_app(environ, start_response)
    File "/opt/stack/nova/nova/api/openstack/placement/requestlog.py", line 64, in _log_app
      return self.application(environ, replacement_start_response)
    File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
      return resp(environ, start_response)
    File "/usr/local/lib/python2.7/dist-packages/webob/response.py", line 1037, in __call__
      start_response(self.status, headerlist)
    File "/opt/stack/nova/nova/api/openstack/placement/requestlog.py", line 62, in replacement_start_response
      return start_response(status, headers, exc_info)
  TypeError: expected byte string object, value of type unicode found


  This is due to the we have unicode in the response headers, in this
  case the allow headers is unicode.

  This is same as
  https://groups.google.com/forum/?fromgroups=#!topic/modwsgi/HvD3TJbUkTc

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