glance service can't start up ,GOT KEYERROR(filecoder)

Asked by Van on 2012-07-18

when i start up the glance service, the following info came out and nothing happen.
root@cloudcontroller:/etc/glance# glance-api
ERROR: Unable to load glance-api-keystone from configuration file /etc/glance/glance-api-paste.ini.
Got: KeyError('filedecoder',)

my glance-api-paste.ini
root@cloudcontroller:/etc/glance# vi glance-api-paste.ini

# Default minimal pipeline
[pipeline:glance-api]
#pipeline = versionnegotiation context rootapp
pipeline = versionnegotiation unauthenticated-context rootapp

# Use the following pipeline for keystone auth
# i.e. in glance-api.conf:
# [paste_deploy]
# flavor = keystone
#
[pipeline:glance-api-keystone]
#pipeline = versionnegotiation authtoken context rootapp
pipeline = versionnegotiation authtoken context rootapp
# Use the following pipeline to enable transparent caching of image files
# i.e. in glance-api.conf:
# [paste_deploy]
# flavor = caching
#
#[pipeline:glance-api-caching]
#pipeline = versionnegotiation unauthenticated-context cache rootapp

# Use the following pipeline for keystone auth with caching
# i.e. in glance-api.conf:
# [paste_deploy]
# flavor = keystone+caching
#
[pipeline:glance-api-keystone+caching]
pipeline = versionnegotiation authtoken context cache rootapp

# Use the following pipeline for keystone auth with cache management
# i.e. in glance-api.conf:
# [paste_deploy]
# flavor = keystone+cachemanagement
#
[pipeline:glance-api-keystone+cachemanagement]
pipeline = versionnegotiation authtoken context cache cachemanage rootapp

[composite:rootapp]
use = egg:Paste#urlmap
/: apiversions
/v1: apiv1app
/v2: apiv2app

[app:apiversions]
paste.app_factory = glance.api.versions:create_resource

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

[app:apiv2app]
paste.app_factory = glance.api.v2.router:API.factory

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

[filter:cache]
paste.filter_factory = glance.api.middleware.cache:CacheFilter.factory

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

[filter:context]
paste.filter_factory = glance.api.middleware.context:ContextMiddleware.factory

[filter:unauthenticated-context]
paste.filter_factory = glance.api.middleware.context:UnauthenticatedContextMiddleware.factory

[filter:authtoken]
paste.filter_factory = keystone.middleware.auth_token:filter_factory
service_protocol = http
service_host = 127.0.0.1
service_port = 5000
auth_host = 127.0.0.1
auth_port = 35357
auth_protocol = http
auth_uri = http://127.0.0.1:5000/
admin_tenant_name = serviceTenant
admin_user = glanceUser
admin_password = glanceUser

my glance-api.conf
root@cloudcontroller:/etc/glance# vi glance-api.conf
[DEFAULT]
# Show more verbose log output (sets INFO log level output)
verbose = True

# Show debugging output in logs (sets DEBUG log level output)
debug = False

# Which backend scheme should Glance use by default is not specified
# in a request to add a new image to Glance? Known schemes are determined
# by the known_stores option below.
# Default: 'file'
default_store = file

# List of which store classes and store class locations are
# currently known to glance at startup.
# known_stores = glance.store.filesystem.Store,
# glance.store.http.Store,
# glance.store.rbd.Store,
# glance.store.s3.Store,
# glance.store.swift.Store,

# Address to bind the API server
bind_host = 0.0.0.0

# Port the bind the API server to
bind_port = 9292

# Log to this file. Make sure you do not set the same log
# file for both the API and registry servers!
log_file = /var/log/glance/api.log

# Backlog requests when creating socket
backlog = 4096

# SQLAlchemy connection string for the reference implementation
# registry server. Any valid SQLAlchemy connection string is fine.
# See: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html#sqlalchemy.create_engine
sql_connection = mysql://glancedbadmin:glance@172.20.2.2/glance

# Period in seconds after which SQLAlchemy should reestablish its connection
# to the database.
#
# MySQL uses a default `wait_timeout` of 8 hours, after which it will drop
"glance-api.conf" 272L, 9704C 1,1 Top

# When sending images to S3, the data will first be written to a
# temporary buffer on disk. By default the platform's temporary directory
# will be used. If required, an alternative directory can be specified here.
# s3_store_object_buffer_dir = /path/to/dir

# ============ RBD Store Options =============================

# Ceph configuration file path
# If using cephx authentication, this file should
# include a reference to the right keyring
# in a client.<USER> section
rbd_store_ceph_conf = /etc/ceph/ceph.conf

# RADOS user to authenticate as (only applicable if using cephx)
rbd_store_user = glance

# RADOS pool in which images are stored
rbd_store_pool = images

# Images will be chunked into objects of this size (in megabytes).
# For best performance, this should be a power of two
rbd_store_chunk_size = 8

# ============ Delayed Delete Options =============================

# Turn on/off delayed delete
delayed_delete = False

# Delayed delete time in seconds
scrub_time = 43200

# Directory that the scrubber will use to remind itself of what to delete
# Make sure this is also set in glance-scrubber.conf
scrubber_datadir = /var/lib/glance/scrubber

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

# Base directory that the Image Cache uses
image_cache_dir = /var/lib/glance/image-cache/

[paste_deploy]
flavor = keystone

When i use other flavors in [paste_deploy] , the same thing happen.
And when i remove authtoken from pipeline ,and glance-api works.

Question information

Language:
English Edit question
Status:
Solved
For:
Glance Edit question
Assignee:
No assignee Edit question
Solved by:
Wall Lee
Solved:
2012-07-19
Last query:
2012-07-19
Last reply:
2012-07-18
Wall Lee (eelilei) said : #1

Hi,I have the same problem,it seem that it is keystone's error,and maybe it is anyjson package.I reported the bug.

Best Wall Lee (eelilei) said : #2

Hi,I fixed the error.You need pip install anyjson 0.2.4.

Wall Lee (eelilei) said : #3

Hi,I fixed the error.You need pip install anyjson 0.2.4.

Van (fanjunlun) said : #4

root@cloudcontroller:~# easy_install anyjson==0.2.4
Searching for anyjson==0.2.4
Best match: anyjson 0.2.4
Processing anyjson-0.2.4-py2.7.egg
anyjson 0.2.4 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/anyjson-0.2.4-py2.7.egg
Processing dependencies for anyjson==0.2.4
Finished processing dependencies for anyjson==0.2.4

Thank you Wall Lee. You solve my question.That's really weird. Because the anyjson was installed before.
But after i execute the command above. the glance service can start up!

Van (fanjunlun) said : #5

Thanks Wall Lee, that solved my question.