Public bug reported:

md-* create and update apis are returning 500 error when you pass 4
bytes unicode characters in the request.

Steps to reproduce:

$ glance md-object-create --schema '{}' --name 🚓 <namespace>

or

$ curl -g -i -X POST
http://172.31.21.75:9292/v2/metadefs/namespaces/OS::Glance::CommonImageProperties/objects
-H "User-Agent: python-glanceclient" -H "Content-Type: application/json"
-H "X-Auth-Token: 79e33042569e4c128945d623c3228ca6" -d '{"name":
"\ud83d\ude93"}'

Result:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/shell.py", line 
595, in main
    args.func(client, args)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/shell.py", line 
898, in do_md_tag_update
    **fields)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/metadefs.py", 
line 461, in update
    self.http_client.put(url, data=tag)
  File "/usr/local/lib/python2.7/dist-packages/keystoneclient/adapter.py", line 
185, in put
    return self.request(url, 'PUT', **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", 
line 332, in request
    return self._handle_response(resp)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", 
line 83, in _handle_response
    raise exc.from_response(resp, resp.content)
HTTPInternalServerError: 500 Internal Server Error: The server has either erred 
or is incapable of
performing the requested operation. (HTTP 500) 500 Internal Server Error: The 
server has either erred or is
incapable of performing the requested operation. (HTTP 500)

List of APIs failing:

1. md-namespace-create
2. md-namespace-update
3. md-property-create
4. md-property-update
5. md-object-create
6. md-object-update
7. md-tag-create
8. md-tag-update

** Affects: glance
     Importance: Undecided
     Assignee: Bhagyashri Shewale (bhagyashri-shewale)
         Status: New

** Changed in: glance
     Assignee: (unassigned) => Bhagyashri Shewale (bhagyashri-shewale)

** Description changed:

  md-* create and update apis are returning 500 error when you pass 4
  bytes unicode characters in the request.
  
  Steps to reproduce:
  
  $ glance md-object-create --schema '{}' --name 🚓 <namespace>
  
  or
  
- $ curl -g -i -X POST 
http://172.31.21.75:9292/v2/metadefs/namespaces/OS::Glance::CommonImageProperties/objects
 
-   -H "User-Agent: python-glanceclient" -H "Content-Type: application/json" 
-   -H "X-Auth-Token: 79e33042569e4c128945d623c3228ca6" -d '{"name": 
"\ud83d\ude93"}'
+ $ curl -g -i -X POST
+ 
http://172.31.21.75:9292/v2/metadefs/namespaces/OS::Glance::CommonImageProperties/objects
+ -H "User-Agent: python-glanceclient" -H "Content-Type: application/json"
+ -H "X-Auth-Token: 79e33042569e4c128945d623c3228ca6" -d '{"name":
+ "\ud83d\ude93"}'
  
  Result:
  
  Traceback (most recent call last):
-   File "/usr/local/lib/python2.7/dist-packages/glanceclient/shell.py", line 
595, in main
-     args.func(client, args)
-   File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/shell.py", 
line 898, in do_md_tag_update
-     **fields)
-   File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/metadefs.py", 
line 461, in update
-     self.http_client.put(url, data=tag)
-   File "/usr/local/lib/python2.7/dist-packages/keystoneclient/adapter.py", 
line 185, in put
-     return self.request(url, 'PUT', **kwargs)
-   File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", 
line 332, in request
-     return self._handle_response(resp)
-   File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", 
line 83, in _handle_response
-     raise exc.from_response(resp, resp.content)
- HTTPInternalServerError: 500 Internal Server Error: The server has either 
erred or is incapable of 
- performing the requested operation. (HTTP 500) 500 Internal Server Error: The 
server has either erred or is 
+   File "/usr/local/lib/python2.7/dist-packages/glanceclient/shell.py", line 
595, in main
+     args.func(client, args)
+   File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/shell.py", 
line 898, in do_md_tag_update
+     **fields)
+   File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/metadefs.py", 
line 461, in update
+     self.http_client.put(url, data=tag)
+   File "/usr/local/lib/python2.7/dist-packages/keystoneclient/adapter.py", 
line 185, in put
+     return self.request(url, 'PUT', **kwargs)
+   File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", 
line 332, in request
+     return self._handle_response(resp)
+   File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", 
line 83, in _handle_response
+     raise exc.from_response(resp, resp.content)
+ HTTPInternalServerError: 500 Internal Server Error: The server has either 
erred or is incapable of
+ performing the requested operation. (HTTP 500) 500 Internal Server Error: The 
server has either erred or is
  incapable of performing the requested operation. (HTTP 500)
  
  List of APIs failing:
  
  1. md-namespace-create
  2. md-namespace-update
  3. md-property-create
  4. md-property-update
  5. md-object-create
  6. md-object-update
  7. md-tag-create
  8. md-tag-update

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

Title:
  various md-* create and update api's return 500 error if 4 bytes
  unicode characters is passed

Status in Glance:
  New

Bug description:
  md-* create and update apis are returning 500 error when you pass 4
  bytes unicode characters in the request.

  Steps to reproduce:

  $ glance md-object-create --schema '{}' --name 🚓 <namespace>

  or

  $ curl -g -i -X POST
  
http://172.31.21.75:9292/v2/metadefs/namespaces/OS::Glance::CommonImageProperties/objects
  -H "User-Agent: python-glanceclient" -H "Content-Type:
  application/json" -H "X-Auth-Token: 79e33042569e4c128945d623c3228ca6"
  -d '{"name": "\ud83d\ude93"}'

  Result:

  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/glanceclient/shell.py", line 
595, in main
      args.func(client, args)
    File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/shell.py", 
line 898, in do_md_tag_update
      **fields)
    File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/metadefs.py", 
line 461, in update
      self.http_client.put(url, data=tag)
    File "/usr/local/lib/python2.7/dist-packages/keystoneclient/adapter.py", 
line 185, in put
      return self.request(url, 'PUT', **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", 
line 332, in request
      return self._handle_response(resp)
    File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", 
line 83, in _handle_response
      raise exc.from_response(resp, resp.content)
  HTTPInternalServerError: 500 Internal Server Error: The server has either 
erred or is incapable of
  performing the requested operation. (HTTP 500) 500 Internal Server Error: The 
server has either erred or is
  incapable of performing the requested operation. (HTTP 500)

  List of APIs failing:

  1. md-namespace-create
  2. md-namespace-update
  3. md-property-create
  4. md-property-update
  5. md-object-create
  6. md-object-update
  7. md-tag-create
  8. md-tag-update

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

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to