yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #33462
[Bug 1462315] [NEW] glance member-create failed with HTTP 500 error
Public bug reported:
At first, I run "glance member-create" and then "glance member-delete",
they were successful. But when I run "glance member-create" again with
the same parameters, it failed with HTTP 500 error.
[root@vm9 /]# glance member-create 2d2421ca-d4bd-4c69-91cf-5d167d20073a 95e0dd9ed89544428f1daa7071c6990f
[root@vm9 /]# glance member-delete 2d2421ca-d4bd-4c69-91cf-5d167d20073a 95e0dd9ed89544428f1daa7071c6990f
[root@vm9 /]# glance member-create 2d2421ca-d4bd-4c69-91cf-5d167d20073a 95e0dd9ed89544428f1daa7071c6990f
HTTPInternalServerError (HTTP 500)
glance registry.log :
File "/usr/lib/python2.7/site-packages/glance/registry/api/v1/members.py", line 269, in update
self.db_api.image_member_create(req.context, values)
File "/usr/lib/python2.7/site-packages/glance/db/sqlalchemy/api.py", line 1020, in image_member_create
_image_member_update(context, memb_ref, values, session=session)
File "/usr/lib/python2.7/site-packages/glance/db/sqlalchemy/api.py", line 1051, in _image_member_update
memb_ref.save(session=session)
File "/usr/lib/python2.7/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.7/site-packages/oslo_db/sqlalchemy/models.py", line 48, in save
session.flush()
File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 1919, in flush
self._flush(objects)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 2037, in _flush
transaction.rollback(_capture_exception=True)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 60, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 2001, in _flush
flush_context.execute()
File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 372, in execute
rec.execute(self)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 526, in execute
uow
File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 65, in save_obj
mapper, table, insert)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 602, in _emit_insert_statements
execute(statement, params)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 729, in execute
return meth(self, multiparams, params)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/elements.py", line 322, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 826, in _execute_clauseelement
compiled_sql, distilled_params
File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 958, in _execute_context
context)
File "/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/compat/handle_error.py", line 261, in _handle_dbapi_exception
e, statement, parameters, cursor, context)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1155, in _handle_dbapi_exception
util.raise_from_cause(newraise, exc_info)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 951, in _execute_context
context)
File "/usr/lib/python2.7/site-packages/ibm_db_sa/ibm_db.py", line 106, in do_execute
cursor.execute(statement, parameters)
File "/usr/lib64/python2.7/site-packages/ibm_db_dbi.py", line 1335, in execute
self._execute_helper(parameters)
File "/usr/lib64/python2.7/site-packages/ibm_db_dbi.py", line 1247, in _execute_helper
raise self.messages[len(self.messages) - 1]
DBDuplicateEntry: (IntegrityError) ibm_db_dbi::IntegrityError: Statement
Execute Failed: [IBM][CLI Driver][DB2/LINUXX8664] SQL0803N One or more
values in the INSERT statement, UPDATE statement, or foreign key update
caused by a DELETE statement are not valid because the primary key,
unique constraint or unique index identified by "2" constrains table
"GLANCE.IMAGE_MEMBERS" from having duplicate values for the index key.
SQLSTATE=23505 SQLCODE=-803 'INSERT INTO image_members (created_at,
updated_at, deleted_at, deleted, image_id, "member", can_share, status)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)' (datetime.datetime(2015, 6, 5, 10, 39,
9, 724699), datetime.datetime(2015, 6, 5, 10, 39, 9, 724711), None, '0',
'2d2421ca-d4bd-4c69-91cf-5d167d20073a',
'95e0dd9ed89544428f1daa7071c6990f', '0', 'pending')
** Affects: glance
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1462315
Title:
glance member-create failed with HTTP 500 error
Status in OpenStack Image Registry and Delivery Service (Glance):
New
Bug description:
At first, I run "glance member-create" and then "glance member-
delete", they were successful. But when I run "glance member-create"
again with the same parameters, it failed with HTTP 500 error.
[root@vm9 /]# glance member-create 2d2421ca-d4bd-4c69-91cf-5d167d20073a 95e0dd9ed89544428f1daa7071c6990f
[root@vm9 /]# glance member-delete 2d2421ca-d4bd-4c69-91cf-5d167d20073a 95e0dd9ed89544428f1daa7071c6990f
[root@vm9 /]# glance member-create 2d2421ca-d4bd-4c69-91cf-5d167d20073a 95e0dd9ed89544428f1daa7071c6990f
HTTPInternalServerError (HTTP 500)
glance registry.log :
File "/usr/lib/python2.7/site-packages/glance/registry/api/v1/members.py", line 269, in update
self.db_api.image_member_create(req.context, values)
File "/usr/lib/python2.7/site-packages/glance/db/sqlalchemy/api.py", line 1020, in image_member_create
_image_member_update(context, memb_ref, values, session=session)
File "/usr/lib/python2.7/site-packages/glance/db/sqlalchemy/api.py", line 1051, in _image_member_update
memb_ref.save(session=session)
File "/usr/lib/python2.7/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.7/site-packages/oslo_db/sqlalchemy/models.py", line 48, in save
session.flush()
File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 1919, in flush
self._flush(objects)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 2037, in _flush
transaction.rollback(_capture_exception=True)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 60, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 2001, in _flush
flush_context.execute()
File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 372, in execute
rec.execute(self)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 526, in execute
uow
File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 65, in save_obj
mapper, table, insert)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 602, in _emit_insert_statements
execute(statement, params)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 729, in execute
return meth(self, multiparams, params)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/elements.py", line 322, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 826, in _execute_clauseelement
compiled_sql, distilled_params
File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 958, in _execute_context
context)
File "/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/compat/handle_error.py", line 261, in _handle_dbapi_exception
e, statement, parameters, cursor, context)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1155, in _handle_dbapi_exception
util.raise_from_cause(newraise, exc_info)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 951, in _execute_context
context)
File "/usr/lib/python2.7/site-packages/ibm_db_sa/ibm_db.py", line 106, in do_execute
cursor.execute(statement, parameters)
File "/usr/lib64/python2.7/site-packages/ibm_db_dbi.py", line 1335, in execute
self._execute_helper(parameters)
File "/usr/lib64/python2.7/site-packages/ibm_db_dbi.py", line 1247, in _execute_helper
raise self.messages[len(self.messages) - 1]
DBDuplicateEntry: (IntegrityError) ibm_db_dbi::IntegrityError:
Statement Execute Failed: [IBM][CLI Driver][DB2/LINUXX8664] SQL0803N
One or more values in the INSERT statement, UPDATE statement, or
foreign key update caused by a DELETE statement are not valid because
the primary key, unique constraint or unique index identified by "2"
constrains table "GLANCE.IMAGE_MEMBERS" from having duplicate values
for the index key. SQLSTATE=23505 SQLCODE=-803 'INSERT INTO
image_members (created_at, updated_at, deleted_at, deleted, image_id,
"member", can_share, status) VALUES (?, ?, ?, ?, ?, ?, ?, ?)'
(datetime.datetime(2015, 6, 5, 10, 39, 9, 724699),
datetime.datetime(2015, 6, 5, 10, 39, 9, 724711), None, '0',
'2d2421ca-d4bd-4c69-91cf-5d167d20073a',
'95e0dd9ed89544428f1daa7071c6990f', '0', 'pending')
To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1462315/+subscriptions
Follow ups
References