marsaber 发表于 2014-12-23 16:34:41

【已解决】:Request returned failure status.HTTPInternalServerError (HTTP 500)

本帖最后由 marsaber 于 2014-12-24 10:40 编辑

我的是KVM的虚拟机,2G内存。
操作系统是CentOS6.5 x86_64的,用的是Icehouse版本。

我是按照官网提供的openstack-install-guide-yum-icehouse.pdf安装的。
glance安装过程:
=================================
# yum -y install openstack-glance
# openstack-config --set /etc/glance/glance-api.conf database connection mysql://glance:waftest@controller/glance
# openstack-config --set /etc/glance/glance-registry.conf database connection mysql://glance:waftest@controller/glance

$ mysql -u root -p
mysql> CREATE DATABASE glance;
mysql> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'waftest';
mysql> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'waftest';
mysql>exit
# su -s /bin/sh -c "glance-manage db_sync" glance
【报错,后来编译安装gmp-6.0.0a.tar.bz2和pip install--ignore-installed PyCrypto后正常。】

# keystone user-create --name=glance --pass=waftest --email=glance@example.com
# keystone user-role-add --user=glance --tenant=service --role=admin

# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_uri http://controller:5000
# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_host controller
# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_port 35357
# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_protocol http
# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_tenant_name service
# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_user glance
# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_password waftest
# openstack-config --set /etc/glance/glance-api.conf paste_deploy flavor keystone
# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_uri http://controller:5000
# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_host controller
# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_port 35357
# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_protocol http
# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_tenant_name service
# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_user glance
# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_password waftest
# openstack-config --set /etc/glance/glance-registry.conf paste_deploy flavor keystone

# keystone service-create --name=glance --type=image --description="OpenStack Image Service"
# keystone endpoint-create --service-id=$(keystone service-list | awk '/ image / {print $2}') \
--publicurl=http://controller:9292 \
--internalurl=http://controller:9292 \
--adminurl=http://controller:9292

# chkconfig openstack-glance-api on && service openstack-glance-api restart
# chkconfig openstack-glance-registry on && service openstack-glance-registry restart
=================================

# glance image-list
Request returned failure status.
HTTPInternalServerError (HTTP 500)
#

日志(/var/log/glance/api.log):
2014-12-23 07:30:14.512 6649 INFO urllib3.connectionpool [-] Starting new HTTP connection (1): controller
2014-12-23 07:30:14.696 6649 INFO urllib3.connectionpool [-] Starting new HTTP connection (1): controller
2014-12-23 07:30:14.754 6649 INFO urllib3.connectionpool [-] Starting new HTTP connection (1): controller
2014-12-23 07:30:14.760 6649 INFO keystoneclient.middleware.auth_token [-] Auth Token confirmed use of v2.0 apis
2014-12-23 07:30:14.761 6649 INFO urllib3.connectionpool [-] Starting new HTTP connection (1): controller
2014-12-23 07:30:14.765 6649 INFO urllib3.connectionpool [-] Starting new HTTP connection (1): controller
2014-12-23 07:30:15.212 6649 INFO glance.registry.client.v1.client Registry client request GET /images/detail raised ServerError
2014-12-23 07:30:15.215 6649 INFO glance.wsgi.server Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/eventlet/wsgi.py", line 389, in handle_one_response
    result = self.application(self.environ, start_response)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 378, in __call__
    response = req.get_response(self.application)
File "/usr/lib/python2.6/site-packages/webob/request.py", line 1296, in send
    application, catch_exc_info=False)
File "/usr/lib/python2.6/site-packages/webob/request.py", line 1260, in call_application
    app_iter = application(self.environ, start_response)
File "/usr/lib/python2.6/site-packages/keystoneclient/middleware/auth_token.py", line 679, in __call__
    return self.app(env, start_response)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 378, in __call__
    response = req.get_response(self.application)
File "/usr/lib/python2.6/site-packages/webob/request.py", line 1296, in send
    application, catch_exc_info=False)
File "/usr/lib/python2.6/site-packages/webob/request.py", line 1260, in call_application
    app_iter = application(self.environ, start_response)
File "/usr/lib/python2.6/site-packages/paste/urlmap.py", line 203, in __call__
    return app(environ, start_response)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
File "/usr/lib/python2.6/site-packages/routes/middleware.py", line 131, in __call__
    response = self.app(environ, start_response)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 644, in __call__
    request, **action_args)
