Ask Your Question

Cannot delete image with Swift backend

asked 2011-04-26 16:06:52 -0500

ethuleau gravatar image


I use Glance bzr124 on a ubuntu 10.04 LTS with a backend Swift 1.2.0. I can upload and list files on the object store but when I tried to delete one, I've got this error :

$ glance delete 1

Delete image 1? [y/N] y Traceback (most recent call last): File "/usr/bin/glance", line 605, in <module> result = command(options, args) File "/usr/bin/glance", line 327, in image_delete c.delete_image(image_id) File "/usr/lib/pymodules/python2.6/glance/", line 289, in delete_image self.do_request("DELETE", "/images/%s" % image_id) File "/usr/lib/pymodules/python2.6/glance/", line 161, in do_request raise Exception("Internal Server error: %s" % Exception: Internal Server error: Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/eventlet/", line 336, in handle_one_response result = self.application(self.environ, start_response) File "/usr/lib/pymodules/python2.6/webob/", line 159, in __call__ return resp(environ, start_response) File "/usr/lib/pymodules/python2.6/routes/", line 131, in __call__ response =, start_response) File "/usr/lib/pymodules/python2.6/webob/", line 159, in __call__ return resp(environ, start_response) File "/usr/lib/pymodules/python2.6/webob/", line 147, in __call__ resp = self.call_func(req, args, self.kwargs) File "/usr/lib/pymodules/python2.6/webob/", line 208, in call_func return self.func(req, *args, *kwargs) File "/usr/lib/pymodules/python2.6/glance/common/", line 228, in __call__ result = method(arg_dict) File "/usr/lib/pymodules/python2.6/glance/", line 456, in delete delete_from_backend(image['location']) File "/usr/lib/pymodules/python2.6/glance/store/", line 94, in delete_from_backend return backend_class.delete(parsed_uri, **kwargs) File "/usr/lib/pymodules/python2.6/glance/store/", line 180, in delete swift_conn.delete_object(container, obj) File "/usr/lib/pymodules/python2.6/swift/common/", line 839, in delete_object return self._retry(None, delete_object, container, obj) File "/usr/lib/pymodules/python2.6/swift/common/", line 734, in _retry self.url, self.token = self.get_auth() File "/usr/lib/pymodules/python2.6/swift/common/", line 722, in get_auth return get_auth(self.authurl, self.user, self.key, snet=self.snet) File "/usr/lib/pymodules/python2.6/swift/common/", line 177, in get_auth parsed, conn = http_connection(url) File "/usr/lib/pymodules/python2.6/swift/common/", line 153, in http_connection conn = HTTPSConnection(parsed.netloc) File "/usr/lib/python2.6/", line 1101, in __init__ HTTPConnection.__init__(self, host, port, strict, timeout) File "/usr/lib/python2.6/", line 657, in __init__ self._set_hostport(host, port) File "/usr/lib/python2.6/", line 682, in _set_hostport raise InvalidURL("nonnumeric port: '%s'" % host[i+1:]) InvalidURL: nonnumeric port: ''

In the log file of glance (registery + API) :

2011-04-26 18:05:08 DEBUG [routes.middleware] Matched DELETE /images/1 2011-04-26 18:05:08 DEBUG [routes.middleware] Route path: '/images/:(id)', defaults: {'action': u'delete', 'controller': <glance.server ... (more)

edit retag flag offensive close merge delete

5 answers

Sort by » oldest newest most voted

answered 2011-04-27 14:48:35 -0500

jaypipes gravatar image

Hi Edouard!

It looks like our URL parser isn't properly parsing "swift://glance:ethuleau:nah2eeBo@https://p-hs21-15-swift-proxy-1:11000/v1.0//glance/1" and picking up that 11000 is the port.

I'll turn this into a bug and get to fixing it. :)

Cheers! jay

edit flag offensive delete link more

answered 2011-04-27 16:06:52 -0500

jaypipes gravatar image

Hey again,

Could you paste your glance.conf. Thanks!


edit flag offensive delete link more

answered 2011-08-04 09:10:44 -0500

ethuleau gravatar image


edit flag offensive delete link more

answered 2011-04-27 14:58:28 -0500

ethuleau gravatar image

Hi Jay,

Thanks for your answer and your future fix.

I have the same error when Nova tries to get an image from Glance repository.

Regards, Édouard.

edit flag offensive delete link more

answered 2011-04-28 07:44:28 -0500

ethuleau gravatar image

My Glance configuration :

[DEFAULT] verbose = True

debug = True

log_config = /etc/glance/logging.cnf log_file = /var/log/glance/glance.log log_dir = /var/log/glance/

[app:glance-api] paste.app_factory = glance.server:app_factory

default_store = swift

bind_host = bind_port = 9292

registry_host = registry_port = 9191

swift_store_auth_address = https://p-hs21-15-swift-proxy-1:11000/v1.0/ (https://p-hs21-15-swift-proxy-1:11000...) swift_store_user = glance:ethuleau swift_store_key = nah2eeBo swift_store_container = glance swift_store_create_container_on_put = True

[app:glance-registry] paste.app_factory = glance.registry.server:app_factory

bind_host = bind_port = 9191

sql_connection=mysql://root:nova@ sql_idle_timeout = 3600

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2011-04-26 16:06:52 -0500

Seen: 361 times

Last updated: Aug 04 '11