You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Fail to deploy new instance from OSMr5 with fog05 vim plugin.
When instantiating ns-instance on fog05-vim an errors triggers when POST /flavor/add. Returns 500.
Error
May 29 10:39:19 fog05 fos_rest[19385]: Traceback (most recent call last):
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 2309, in call
May 29 10:39:19 fog05 fos_rest[19385]: return self.wsgi_app(environ, start_response)
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 2295, in wsgi_app
May 29 10:39:19 fog05 fos_rest[19385]: response = self.handle_exception(e)
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1741, in handle_exception
May 29 10:39:19 fog05 fos_rest[19385]: reraise(exc_type, exc_value, tb)
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/_compat.py", line 35, in reraise
May 29 10:39:19 fog05 fos_rest[19385]: raise value
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 2292, in wsgi_app
May 29 10:39:19 fog05 fos_rest[19385]: response = self.full_dispatch_request()
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1815, in full_dispatch_request
May 29 10:39:19 fog05 fos_rest[19385]: rv = self.handle_user_exception(e)
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1718, in handle_user_exception
May 29 10:39:19 fog05 fos_rest[19385]: reraise(exc_type, exc_value, tb)
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/_compat.py", line 35, in reraise
May 29 10:39:19 fog05 fos_rest[19385]: raise value
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1813, in full_dispatch_request
May 29 10:39:19 fog05 fos_rest[19385]: rv = self.dispatch_request()
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1799, in dispatch_request
May 29 10:39:19 fog05 fos_rest[19385]: return self.view_functionsrule.endpoint
May 29 10:39:19 fog05 fos_rest[19385]: File "/etc/fos/rest/service.py", line 274, in flavor_add
May 29 10:39:19 fog05 fos_rest[19385]: descriptor = json.loads(request.data)
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/lib/python3.5/json/init.py", line 312, in loads
May 29 10:39:19 fog05 fos_rest[19385]: s.class.name))
May 29 10:39:19 fog05 fos_rest[19385]: TypeError: the JSON object must be str, not 'bytes'
Desktop:
Ubuntu 16.04
OpenStack VM
The text was updated successfully, but these errors were encountered:
Thanks @miquelpuigmena for this bug report.
I guess that when the code of the REST Proxy was written request.data was returning str but now it returns bytes.
The fix should be easy as:
data = response.data
if isinstance(bytes,data):
data = data.decode()
descriptor = json.loads(data)
Will fix this in next pull request
gabrik
added a commit
to atolab/fog05
that referenced
this issue
Jun 12, 2019
Describe the bug
Fail to deploy new instance from OSMr5 with fog05 vim plugin.
When instantiating ns-instance on fog05-vim an errors triggers when POST /flavor/add. Returns 500.
Error
May 29 10:39:19 fog05 fos_rest[19385]: Traceback (most recent call last):
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 2309, in call
May 29 10:39:19 fog05 fos_rest[19385]: return self.wsgi_app(environ, start_response)
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 2295, in wsgi_app
May 29 10:39:19 fog05 fos_rest[19385]: response = self.handle_exception(e)
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1741, in handle_exception
May 29 10:39:19 fog05 fos_rest[19385]: reraise(exc_type, exc_value, tb)
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/_compat.py", line 35, in reraise
May 29 10:39:19 fog05 fos_rest[19385]: raise value
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 2292, in wsgi_app
May 29 10:39:19 fog05 fos_rest[19385]: response = self.full_dispatch_request()
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1815, in full_dispatch_request
May 29 10:39:19 fog05 fos_rest[19385]: rv = self.handle_user_exception(e)
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1718, in handle_user_exception
May 29 10:39:19 fog05 fos_rest[19385]: reraise(exc_type, exc_value, tb)
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/_compat.py", line 35, in reraise
May 29 10:39:19 fog05 fos_rest[19385]: raise value
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1813, in full_dispatch_request
May 29 10:39:19 fog05 fos_rest[19385]: rv = self.dispatch_request()
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1799, in dispatch_request
May 29 10:39:19 fog05 fos_rest[19385]: return self.view_functionsrule.endpoint
May 29 10:39:19 fog05 fos_rest[19385]: File "/etc/fos/rest/service.py", line 274, in flavor_add
May 29 10:39:19 fog05 fos_rest[19385]: descriptor = json.loads(request.data)
May 29 10:39:19 fog05 fos_rest[19385]: File "/usr/lib/python3.5/json/init.py", line 312, in loads
May 29 10:39:19 fog05 fos_rest[19385]: s.class.name))
May 29 10:39:19 fog05 fos_rest[19385]: TypeError: the JSON object must be str, not 'bytes'
Desktop:
The text was updated successfully, but these errors were encountered: