Ask Your Question
0

Not able to upload the image to the Image service

asked 2016-12-21 06:04:04 -0600

navalsaini gravatar image

updated 2016-12-22 04:54:34 -0600

I am installing openstack newton on my centos 7 machine.

when i am trying to upload test image to image service getting following error.

[root@controller ~]# openstack image create "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --public

500 Internal Server Error
The server has either erred or is incapable of performing the requested operation.
    (HTTP 500)

Here is the log message from the file - /var/log/glance/api.log

2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi   File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 2109, in _flush
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi     flush_context.execute()
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi   File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 373, in execute
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi     rec.execute(self)
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi   File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 532, in execute
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi     uow
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi   File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 174, in save_obj
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi     mapper, table, insert)
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi   File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 767, in _emit_insert_statements
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi     execute(statement, multiparams)
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi     return meth(self, multiparams, params)
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi   File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi     return connection._execute_clauseelement(self, multiparams, params)
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi     compiled_sql, distilled_params
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi     context)
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1337, in _handle_dbapi_exception
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi     util.raise_from_cause(newraise, exc_info)
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi   File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/compat.py", line 200, in raise_from_cause
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi     reraise(type(exception), exception, tb=exc_tb)
2016-12-21 06:56:14.231 9062 ERROR glance.common.wsgi   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-12-22 03:06:47 -0600

silently gravatar image

updated 2016-12-22 03:12:54 -0600

...... ERROR glance.common.wsgi ProgrammingError: (pymysql.err.ProgrammingError) (1146, u"Table 'glance.images' doesn't exist" .....

 CREATE DATABASE glance;

GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost'       IDENTIFIED BY 'GLANCE_DBPASS';


GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%'        IDENTIFIED BY 'GLANCE_DBPASS';


then:    
 su -s /bin/sh -c "glance-manage db_sync" glance     or    glance-manage db_sync
edit flag offensive delete link more

Comments

I was having issue with database population with this command.

su -s /bin/sh -c "glance-manage db_sync" glance

Issue was with locale.

After adding export LC_ALL=en_US.UTF-8 resolved my issue.

navalsaini gravatar imagenavalsaini ( 2016-12-23 01:28:05 -0600 )edit

mysql -u root -p

then enter,

show databases;

Is there database :glance ? If it exists,then: use glance;show tables;

Is there table: images ?

silently gravatar imagesilently ( 2016-12-25 20:30:18 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2016-12-21 06:04:04 -0600

Seen: 420 times

Last updated: Dec 22 '16