File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 668, in dispatch
    return method(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/api/v1/images.py", line 336, in detail
    images = registry.get_images_detail(req.context, **params)
File "/usr/lib/python2.6/site-packages/glance/registry/client/v1/api.py", line 150, in get_images_detail
    return c.get_images_detailed(**kwargs)
File "/usr/lib/python2.6/site-packages/glance/registry/client/v1/client.py", line 136, in get_images_detailed
    res = self.do_request("GET", "/images/detail", params=params)
File "/usr/lib/python2.6/site-packages/glance/registry/client/v1/client.py", line 107, in do_request
    **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/client.py", line 66, in wrapped
    return func(self, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/client.py", line 386, in do_request
    headers=copy.deepcopy(headers))
File "/usr/lib/python2.6/site-packages/glance/common/client.py", line 83, in wrapped
    return func(self, method, url, body, headers)
File "/usr/lib/python2.6/site-packages/glance/common/client.py", line 542, in _do_request
    raise exception.ServerError()
ServerError: The request returned 500 Internal Server Error.
2014-12-23 07:30:15.216 6649 INFO glance.wsgi.server 192.168.25.7 - - "GET /v1/images/detail?sort_key=name&sort_dir=asc&limit=20 HTTP/1.1" 500 139 0.71989

这个是什么原因啊?
是glance建数据库的时候出问题了。
按照http://www.aboutyun.com/thread-8684-1-1.html中的操作(openstack-db --init --service glance --password waftest --rootpw waftest;)是没有问题的,官方文档中提到的好像是有问题的。

muyannian 发表于 2014-12-23 18:20:11

检查下Glance-registry 的配置
请求资源的过程中,server出现错误。

marsaber 发表于 2014-12-23 19:11:21

muyannian 发表于 2014-12-23 18:20
检查下Glance-registry 的配置
请求资源的过程中,server出现错误。

# cat /etc/glance/glance-registry.conf



connection = mysql://glance:waftest@controller/glance


auth_uri = http://controller:5000
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = waftest


flavor = keystone
#


marsaber 发表于 2014-12-23 19:14:22

# cat /etc/glance/glance-api.conf



connection = mysql://glance:waftest@controller/glance


auth_uri = http://controller:5000
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = waftest


flavor = keystone


#

howtodown 发表于 2014-12-23 23:00:33

marsaber 发表于 2014-12-23 19:14
# cat /etc/glance/glance-api.conf



你这个是什么版本的,把下面auth_uri 的格式改一下,两个配置都改一下

# cat /etc/glance/glance-registry.conf



connection = mysql://glance:waftest@controller/glance


auth_uri = "http://controller:5000/v2.0/"
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = waftest


flavor = keystone
#

howtodown 发表于 2014-12-23 23:02:01

# cat /etc/glance/glance-api.conf



connection = mysql://glance:waftest@controller/glance


auth_uri = http://controller:5000【改一下,如上】
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = waftest


flavor = keystone


#

marsaber 发表于 2014-12-24 08:54:51

本帖最后由 marsaber 于 2014-12-24 09:14 编辑

howtodown 发表于 2014-12-23 23:02
# cat /etc/glance/glance-api.conf



版主,您好。
我的是KVM的虚拟机,2G内存。
操作系统是CentOS6.5 x86_64的,用的是Icehouse版本。
我把iptables规则清空了,把SELinux关闭了。

# cat /etc/glance/glance-api.conf



connection = mysql://glance:waftest@controller/glance


auth_uri = "http://controller:5000/v2.0/"
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = waftest


flavor = keystone


# cat /etc/glance/glance-registry.conf



connection = mysql://glance:waftest@controller/glance


auth_uri = "http://controller:5000/v2.0/"
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = waftest


flavor = keystone
# glance image-create --name "cirros-0.3.2-x86_64" --disk-format qcow2 --container-format bare --is-public True --progress < cirros-0.3.2-x86_64-disk.img
[=============================>] 100%
Request returned failure status.
HTTPInternalServerError (HTTP 500)
#

日志如下:
/var/log/glance/api.log
2014-12-24 01:29:48.334 4968 INFO urllib3.connectionpool [-] Starting new HTTP connection (1): controller
2014-12-24 01:29:48.528 4968 INFO glance.registry.client.v1.client Registry client request POST /images raised ServerError
2014-12-24 01:29:48.530 4968 INFO glance.wsgi.server Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/eventlet/wsgi.py", line 389, in handle_one_response
    result = self.application(self.environ, start_response)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 378, in __call__
    response = req.get_response(self.application)
File "/usr/lib/python2.6/site-packages/webob/request.py", line 1296, in send
    application, catch_exc_info=False)
