Bug: AttributeError: 'module' object has no attribute 'snapshot_delete'

Bug #1475351 reported by Igor Malinovskiy
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Medium
Megharth Lakhataria

Bug Description

Manila Share API calls self.db.snapshot_delete() method which doesn't exist.

2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault Traceback (most recent call last):
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/opt/stack/new/manila/manila/api/middleware/fault.py", line 73, in __call__
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault return req.get_response(self.application)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1317, in send
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault application, catch_exc_info=False)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1281, in call_application
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault app_iter = application(self.environ, start_response)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault return resp(environ, start_response)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault resp = self.call_func(req, *args, **self.kwargs)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault return self.func(req, *args, **kwargs)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token/__init__.py", line 434, in __call__
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault response = req.get_response(self._app)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1317, in send
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault application, catch_exc_info=False)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1281, in call_application
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault app_iter = application(self.environ, start_response)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault return resp(environ, start_response)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault return resp(environ, start_response)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/usr/local/lib/python2.7/dist-packages/routes/middleware.py", line 131, in __call__
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault response = self.app(environ, start_response)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault return resp(environ, start_response)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault resp = self.call_func(req, *args, **self.kwargs)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault return self.func(req, *args, **kwargs)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/opt/stack/new/manila/manila/api/openstack/wsgi.py", line 688, in __call__
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault content_type, body, accept)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/opt/stack/new/manila/manila/api/openstack/wsgi.py", line 736, in _process_stack
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault action_result = self.dispatch(meth, request, action_args)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/opt/stack/new/manila/manila/api/openstack/wsgi.py", line 812, in dispatch
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault return method(req=request, **action_args)
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/opt/stack/new/manila/manila/api/v1/share_snapshots.py", line 170, in create
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault snapshot.get('display_description'))
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault File "/opt/stack/new/manila/manila/share/api.py", line 408, in create_snapshot
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault self.db.snapshot_delete(context, share['id'])
2015-07-16 09:00:50.926 15533 ERROR manila.api.middleware.fault AttributeError: 'module' object has no attribute 'snapshot_delete'

Revision history for this message
Valeriy Ponomaryov (vponomaryov) wrote :

Please, provide steps to reproduce

Changed in manila:
milestone: none → newton-1
Changed in manila:
status: New → Invalid
Changed in manila:
status: Invalid → Confirmed
Revision history for this message
Maurice Escher (maurice-escher) wrote :

https://github.com/openstack/manila/blob/stable/train/manila/share/api.py#L1207 calls a method which is not implemented

But I'm unsure how to solve this - if we don't have a ID there, cleanup is hard.
I saw this happening because I got an db error 'Lock wait timeout exceeded' on 'INSERT INTO share_snapshots'. Nothing to cleanup there, but cleanup may be necessary if the error happens later on snapshot instance creation in https://github.com/openstack/manila/blob/stable/train/manila/db/sqlalchemy/api.py#L2515-L2526

Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :

Yeah, this would be hard without a reference. For the time-being we can fix the bug with the dead-code at least. It appears that this code here is identical to the roll back done for share creation: https://github.com/openstack/manila/blob/stable/train/manila/share/api.py#L259-L269

Revision history for this message
Vida Haririan (vhariria) wrote :
Changed in manila:
importance: Undecided → Medium
milestone: newton-1 → none
Vida Haririan (vhariria)
Changed in manila:
assignee: nobody → Kafilat Adeleke (kafilat-adeleke)
assignee: Kafilat Adeleke (kafilat-adeleke) → nobody
Revision history for this message
Vida Haririan (vhariria) wrote :
Changed in manila:
milestone: none → yoga-2
Changed in manila:
assignee: nobody → Megharth Lakhataria (megharth)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/manila/+/820262

