Custom Search

Wednesday, December 9, 2015

cinder create volume from image JSONDecodeError: Expecting value: line 1 column 1 (char 0)

1)
# cinder create --image-id 8f980b10-b491-41c3-bd48-a84001929840 --display-name cirros1 1
ERROR: Internal Server Error (HTTP 500) (Request-ID: req-410318bc-9a39-4cbc-8401-2037ec5d1d53)

2)
Fix:
#vim /usr/lib/python2.7/dist-packages/glanceclient/common/http.py

class HTTPClient(object):

    def __init__(self, endpoint, **kwargs):
        if self.endpoint.startswith("https"):
            #compression = kwargs.get('ssl_compression', True)
            compression = True

* Comment the line "compression = kwargs.get('ssl_compression', True)", then set "compression = True"

* Restart glance-api, glance-registry, cinder-api, cinder-volume, cinder-scheduler

3)
/var/log/upstart/cinder-api.log

2015-08-06 14:23:26.296 36113 DEBUG glanceclient.common.http [req-ddb757de-85f5-4a1e-9999-36bff3afae7f - - - - -] curl -i -X GET -H 'User-Agent: python-glanceclient' -H 'Content-Type: application/octet-stream' -H 'Accept-Encoding: gzip, deflate, compress' -H 'Accept: */*' -H 'X-Auth-Token: {SHA1}e6717209a08a3b895581176f415a3b34c8264e40'  --cert None --key None glance+https://image.jiocloud.com:9292/v2/images/8f980b10-b491-41c3-bd48-a84001929840 log_curl_request /usr/lib/python2.7/dist-packages/glanceclient/common/http.py:122
2015-08-06 14:23:26.369 36113 DEBUG glanceclient.common.http [req-ddb757de-85f5-4a1e-9999-36bff3afae7f - - - - -]
HTTP/1.1 200 OK
content-length: 699
via: 1.1 image.jiocloud.com:9292
access-control-expose-headers: Accept, Content-Type, X-Auth-Token, X-Subject-Token
server: Apache/2.4.7 (Ubuntu)
access-control-allow-headers: Accept, Content-Type, X-Auth-Token, X-Subject-Token
connection: close
date: Thu, 06 Aug 2015 14:23:26 GMT
access-control-allow-origin: *
access-control-allow-methods: GET POST OPTIONS PUT DELETE PATCH
content-type: application/json; charset=UTF-8
x-openstack-request-id: req-7670140c-8334-4148-b9f3-d3d9845c11c9
 log_http_response /usr/lib/python2.7/dist-packages/glanceclient/common/http.py:135
2015-08-06 14:23:26.371 36113 DEBUG taskflow.engines.action_engine.runner [req-ddb757de-85f5-4a1e-9999-36bff3afae7f - - - - -] Exiting old state 'SCHEDULING' in response to event 'wait_finished' on_exit /usr/lib/python2.7/dist-packages/taskflow/engines/action_engine/runner.py:201
2015-08-06 14:23:26.371 36113 DEBUG taskflow.engines.action_engine.runner [req-ddb757de-85f5-4a1e-9999-36bff3afae7f - - - - -] Entering new state 'WAITING' in response to event 'wait_finished' on_enter /usr/lib/python2.7/dist-packages/taskflow/engines/action_engine/runner.py:205
2015-08-06 14:23:26.371 36113 DEBUG taskflow.engines.action_engine.runner [req-ddb757de-85f5-4a1e-9999-36bff3afae7f - - - - -] Exiting old state 'WAITING' in response to event 'examine_finished' on_exit /usr/lib/python2.7/dist-packages/taskflow/engines/action_engine/runner.py:201
2015-08-06 14:23:26.372 36113 DEBUG taskflow.engines.action_engine.runner [req-ddb757de-85f5-4a1e-9999-36bff3afae7f - - - - -] Entering new state 'ANALYZING' in response to event 'examine_finished' on_enter /usr/lib/python2.7/dist-packages/taskflow/engines/action_engine/runner.py:205
2015-08-06 14:23:26.372 36113 WARNING cinder.volume.api [req-ddb757de-85f5-4a1e-9999-36bff3afae7f - - - - -] Task 'cinder.volume.flows.api.create_volume.ExtractVolumeRequestTask;volume:create' (14e19665-b4a7-4f40-8ce9-1aa00d1e374a) transitioned into state 'FAILURE' from state 'RUNNING'
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api Traceback (most recent call last):
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api   File "/usr/lib/python2.7/dist-packages/taskflow/engines/action_engine/executor.py", line 67, in _execute_task
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api     result = task.execute(**arguments)
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api   File "/usr/lib/python2.7/dist-packages/cinder/volume/flows/api/create_volume.py", line 417, in execute
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api     self._check_image_metadata(context, image_id, size)
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api   File "/usr/lib/python2.7/dist-packages/cinder/volume/flows/api/create_volume.py", line 251, in _check_image_metadata
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api     image_meta = self.image_service.show(context, image_id)
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api   File "/usr/lib/python2.7/dist-packages/cinder/image/glance.py", line 237, in show
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api     _reraise_translated_image_exception(image_id)
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api   File "/usr/lib/python2.7/dist-packages/cinder/image/glance.py", line 235, in show
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api     image = self._client.call(context, 'get', image_id)
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api   File "/usr/lib/python2.7/dist-packages/cinder/image/glance.py", line 176, in call
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api     return getattr(client.images, method)(*args, **kwargs)
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api   File "/usr/lib/python2.7/dist-packages/glanceclient/v2/images.py", line 102, in get
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api     resp, body = self.http_client.get(url)
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api   File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 261, in get
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api     return self._request('GET', url, **kwargs)
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api   File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 248, in _request
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api     body_iter = resp.json()
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api   File "/usr/lib/python2.7/dist-packages/requests/models.py", line 741, in json
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api     return json.loads(self.text, **kwargs)
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api   File "/usr/lib/python2.7/dist-packages/simplejson/__init__.py", line 488, in loads
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api     return _default_decoder.decode(s)
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api   File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 370, in decode
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api     obj, end = self.raw_decode(s)
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api   File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 389, in raw_decode
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api     return self.scan_once(s, idx=_w(s, idx).end())
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2015-08-06 14:23:26.372 36113 TRACE cinder.volume.api
2015-08-06 14:23:26.374 36113 DEBUG taskflow.engines.action_engine.runner [req-ddb757de-85f5-4a1e-9999-36bff3afae7f - - - - -] Discarding failure 'Failure: simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1 (char 0)' (in response to event 'executed') under completion units request during completion of node 'cinder.volume.flows.api.create_volume.ExtractVolumeRequestTask;volume:create==1.0' (intention is to REVERT) analyze /usr/lib/python2.7/dist-packages/taskflow/engines/action_engine/runner.py:181

No comments:

Post a Comment