File "/usr/lib/python2.6/site-packages/webob/request.py", line 1260, in call_application
    app_iter = application(self.environ, start_response)
File "/usr/lib/python2.6/site-packages/keystoneclient/middleware/auth_token.py", line 679, in __call__
    return self.app(env, start_response)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 378, in __call__
    response = req.get_response(self.application)
File "/usr/lib/python2.6/site-packages/webob/request.py", line 1296, in send
    application, catch_exc_info=False)
File "/usr/lib/python2.6/site-packages/webob/request.py", line 1260, in call_application
    app_iter = application(self.environ, start_response)
File "/usr/lib/python2.6/site-packages/paste/urlmap.py", line 203, in __call__
    return app(environ, start_response)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
File "/usr/lib/python2.6/site-packages/routes/middleware.py", line 131, in __call__
    response = self.app(environ, start_response)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 644, in __call__
    request, **action_args)
File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 668, in dispatch
    return method(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/utils.py", line 436, in wrapped
    return func(self, req, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/api/v1/images.py", line 794, in create
    image_meta = self._reserve(req, image_meta)
File "/usr/lib/python2.6/site-packages/glance/api/v1/images.py", line 523, in _reserve
    image_meta = registry.add_image_metadata(req.context, image_meta)
File "/usr/lib/python2.6/site-packages/glance/registry/client/v1/api.py", line 161, in add_image_metadata
    return c.add_image(image_meta)
File "/usr/lib/python2.6/site-packages/glance/registry/client/v1/client.py", line 163, in add_image
    res = self.do_request("POST", "/images", body=body, headers=headers)
File "/usr/lib/python2.6/site-packages/glance/registry/client/v1/client.py", line 107, in do_request
    **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/client.py", line 66, in wrapped
    return func(self, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/client.py", line 386, in do_request
    headers=copy.deepcopy(headers))
File "/usr/lib/python2.6/site-packages/glance/common/client.py", line 83, in wrapped
    return func(self, method, url, body, headers)
File "/usr/lib/python2.6/site-packages/glance/common/client.py", line 542, in _do_request
    raise exception.ServerError()
ServerError: The request returned 500 Internal Server Error.
2014-12-24 01:29:48.579 4968 INFO glance.wsgi.server 192.168.25.7 - - "POST /v1/images HTTP/1.1" 500 139 0.247404

/var/log/glance/registry.log
2014-12-24 08:53:22.800 4994 INFO urllib3.connectionpool [-] Starting new HTTP connection (1): controller
2014-12-24 08:53:22.989 4994 INFO urllib3.connectionpool [-] Starting new HTTP connection (1): controller
2014-12-24 08:53:23.082 4994 ERROR glance.openstack.common.db.sqlalchemy.session DB exception wrapped.
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session Traceback (most recent call last):
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib/python2.6/site-packages/glance/openstack/common/db/sqlalchemy/session.py", line 439, in _wrap
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   return f(self, *args, **kwargs)
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib/python2.6/site-packages/glance/openstack/common/db/sqlalchemy/session.py", line 705, in flush
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   return super(Session, self).flush(*args, **kwargs)
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/session.py", line 1818, in flush
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   self._flush(objects)
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/session.py", line 1936, in _flush
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   transaction.rollback(_capture_exception=True)
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib64/python2.6/site-packages/sqlalchemy/util/langhelpers.py", line 58, in __exit__
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   compat.reraise(exc_type, exc_value, exc_tb)
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/session.py", line 1900, in _flush
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   flush_context.execute()
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/unitofwork.py", line 372, in execute
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   rec.execute(self)
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/unitofwork.py", line 525, in execute
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   uow
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/persistence.py", line 64, in save_obj
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   table, insert)
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/persistence.py", line 569, in _emit_insert_statements
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   execute(statement, params)
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 662, in execute
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   params)
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 761, in _execute_clauseelement
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   compiled_sql, distilled_params
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 874, in _execute_context
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   context)
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1024, in _handle_dbapi_exception
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   exc_info
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib64/python2.6/site-packages/sqlalchemy/util/compat.py", line 196, in raise_from_cause
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   reraise(type(exception), exception, tb=exc_tb)
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 867, in _execute_context
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   context)
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/default.py", line 324, in do_execute
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   cursor.execute(statement, parameters)
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 173, in execute
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   self.errorhandler(self, exc, value)
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session   raise errorclass, errorvalue
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session ProgrammingError: (ProgrammingError) (1146, "Table 'glance.images' doesn't exist") 'INSERT INTO images (created_at, updated_at, deleted_at, deleted, id, name, disk_format, container_format, size, virtual_size, status, is_public, checksum, min_disk, min_ram, owner, protected) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' (datetime.datetime(2014, 12, 24, 0, 53, 23, 82285), datetime.datetime(2014, 12, 24, 0, 53, 23, 82294), None, 0, '5a5f4e8d-1553-4c04-a03b-34b27a005fcd', 'cirros-0.3.2-x86_64', 'qcow2', 'bare', 13167616, None, 'queued', 1, None, 0, 0, '6298a6f29bcf43489a051975b36df694', 0)
2014-12-24 08:53:23.082 4994 TRACE glance.openstack.common.db.sqlalchemy.session
2014-12-24 08:53:23.084 4994 ERROR glance.registry.api.v1.images Unable to create image None
2014-12-24 08:53:23.084 4994 TRACE glance.registry.api.v1.images Traceback (most recent call last):
2014-12-24 08:53:23.084 4994 TRACE glance.registry.api.v1.images   File "/usr/lib/python2.6/site-packages/glance/registry/api/v1/images.py", line 403, in create
2014-12-24 08:53:23.084 4994 TRACE glance.registry.api.v1.images   image_data = self.db_api.image_create(req.context, image_data)
2014-12-24 08:53:23.084 4994 TRACE glance.registry.api.v1.images   File "/usr/lib/python2.6/site-packages/glance/db/sqlalchemy/api.py", line 96, in image_create
2014-12-24 08:53:23.084 4994 TRACE glance.registry.api.v1.images   return _image_update(context, values, None, purge_props=False)
2014-12-24 08:53:23.084 4994 TRACE glance.registry.api.v1.images   File "/usr/lib/python2.6/site-packages/glance/db/sqlalchemy/api.py", line 700, in _image_update
2014-12-24 08:53:23.084 4994 TRACE glance.registry.api.v1.images   image_ref.save(session=session)
2014-12-24 08:53:23.084 4994 TRACE glance.registry.api.v1.images   File "/usr/lib/python2.6/site-packages/glance/db/sqlalchemy/models.py", line 77, in save
2014-12-24 08:53:23.084 4994 TRACE glance.registry.api.v1.images   super(GlanceBase, self).save(session or db_api.get_session())
2014-12-24 08:53:23.084 4994 TRACE glance.registry.api.v1.images   File "/usr/lib/python2.6/site-packages/glance/openstack/common/db/sqlalchemy/models.py", line 49, in save
2014-12-24 08:53:23.084 4994 TRACE glance.registry.api.v1.images   session.flush()
2014-12-24 08:53:23.084 4994 TRACE glance.registry.api.v1.images   File "/usr/lib/python2.6/site-packages/glance/openstack/common/db/sqlalchemy/session.py", line 461, in _wrap
2014-12-24 08:53:23.084 4994 TRACE glance.registry.api.v1.images   raise exception.DBError(e)
2014-12-24 08:53:23.084 4994 TRACE glance.registry.api.v1.images DBError: (ProgrammingError) (1146, "Table 'glance.images' doesn't exist") 'INSERT INTO images (created_at, updated_at, deleted_at, deleted, id, name, disk_format, container_format, size, virtual_size, status, is_public, checksum, min_disk, min_ram, owner, protected) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' (datetime.datetime(2014, 12, 24, 0, 53, 23, 82285), datetime.datetime(2014, 12, 24, 0, 53, 23, 82294), None, 0, '5a5f4e8d-1553-4c04-a03b-34b27a005fcd', 'cirros-0.3.2-x86_64', 'qcow2', 'bare', 13167616, None, 'queued', 1, None, 0, 0, '6298a6f29bcf43489a051975b36df694', 0)
2014-12-24 08:53:23.084 4994 TRACE glance.registry.api.v1.images
2014-12-24 08:53:23.085 4994 INFO glance.wsgi.server Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/eventlet/wsgi.py", line 389, in handle_one_response
    result = self.application(self.environ, start_response)
