glance-cache-prefetcher causes Unknown Scheme errors

Bug #1581111 reported by ldpcloud
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
New
Undecided
Unassigned

Bug Description

When trying to prefetch an image and running the glance-cache-prefetcher (after succesfully queing it) I am getting the following error:

2016-05-12 11:37:08.215 24806 CRITICAL glance [req-625f99f7-c131-49bd-bbda-99676d56faf8 - - - - -] UnknownScheme: Unknown scheme 'swift+http' found in URI
2016-05-12 11:37:08.215 24806 TRACE glance Traceback (most recent call last):
2016-05-12 11:37:08.215 24806 TRACE glance File "/usr/bin/glance-cache-prefetcher", line 10, in <module>
2016-05-12 11:37:08.215 24806 TRACE glance sys.exit(main())
2016-05-12 11:37:08.215 24806 TRACE glance File "/usr/lib/python2.7/dist-packages/glance/cmd/cache_prefetcher.py", line 56, in main
2016-05-12 11:37:08.215 24806 TRACE glance app.run()
2016-05-12 11:37:08.215 24806 TRACE glance File "/usr/lib/python2.7/dist-packages/glance/image_cache/prefetcher.py", line 79, in run
2016-05-12 11:37:08.215 24806 TRACE glance successes = sum([1 for r in results if r is True])
2016-05-12 11:37:08.215 24806 TRACE glance File "/usr/lib/python2.7/dist-packages/eventlet/greenpool.py", line 238, in next
2016-05-12 11:37:08.215 24806 TRACE glance val = self.waiters.get().wait()
2016-05-12 11:37:08.215 24806 TRACE glance File "/usr/lib/python2.7/dist-packages/eventlet/greenthread.py", line 175, in wait
2016-05-12 11:37:08.215 24806 TRACE glance return self._exit_event.wait()
2016-05-12 11:37:08.215 24806 TRACE glance File "/usr/lib/python2.7/dist-packages/eventlet/event.py", line 125, in wait
2016-05-12 11:37:08.215 24806 TRACE glance current.throw(*self._exc)
2016-05-12 11:37:08.215 24806 TRACE glance File "/usr/lib/python2.7/dist-packages/eventlet/greenthread.py", line 214, in main
2016-05-12 11:37:08.215 24806 TRACE glance result = function(*args, **kwargs)
2016-05-12 11:37:08.215 24806 TRACE glance File "/usr/lib/python2.7/dist-packages/glance/image_cache/prefetcher.py", line 58, in fetch_image_into_cache
2016-05-12 11:37:08.215 24806 TRACE glance context=ctx)
2016-05-12 11:37:08.215 24806 TRACE glance File "/usr/lib/python2.7/dist-packages/glance_store/backend.py", line 269, in get_from_backend
2016-05-12 11:37:08.215 24806 TRACE glance loc = location.get_location_from_uri(uri, conf=CONF)
2016-05-12 11:37:08.215 24806 TRACE glance File "/usr/lib/python2.7/dist-packages/glance_store/location.py", line 75, in get_location_from_uri
2016-05-12 11:37:08.215 24806 TRACE glance raise exceptions.UnknownScheme(scheme=pieces.scheme)
2016-05-12 11:37:08.215 24806 TRACE glance UnknownScheme: Unknown scheme 'swift+http' found in URI

The Openstack Version is Kilo and Swift is used as glance storage backend for images. There was a similar report in the past (https://bugs.launchpad.net/glance/+bug/888383) but suppossed to be fixed in essex.

Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

Could you look at /etc/glance/glance-api.conf and show me the value of the "stores" option in the glance_store section?

Revision history for this message
ldpcloud (ldipaola-despegar) wrote :

Here is the value:

stores = glance.store.swift.Store

But it is not under the "glance_store" section, it is set up under the Sheepdog Store Options.

Revision history for this message
ldpcloud (ldipaola-despegar) wrote :

I made a try setting that value under the "glance_store" section, but it I am still receiving the same error: "TRACE glance UnknownScheme: Unknown scheme 'swift+http' found in URI"

Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

The comments in glance-api.conf read:

# List of stores enabled. Valid stores are: cinder, file, http, rbd,
# sheepdog, swift, s3, vsphere (list value)
#stores = file,http

So I think you should add "swift" to the list, to have something like:

[glance_store]
stores=file,http,swift
...

Then restart the glance-api service, and try again. Does this solve your issue?

Revision history for this message
ldpcloud (ldipaola-despegar) wrote :

Cyril,

I have already tried that and had no luck. Comparing with an Icehouse installation (I have the problem with an Openstack Kilo installation), looks like the prefetcher is not loading the schemes for swift (swift, swift+http, swift+https, etc.), only those related to file and http.

So, your suggestion completely makes sense, but looks like the prefetcher is not considering the stores parameter value.

Revision history for this message
Kairat Kushaev (kkushaev) wrote :

Could you please provide glance_store version?
Also could you please say are you using multi-tenant or single-tenant swift driver?

Revision history for this message
ldpcloud (ldipaola-despegar) wrote :

Glance Store package version is 0.4.0-0ubuntu1~cloud0, and I am using single-tenant swift.

I was able to "fix" it by changing the default store in the backend.py (associated to the glance_store) package to swift. A horrible hack, but by doing that the prefetcher started loading the schemes for Swift.

Revision history for this message
Kairat Kushaev (kkushaev) wrote :

You can change it in glance-api config file, you can use default_store option to change default store.
So there is no need to change python code.

Revision history for this message
ldpcloud (ldipaola-despegar) wrote :

That is what I have been doing and playing with, but the default_store parameter seems not be taken from the config file.

Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

If you're still interested in trying to find a clean solution to this issue, could you please grep the logs for the following patterns:

"Attempting to import store"
"Failed to load driver"
"Unable to register store"
"Registering store"

They are from the kilo branch of glance_store. You might need to enable debug logs to see some of them. This might help us understand the issue a bit better. Thanks!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.