Changed in manila:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.opendev.org/c/openstack/manila/+/820262
Committed: https://opendev.org/openstack/manila/commit/a6177bcc0d533089eff509cc62d5313d4aaa44ba
Submitter: "Zuul (22348)"
Branch: master

commit a6177bcc0d533089eff509cc62d5313d4aaa44ba
Author: Megharth <email address hidden>
Date: Thu Dec 2 20:52:57 2021 +0000

    Handle successful deletion of snapshot if quota commit fails

    Replaced a non-existing snapshot delete method
    with an appropriate one and added tests for
    the same

    Closes-Bug: #1475351
    Change-Id: Idb4b6de5108dd1862df7de97d0ffdc15282b1d74

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/manila/+/820336

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to manila (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/manila/+/820955

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to manila (master)

Reviewed: https://review.opendev.org/c/openstack/manila/+/820955
Committed: https://opendev.org/openstack/manila/commit/578e3c78c2aa90555e65924657e630bdc843be28
Submitter: "Zuul (22348)"
Branch: master

commit 578e3c78c2aa90555e65924657e630bdc843be28
Author: Goutham Pacha Ravi <email address hidden>
Date: Tue Dec 7 14:21:27 2021 -0800

    Move release notes to correct folders

    Idb4b6de5108dd1862df7de97d0ffdc15282b1d74 recently merged and
    is backport worthy to all maintained older stable releases.

    I34020da6a929f5c7ae1c63bc0f2ef338c49dbe10 was committed
    to stable/xena when it was still under development; the bug-fix
    in question is not back portable to other stable branches, so
    backporting this release note fix to stable/xena should suffice.

    Change-Id: I751b6e4a3288cde7a98c0ddc55deac7a0682010d
    Related-bug: #1942124
    Related-Bug: #1475351
    Signed-off-by: Goutham Pacha Ravi <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/manila/+/820336
Committed: https://opendev.org/openstack/manila/commit/f96d6278a06a949408aeededb0acdcfc74e284bb
Submitter: "Zuul (22348)"
Branch: stable/xena

commit f96d6278a06a949408aeededb0acdcfc74e284bb
Author: Megharth <email address hidden>
Date: Thu Dec 2 20:52:57 2021 +0000

    Handle successful deletion of snapshot if quota commit fails

    Replaced a non-existing snapshot delete method
    with an appropriate one and added tests for
    the same

    Backport notes:
    A release note fix committed to master as:
    https://review.opendev.org/c/openstack/manila/+/820955
    has been squashed into this backport.

    Closes-Bug: #1475351
    Change-Id: Idb4b6de5108dd1862df7de97d0ffdc15282b1d74
    (cherry picked from commit a6177bcc0d533089eff509cc62d5313d4aaa44ba)

tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/manila/+/823837

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/manila/+/826211

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/manila/+/823837
Committed: https://opendev.org/openstack/manila/commit/9cf0afce7ca0d1bfc4831efc8c4ae347c470f10f
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 9cf0afce7ca0d1bfc4831efc8c4ae347c470f10f
Author: Megharth <email address hidden>
Date: Thu Dec 2 20:52:57 2021 +0000

    Handle successful deletion of snapshot if quota commit fails

    Replaced a non-existing snapshot delete method
    with an appropriate one and added tests for
    the same

    Backport notes:
    A release note fix committed to master as:
    https://review.opendev.org/c/openstack/manila/+/820955
    has been squashed into this backport.

    Closes-Bug: #1475351
    Change-Id: Idb4b6de5108dd1862df7de97d0ffdc15282b1d74
    (cherry picked from commit a6177bcc0d533089eff509cc62d5313d4aaa44ba)
    (cherry picked from commit f96d6278a06a949408aeededb0acdcfc74e284bb)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/manila/+/826211
Committed: https://opendev.org/openstack/manila/commit/979c0abe27731eff6a26f7a90888537f643cf0ca
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit 979c0abe27731eff6a26f7a90888537f643cf0ca
Author: Megharth <email address hidden>
Date: Thu Dec 2 20:52:57 2021 +0000

    Handle successful deletion of snapshot if quota commit fails

    Replaced a non-existing snapshot delete method
    with an appropriate one and added tests for
    the same

    Backport notes:
    A release note fix committed to master as:
    https://review.opendev.org/c/openstack/manila/+/820955
    has been squashed into this backport.

    Closes-Bug: #1475351
    Change-Id: Idb4b6de5108dd1862df7de97d0ffdc15282b1d74
    (cherry picked from commit a6177bcc0d533089eff509cc62d5313d4aaa44ba)
    (cherry picked from commit f96d6278a06a949408aeededb0acdcfc74e284bb)
    (cherry picked from commit 9cf0afce7ca0d1bfc4831efc8c4ae347c470f10f)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/manila/+/826846

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 13.0.2

This issue was fixed in the openstack/manila 13.0.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 12.1.1

This issue was fixed in the openstack/manila 12.1.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 11.1.1

This issue was fixed in the openstack/manila 11.1.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 14.0.0.0rc1

This issue was fixed in the openstack/manila 14.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/ussuri)

