yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #76016
[Bug 1805790] [NEW] Failed to revert a volume based on a snapshot: "AttributeError: 'Snapshot' object has no attribute '_obj_metadata'"
Public bug reported:
You can use the following steps to reproduce:
1 cinder create --name test6666 --metadata k=v 1
+--------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2018-11-29T08:19:09.000000 |
| description | None |
| encrypted | False |
| id | f86e8532-96a9-4917-851e-6e7cadddac08 |
| metadata | {u'k': u'v'} |
| migration_status | None |
| multiattach | False |
| name | test6666 |
| os-vol-host-attr:host | None |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | b7f73d2e3c1c4d799b7e39500b053510 |
| replication_status | None |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| updated_at | None |
| user_id | a1c8e36ec49c4fbfba04ecc85e0612d8 |
| volume_type | None |
+--------------------------------+--------------------------------------+
2 cinder snapshot-create f86e8532-96a9-4917-851e-6e7cadddac08 --metadata k1=v1 --name snapshot_6666
+-------------+--------------------------------------+
| Property | Value |
+-------------+--------------------------------------+
| created_at | 2018-11-29T08:19:53.018179 |
| description | None |
| id | e05e0744-249d-4a90-9e71-01726e6b5116 |
| metadata | {u'k1': u'v1'} |
| name | snapshot_6666 |
| size | 1 |
| status | creating |
| updated_at | None |
| volume_id | f86e8532-96a9-4917-851e-6e7cadddac08 |
+-------------+--------------------------------------+
3 curl -g -i -X POST
http://IP:8776/v3/b7f73d2e3c1c4d799b7e39500b053510/volumes/f86e8532-96a9-4917
-851e-6e7cadddac08/action -H "Accept: application/json" -H "Content-
Type: application/json" -H "User-Agent: python-cinderclient" -H "X-Auth-
Token: $token" -H "OpenStack-API-Version: volume 3.40" -d '{"revert":
{"snapshot_id": "e05e0744-249d-4a90-9e71-01726e6b5116"}}'
Error log is as follows:
Exception during message handling: AttributeError: 'Snapshot' object has no attribute '_obj_metadata'
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server Traceback (most recent call last):
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_messaging/rpc/server.py", line 163, in _process_incoming
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 265, in dispatch
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 194, in _do_dispatch
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/cinder/volume/manager.py", line 988, in revert_to_snapshot
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server "revert.end")
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/cinder/volume/manager.py", line 2560, in _notify_about_snapshot_usage
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server extra_usage_info=extra_usage_info, host=self.host)
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/cinder/utils.py", line 1197, in wrapped
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server return f(*args, **kwargs)
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/cinder/volume/utils.py", line 201, in notify_about_snapshot_usage
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server usage_info = _usage_from_snapshot(snapshot, context, **extra_usage_info)
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/cinder/volume/utils.py", line 184, in _usage_from_snapshot
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server 'metadata': null_safe_str(snapshot.get('metadata')),
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/cinder/objects/base.py", line 242, in get
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server return getattr(self, key)
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 68, in getter
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server return getattr(self, attrname)
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server AttributeError: 'Snapshot' object has no attribute '_obj_metadata'
** Affects: cinder
Importance: Undecided
Assignee: Leopard Ma (leopardma)
Status: New
** Project changed: nova => cinder
** Changed in: cinder
Assignee: (unassigned) => Leopard Ma (leopardma)
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1805790
Title:
Failed to revert a volume based on a snapshot: "AttributeError:
'Snapshot' object has no attribute '_obj_metadata'"
Status in Cinder:
New
Bug description:
You can use the following steps to reproduce:
1 cinder create --name test6666 --metadata k=v 1
+--------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2018-11-29T08:19:09.000000 |
| description | None |
| encrypted | False |
| id | f86e8532-96a9-4917-851e-6e7cadddac08 |
| metadata | {u'k': u'v'} |
| migration_status | None |
| multiattach | False |
| name | test6666 |
| os-vol-host-attr:host | None |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | b7f73d2e3c1c4d799b7e39500b053510 |
| replication_status | None |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| updated_at | None |
| user_id | a1c8e36ec49c4fbfba04ecc85e0612d8 |
| volume_type | None |
+--------------------------------+--------------------------------------+
2 cinder snapshot-create f86e8532-96a9-4917-851e-6e7cadddac08 --metadata k1=v1 --name snapshot_6666
+-------------+--------------------------------------+
| Property | Value |
+-------------+--------------------------------------+
| created_at | 2018-11-29T08:19:53.018179 |
| description | None |
| id | e05e0744-249d-4a90-9e71-01726e6b5116 |
| metadata | {u'k1': u'v1'} |
| name | snapshot_6666 |
| size | 1 |
| status | creating |
| updated_at | None |
| volume_id | f86e8532-96a9-4917-851e-6e7cadddac08 |
+-------------+--------------------------------------+
3 curl -g -i -X POST
http://IP:8776/v3/b7f73d2e3c1c4d799b7e39500b053510/volumes/f86e8532-96a9-4917
-851e-6e7cadddac08/action -H "Accept: application/json" -H "Content-
Type: application/json" -H "User-Agent: python-cinderclient" -H "X
-Auth-Token: $token" -H "OpenStack-API-Version: volume 3.40" -d
'{"revert": {"snapshot_id": "e05e0744-249d-4a90-9e71-01726e6b5116"}}'
Error log is as follows:
Exception during message handling: AttributeError: 'Snapshot' object has no attribute '_obj_metadata'
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server Traceback (most recent call last):
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_messaging/rpc/server.py", line 163, in _process_incoming
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 265, in dispatch
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 194, in _do_dispatch
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/cinder/volume/manager.py", line 988, in revert_to_snapshot
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server "revert.end")
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/cinder/volume/manager.py", line 2560, in _notify_about_snapshot_usage
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server extra_usage_info=extra_usage_info, host=self.host)
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/cinder/utils.py", line 1197, in wrapped
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server return f(*args, **kwargs)
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/cinder/volume/utils.py", line 201, in notify_about_snapshot_usage
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server usage_info = _usage_from_snapshot(snapshot, context, **extra_usage_info)
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/cinder/volume/utils.py", line 184, in _usage_from_snapshot
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server 'metadata': null_safe_str(snapshot.get('metadata')),
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/cinder/objects/base.py", line 242, in get
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server return getattr(self, key)
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 68, in getter
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server return getattr(self, attrname)
2018-11-29 15:08:57.996 33 ERROR oslo_messaging.rpc.server AttributeError: 'Snapshot' object has no attribute '_obj_metadata'
To manage notifications about this bug go to:
https://bugs.launchpad.net/cinder/+bug/1805790/+subscriptions