unable to create images using glance api request

asked 2016-10-12 06:12:39 -0600

DarkKnight gravatar image

updated 2016-10-12 06:37:05 -0600

I am following the documentation at API-Documentation. I am hitting a post request to upload a new image in the glance. I am getting the 500 error and below error message in my glance-api.log

========

curl -i -H "Content-Type: application/octet-stream" -H "X-Auth-Token:d673cc8cddd24732bd2801cb5b3e00e3" -H "x-image-meta-disk-format:qcow2" -H "x-image-meta-container-format:bare" -H "x-image-meta-name:sigtemplate" --data-binary /opt/sigtemplate.qcow2 http://10.1.10.22:9292/v1/images

This is the error message that it gives HTTP/1.1 500 Internal Server Error Content-Length: 228 Content-Type: text/html; charset=UTF-8 X-Openstack-Request-Id: req-735280e9-7f16-496a-9950-1dfa5dc20dc0 Date: Wed, 12 Oct 2016 10:55:49 GMT

<html> <head> <title>500 Internal Server Error</title> </head> <body>

500 Internal Server Error

The server has either erred or is incapable of performing the requested operation.

</body> </html>

[root@localhost opt(keystone_admin)]# ===================== I checked the glance-api logs and found this traceback

2016-10-12 16:25:49.297 9700 ERROR glance.common.wsgi     'exc_name': exc_name})
2016-10-12 16:25:49.297 9700 ERROR glance.common.wsgi   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-10-12 16:25:49.297 9700 ERROR glance.common.wsgi     self.force_reraise()
2016-10-12 16:25:49.297 9700 ERROR glance.common.wsgi   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-10-12 16:25:49.297 9700 ERROR glance.common.wsgi     six.reraise(self.type_, self.value, self.tb)
2016-10-12 16:25:49.297 9700 ERROR glance.common.wsgi   File "/usr/lib/python2.7/site-packages/glance/registry/client/v1/client.py", line 123, in do_request
2016-10-12 16:25:49.297 9700 ERROR glance.common.wsgi     **kwargs)
2016-10-12 16:25:49.297 9700 ERROR glance.common.wsgi   File "/usr/lib/python2.7/site-packages/glance/common/client.py", line 70, in wrapped
2016-10-12 16:25:49.297 9700 ERROR glance.common.wsgi     return func(self, *args, **kwargs)
2016-10-12 16:25:49.297 9700 ERROR glance.common.wsgi   File "/usr/lib/python2.7/site-packages/glance/common/client.py", line 373, in do_request
2016-10-12 16:25:49.297 9700 ERROR glance.common.wsgi     headers=copy.deepcopy(headers))
2016-10-12 16:25:49.297 9700 ERROR glance.common.wsgi   File "/usr/lib/python2.7/site-packages/glance/common/client.py", line 87, in wrapped
2016-10-12 16:25:49.297 9700 ERROR glance.common.wsgi     return func(self, method, url, body, headers)
2016-10-12 16:25:49.297 9700 ERROR glance.common.wsgi   File "/usr/lib/python2.7/site-packages/glance/common/client.py", line 528, in _do_request
2016-10-12 16:25:49.297 9700 ERROR glance.common.wsgi     elif status_code == http_client.NOT_FOUND:
2016-10-12 16:25:49.297 9700 ERROR glance.common.wsgi NotFound: Image not found
2016-10-12 16:25:49.297 9700 ERROR glance.common.wsgi
2016-10-12 16:25:49.302 9700 INFO eventlet.wsgi.server [req-735280e9-7f16-496a-9950-1dfa5dc20dc0 5febd1e767a84492b138a74ad1ee9af2 - - - -] 10.1.10.22 - - [12/Oct/2016 16:25:49] "POST /v1/images HTTP/1.1" 500 430 0.299338
2016-10-12 16:25:50.343 9715 DEBUG eventlet.wsgi.server [-] (9715) accepted ('10.1.10.22', 45377) server /usr/lib/python2.7/site-packages ...


(more)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-10-12 09:44:53 -0600

The key there is '**Access denied to image 667f268f-1f26-4b61-a994-4a4c66095700' - your Glance user doesn't have permission to modify files on whatever image store Glance is using.

If you're just using local storage, this may just be that /var/lib/glance/images isn't owned by the 'glance' user. If you're using an NFS mount or some other backend, your permissions aren't quite open enough for this to work. :)

edit flag offensive delete link more

Comments

[root@localhost glance(keystone_admin)]# ls -lrth total 4.0K drwxr-x---. 2 glance glance 4.0K Oct 12 15:53 images /var/lib/glance --> pwd

Can you suggest why is this permission issue popping in while i am issuing the curl command? And more importantly, how to fix that??

DarkKnight gravatar imageDarkKnight ( 2016-10-13 00:13:00 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2016-10-12 06:12:39 -0600

Seen: 559 times

Last updated: Oct 12 '16