Reviewed: https://review.opendev.org/c/openstack/manila/+/826846
Committed: https://opendev.org/openstack/manila/commit/4e4dab6ddf7bc66f37ad6d5f13d119969701af5d
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit 4e4dab6ddf7bc66f37ad6d5f13d119969701af5d
Author: Megharth <email address hidden>
Date: Thu Dec 2 20:52:57 2021 +0000

    Handle successful deletion of snapshot if quota commit fails

    Replaced a non-existing snapshot delete method
    with an appropriate one and added tests for
    the same

    Backport notes:
    A release note fix committed to master as:
    https://review.opendev.org/c/openstack/manila/+/820955
    has been squashed into this backport.

    Closes-Bug: #1475351
    Change-Id: Idb4b6de5108dd1862df7de97d0ffdc15282b1d74
    (cherry picked from commit a6177bcc0d533089eff509cc62d5313d4aaa44ba)
    (cherry picked from commit f96d6278a06a949408aeededb0acdcfc74e284bb)
    (cherry picked from commit 9cf0afce7ca0d1bfc4831efc8c4ae347c470f10f)
    (cherry picked from commit 979c0abe27731eff6a26f7a90888537f643cf0ca)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/c/openstack/manila/+/835661

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/train)

Reviewed: https://review.opendev.org/c/openstack/manila/+/835661
Committed: https://opendev.org/openstack/manila/commit/4c903aca55594c1a6c9dbb0b1516968b3fd5a42a
Submitter: "Zuul (22348)"
Branch: stable/train

commit 4c903aca55594c1a6c9dbb0b1516968b3fd5a42a
Author: Megharth <email address hidden>
Date: Thu Dec 2 20:52:57 2021 +0000

    Handle successful deletion of snapshot if quota commit fails

    Replaced a non-existing snapshot delete method
    with an appropriate one and added tests for
    the same

    Backport notes:
    A release note fix committed to master as:
    https://review.opendev.org/c/openstack/manila/+/820955
    has been squashed into this backport.

    Closes-Bug: #1475351
    Change-Id: Idb4b6de5108dd1862df7de97d0ffdc15282b1d74
    (cherry picked from commit a6177bcc0d533089eff509cc62d5313d4aaa44ba)
    (cherry picked from commit f96d6278a06a949408aeededb0acdcfc74e284bb)
    (cherry picked from commit 9cf0afce7ca0d1bfc4831efc8c4ae347c470f10f)
    (cherry picked from commit 979c0abe27731eff6a26f7a90888537f643cf0ca)
    (cherry picked from commit 4e4dab6ddf7bc66f37ad6d5f13d119969701af5d)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila ussuri-eol

This issue was fixed in the openstack/manila ussuri-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila train-eol

This issue was fixed in the openstack/manila train-eol release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.