Bug 1405115 - Error in error handler hide the real error when removing volume runlink
Summary: Error in error handler hide the real error when removing volume runlink
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: vdsm
Classification: oVirt
Component: Core
Version: 4.18.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.1.0-beta
: ---
Assignee: Nir Soffer
QA Contact: Elad
URL:
Whiteboard:
Depends On:
Blocks: 1416335
TreeView+ depends on / blocked
 
Reported: 2016-12-15 16:11 UTC by Nir Soffer
Modified: 2017-04-03 14:01 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1416335 (view as bug list)
Environment:
Last Closed: 2017-01-31 11:38:40 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.1+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 68535 0 master MERGED blockSD: Fix error in error handler 2016-12-15 17:22:43 UTC
oVirt gerrit 68538 0 ovirt-4.0 MERGED blockSD: Fix error in error handler 2016-12-15 22:56:24 UTC

Description Nir Soffer 2016-12-15 16:11:56 UTC
Description of problem:

An unfortunate typo in a error handler cause an AttriuteError when handling
an error to remove a volume run link (e.g. /run/vdsm/sd/img/vol):

I'm getting in VDSM:
2016-12-15 05:01:50,098 INFO  (merge/7adfae6f) [storage.StorageDomainManifest] Unlinking volme runtime link: u'/var/run/vdsm/storage/95e01177-20bf-4240-8656-3774e22deda0/1440299f-e24f-4d12-a6ba-ee583de8ed58/fae82f50-2d2c-406d-a293-c1f05125dc20' (blockSD:911)
2016-12-15 05:01:50,098 ERROR (merge/7adfae6f) [root] Unhandled exception (utils:369)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/utils.py", line 366, in wrapper
    return f(*a, **kw)
  File "/usr/share/vdsm/virt/vm.py", line 5000, in run
    self.teardown_top_volume()
  File "/usr/share/vdsm/virt/vm.py", line 4988, in teardown_top_volume
    self.job['topVolume'])
  File "/usr/share/vdsm/storage/blockSD.py", line 903, in teardownVolume
    self.removeVolumeRunLink(imgUUID, volUUID)
  File "/usr/share/vdsm/storage/blockSD.py", line 915, in removeVolumeRunLink
    if e.error != errno.ENOENT:
AttributeError: 'exceptions.OSError' object has no attribute 'error'
2016-12-15 05:01:50,098 ERROR (merge/7adfae6f) [root] Unhandled exception (utils:369)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/utils.py", line 366, in wrapper
    return f(*a, **kw)
  File "/usr/lib/python2.7/site-packages/vdsm/concurrent.py", line 180, in run
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/vdsm/utils.py", line 366, in wrapper
    return f(*a, **kw)
  File "/usr/share/vdsm/virt/vm.py", line 5000, in run
    self.teardown_top_volume()
  File "/usr/share/vdsm/virt/vm.py", line 4988, in teardown_top_volume
    self.job['topVolume'])
  File "/usr/share/vdsm/storage/blockSD.py", line 903, in teardownVolume
    self.removeVolumeRunLink(imgUUID, volUUID)
  File "/usr/share/vdsm/storage/blockSD.py", line 915, in removeVolumeRunLink
    if e.error != errno.ENOENT:
AttributeError: 'exceptions.OSError' object has no attribute 'error'


Version-Release number of selected component (if applicable):
vdsm-4.18.999-1162.gite95442e.el7.centos.x86_64


How reproducible:
Unknown, see once few month after the code was introduced.

Steps to Reproduce:
Unknown

Actual results:
Getting AttributeError about the wrong name.

Expected results:

1. If the link does not exists, nothing, this is expected condition. The only way
   to test for this condition correctly is to remove the link and check if 
   the operation failed with ENOENT.

2. If the link cannot be remove, fail loudly. This is unexpected situation that
   should never happen.

This is likely an expected condition (no link), but it may hide serious errors.

Comment 1 Sandro Bonazzola 2017-01-25 07:54:45 UTC
4.0.6 has been the last oVirt 4.0 release, please re-target this bug.

Comment 2 Elad 2017-01-31 09:36:51 UTC
Nir/Ala, any idea how to reproduce?

Comment 3 Nir Soffer 2017-01-31 11:19:49 UTC
Elad, I don't think it will be easy to reproduce, this happens only in certain negative flows. The fix is trivial so I don't think we should spend too much time
on "verifying" it.

Comment 4 Elad 2017-01-31 11:38:40 UTC
Based on comment #3 moving to CLOSED UPSTREAM

Comment 5 Ala Hino 2017-02-13 12:26:14 UTC
Bug is already closed and needinfo already addressed - comment #3


Note You need to log in before you can comment on or make changes to this bug.