Comment 6 for bug 1534052

Revision history for this message
wangxiyuan (wangxiyuan) wrote :

and glance-api rasie an error:

2016-01-18 09:19:43.529 ERROR glance.common.wsgi [req-42da22da-fc07-4fff-a6b3-e7df2a587e5d 3679e374793d474b9a4938a269896f4b 51d3c5e987d64e1881e176ab607f4445] Caught error: Multiple rows were found for one()
2016-01-18 09:19:43.529 TRACE glance.common.wsgi Traceback (most recent call last):
2016-01-18 09:19:43.529 TRACE glance.common.wsgi File "/opt/stack/glance/glance/common/wsgi.py", line 882, in __call__
2016-01-18 09:19:43.529 TRACE glance.common.wsgi request, **action_args)
2016-01-18 09:19:43.529 TRACE glance.common.wsgi File "/opt/stack/glance/glance/common/wsgi.py", line 911, in dispatch
2016-01-18 09:19:43.529 TRACE glance.common.wsgi return method(*args, **kwargs)
2016-01-18 09:19:43.529 TRACE glance.common.wsgi File "/opt/stack/glance/glance/common/utils.py", line 423, in wrapped
2016-01-18 09:19:43.529 TRACE glance.common.wsgi return func(self, req, *args, **kwargs)
2016-01-18 09:19:43.529 TRACE glance.common.wsgi File "/opt/stack/glance/glance/api/v2/image_tags.py", line 78, in delete
2016-01-18 09:19:43.529 TRACE glance.common.wsgi image_repo.save(image)
2016-01-18 09:19:43.529 TRACE glance.common.wsgi File "/opt/stack/glance/glance/domain/proxy.py", line 99, in save
2016-01-18 09:19:43.529 TRACE glance.common.wsgi result = self.base.save(base_item, from_state=from_state)
2016-01-18 09:19:43.529 TRACE glance.common.wsgi File "/opt/stack/glance/glance/notifier.py", line 458, in save
2016-01-18 09:19:43.529 TRACE glance.common.wsgi super(ImageRepoProxy, self).save(image, from_state=from_state)
2016-01-18 09:19:43.529 TRACE glance.common.wsgi File "/opt/stack/glance/glance/domain/proxy.py", line 99, in save
2016-01-18 09:19:43.529 TRACE glance.common.wsgi result = self.base.save(base_item, from_state=from_state)
2016-01-18 09:19:43.529 TRACE glance.common.wsgi File "/opt/stack/glance/glance/api/policy.py", line 125, in save
2016-01-18 09:19:43.529 TRACE glance.common.wsgi return super(ImageRepoProxy, self).save(image, from_state=from_state)
2016-01-18 09:19:43.529 TRACE glance.common.wsgi File "/opt/stack/glance/glance/domain/proxy.py", line 99, in save
2016-01-18 09:19:43.529 TRACE glance.common.wsgi result = self.base.save(base_item, from_state=from_state)
2016-01-18 09:19:43.529 TRACE glance.common.wsgi File "/opt/stack/glance/glance/quota/__init__.py", line 112, in save
2016-01-18 09:19:43.529 TRACE glance.common.wsgi return super(ImageRepoProxy, self).save(image, from_state=from_state)
2016-01-18 09:19:43.529 TRACE glance.common.wsgi File "/opt/stack/glance/glance/domain/proxy.py", line 99, in save
2016-01-18 09:19:43.529 TRACE glance.common.wsgi result = self.base.save(base_item, from_state=from_state)
2016-01-18 09:19:43.529 TRACE glance.common.wsgi File "/opt/stack/glance/glance/location.py", line 65, in save
2016-01-18 09:19:43.529 TRACE glance.common.wsgi result = super(ImageRepoProxy, self).save(image, from_state=from_state)
2016-01-18 09:19:43.529 TRACE glance.common.wsgi File "/opt/stack/glance/glance/domain/proxy.py", line 99, in save
2016-01-18 09:19:43.529 TRACE glance.common.wsgi result = self.base.save(base_item, from_state=from_state)
2016-01-18 09:19:43.529 TRACE glance.common.wsgi File "/opt/stack/glance/glance/db/__init__.py", line 281, in save
2016-01-18 09:19:43.529 TRACE glance.common.wsgi image.tags)
2016-01-18 09:19:43.529 TRACE glance.common.wsgi File "/opt/stack/glance/glance/db/sqlalchemy/api.py", line 1186, in image_tag_set_all
2016-01-18 09:19:43.529 TRACE glance.common.wsgi image_tag_delete(context, image_id, tag, session)
2016-01-18 09:19:43.529 TRACE glance.common.wsgi File "/opt/stack/glance/glance/db/sqlalchemy/api.py", line 1206, in image_tag_delete
2016-01-18 09:19:43.529 TRACE glance.common.wsgi tag_ref = query.one()
2016-01-18 09:19:43.529 TRACE glance.common.wsgi File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2698, in one
2016-01-18 09:19:43.529 TRACE glance.common.wsgi "Multiple rows were found for one()")
2016-01-18 09:19:43.529 TRACE glance.common.wsgi MultipleResultsFound: Multiple rows were found for one()

So I guess this is a sqlalchemy lib error? or is there a way to let sqlalchemy(or oslo.db) know the case-sensitive.

I found a bug similar:
https://bugs.launchpad.net/oslo.db/+bug/1435265