File "/usr/lib/python2.6/site-packages/keystoneclient/middleware/auth_token.py", line 679, in __call__
    return self.app(env, start_response)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 378, in __call__
    response = req.get_response(self.application)
File "/usr/lib/python2.6/site-packages/webob/request.py", line 1296, in send
    application, catch_exc_info=False)
File "/usr/lib/python2.6/site-packages/webob/request.py", line 1260, in call_application
    app_iter = application(self.environ, start_response)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
File "/usr/lib/python2.6/site-packages/routes/middleware.py", line 131, in __call__
    response = self.app(environ, start_response)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/python2.6/site-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 644, in __call__
    request, **action_args)
File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 668, in dispatch
    return method(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/utils.py", line 436, in wrapped
    return func(self, req, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/registry/api/v1/images.py", line 403, in create
    image_data = self.db_api.image_create(req.context, image_data)
File "/usr/lib/python2.6/site-packages/glance/db/sqlalchemy/api.py", line 96, in image_create
    return _image_update(context, values, None, purge_props=False)
File "/usr/lib/python2.6/site-packages/glance/db/sqlalchemy/api.py", line 700, in _image_update
    image_ref.save(session=session)
File "/usr/lib/python2.6/site-packages/glance/db/sqlalchemy/models.py", line 77, in save
    super(GlanceBase, self).save(session or db_api.get_session())
File "/usr/lib/python2.6/site-packages/glance/openstack/common/db/sqlalchemy/models.py", line 49, in save
    session.flush()
File "/usr/lib/python2.6/site-packages/glance/openstack/common/db/sqlalchemy/session.py", line 461, in _wrap
    raise exception.DBError(e)
DBError: (ProgrammingError) (1146, "Table 'glance.images' doesn't exist") 'INSERT INTO images (created_at, updated_at, deleted_at, deleted, id, name, disk_format, container_format, size, virtual_size, status, is_public, checksum, min_disk, min_ram, owner, protected) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' (datetime.datetime(2014, 12, 24, 0, 53, 23, 82285), datetime.datetime(2014, 12, 24, 0, 53, 23, 82294), None, 0, '5a5f4e8d-1553-4c04-a03b-34b27a005fcd', 'cirros-0.3.2-x86_64', 'qcow2', 'bare', 13167616, None, 'queued', 1, None, 0, 0, '6298a6f29bcf43489a051975b36df694', 0)
2014-12-24 08:53:23.088 4994 INFO glance.wsgi.server 127.0.0.1 - - "POST /images HTTP/1.1" 500 139 0.289534


marsaber 发表于 2014-12-24 09:57:06

按照http://www.aboutyun.com/thread-8684-1-1.html这里的glance的操作就是好着的。
我的那些步骤,glance的数据库中只有一个表。

marsaber 发表于 2014-12-24 10:38:14

我又打开之前的,数据库建库用:
openstack-db --init --service glance --password waftest --rootpw waftest;
然后建的表就没有问题了。
glance image-list也正常了。
glance image-create --name "cirros-0.3.2-x86_64" --disk-format qcow2 --container-format bare --is-public true --progress < cirros-0.3.2-x86_64-disk.img也正常了。

看来官方文档中的建库那几步有问题啊。
官方的:
3. Use the password you created to log in as root and create a glance database user:
$ mysql -u root -p
mysql> CREATE DATABASE glance;
mysql> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \
IDENTIFIED BY 'GLANCE_DBPASS';
mysql> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \
IDENTIFIED BY 'GLANCE_DBPASS';
4. Create the database tables for the Image Service:
# su -s /bin/sh -c "glance-manage db_sync" glance

muyannian 发表于 2014-12-24 11:29:55

marsaber 发表于 2014-12-24 10:38
我又打开之前的,数据库建库用:
openstack-db --init --service glance --password waftest --rootpw waf ...

可能在同步表的时候产生了问题
页: [1] 2
查看完整版本: 【已解决】:Request returned failure status.HTTPInternalServerError (HTTP 500)