Ask Your Question

glance-api start failed with using cache

asked 2011-12-29 02:38:55 -0500

s-rain gravatar image

Hello all, I got a problem about glance-cache can't enable. I have used the glance-cache-document ( ( ) to set the cache up, but it occurred a error as below. Please help me to clarify where the problem is. Thank you. ERROR: Error trying to load config /etc/glance-api.conf: has no 'filter_factory' attribute

glance-api.conf :

# =============== Image Cache Options =============================

Base directory that the Image Cache uses

image_cache_dir = /cache2

[pipeline:glance-api] pipeline = versionnegotiation context cache cachemanage apiv1app

[app:apiv1app] paste.app_factory = glance.api.v1.router:app_factory

[filter:versionnegotiation] paste.filter_factory = glance.api.middleware.version_negotiation:filter_factory

[filter:cache] #paste.filter_factory = glance.api.middleware.cache:filter_factory paste.filter_factory = glance.common.wsgi:filter_factory
glance.filter_factory = glance.api.middleware.cache:CacheFilter

[filter:cachemanage] paste.filter_factory = glance.api.middleware.cache_manage:filter_factory

[filter:context] paste.filter_factory = glance.common.context:filter_factory

[filter:authtoken] paste.filter_factory = keystone.middleware.auth_token:filter_factory service_protocol = http service_host = service_port = 5000 auth_host = auth_port = 35357 auth_protocol = http auth_uri = admin_token = 999888777666

[filter:auth-context] paste.filter_factory = keystone.middleware.glance_auth_token:filter_factory

By the way, Why doesn't glance-api.conf include all of cache setting by default?

edit retag flag offensive close merge delete

7 answers

Sort by ยป oldest newest most voted

answered 2011-12-30 01:30:01 -0500

s-rain gravatar image

Brian, Thank you. The common/ doesn't include filter_factory function in glance-2012.1~e2, so that this problem has occurred. I will check that and report it. Thanks.

edit flag offensive delete link more

answered 2011-12-29 13:40:44 -0500

Make sure you're running code at or newer than commit 68de11cdab473036dfdf17df48deafd4677d926b. That's the commit that changed the location of the filter_factory object that your failures seem to point to.

As for your question about why the cache config options aren't in glance-api.conf: as I understand it, most of the options belong in glance-cache.conf. There are specific options, however, that need to be in glance-api.conf for the middlewares to use. I'll look into cleaning this up a bit so its clearer in the future.

edit flag offensive delete link more

answered 2012-01-03 02:22:58 -0500

s-rain gravatar image

Hello Brian, After download openstack-glance_7d61fef and install,There is two errors of glance-api below.


glance-control all restart

No glance-api running No glance-registry running No glance-scrubber running Traceback (most recent call last): File "/usr/bin/glance-control", line 233, in <module> do_start(server, conf, args) File "/usr/bin/glance-control", line 146, in do_start conf_file = conf.config_file[-1] IndexError: list index out of range


glance-api start

ERROR: Unable to load glance-api from configuration file /etc/glance-api.conf. Got: ImportError("<module 'glance.api.v1.router'="" from="" '="" usr="" lib="" pymodules="" python2.7="" glance="" api="" v1="" router.pyc'=""> has no 'app_factory' attribute",)

Is there any problem?

Thanks, Rain

edit flag offensive delete link more

answered 2012-01-03 14:21:37 -0500

1) glance-control hasn't been fully functional for a while, now. I would suggest you use glance-control to start each service individually (don't use 'all') or just call the upstart scripts directly.

2) In your glance-api.conf, make sure you update the follwing sections:

[app:apiv1app] paste.app_factory = glance.common.wsgi:app_factory glance.app_factory = glance.api.v1.router:API

[filter:versionnegotiation] paste.filter_factory = glance.common.wsgi:filter_factory glance.filter_factory = glance.api.middleware.version_negotiation:VersionNegotiationFilter

[filter:cachemanage] paste.filter_factory = glance.common.wsgi:filter_factory glance.filter_factory = glance.api.middleware.cache_manage:CacheManageFilter

[filter:context] paste.filter_factory = glance.common.wsgi:filter_factory glance.filter_factory = glance.common.context:ContextMiddleware

[filter:auth-context] paste.filter_factory = glance.common.wsgi:filter_factory glance.filter_factory = keystone.middleware.glance_auth_token:KeystoneContextMiddleware

edit flag offensive delete link more

answered 2012-01-04 01:48:52 -0500

s-rain gravatar image

Brian, Thanks.

1) glance-control still has some problems for starting each service individually. there is a error below.

glance-control api start

Traceback (most recent call last): File "/usr/bin/glance-control", line 219, in <module> do_start(server, conf, args) File "/usr/bin/glance-control", line 146, in do_start conf_file = conf.config_file[-1] IndexError: list index out of range

2) After updated the configure which you provided, The glance-api set up normally. I have two questions.
a) How do I know that how to set the conf file if I do not study glance code? These settings seem too complex for user. If it is possible, would you please make this conf file to become easy for setting?
b) Are these settings necessary in the conf?

Thank you.

edit flag offensive delete link more

answered 2012-01-04 15:25:53 -0500

1) So it seems like glance-control may be completely non-functional now. You might as well file a bug on that failure you're seeing.

2) As for the configuration changes: a) You don't necessarily have to study glance code, you just need to be able to look at the published example config files. Additionally, this only applies if you're installing trunk or from source. You should be able to depend on packages to provide correctly formatted configs. b) The settings you updated ideally would be separated into another config file that you will never have to update by hand. We just aren't quite there!

edit flag offensive delete link more

answered 2012-01-05 01:32:33 -0500

s-rain gravatar image

Thank you. ^^

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2011-12-29 02:38:55 -0500

Seen: 150 times

Last updated: Jan 05 '12