RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 903673 - VDSM - Infra: Failed to initialize storage during VDSM self-restart
Summary: VDSM - Infra: Failed to initialize storage during VDSM self-restart
Keywords:
Status: CLOSED DUPLICATE of bug 890365
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: vdsm
Version: 6.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Dan Kenigsberg
QA Contact: Haim
URL:
Whiteboard: infra
Depends On:
Blocks: 896506
TreeView+ depends on / blocked
 
Reported: 2013-01-24 14:49 UTC by Daniel Paikov
Modified: 2014-01-13 00:55 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-27 10:17:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
vdsm.log (725.82 KB, application/x-compressed-tar)
2013-01-24 14:49 UTC, Daniel Paikov
no flags Details

Description Daniel Paikov 2013-01-24 14:49:17 UTC
Created attachment 686807 [details]
vdsm.log

* DC with 1 host, 1 iSCSI data domain.
* Block domain with iptables.
* VDSM self-restarts and fails to initialize storage.

MainThread::ERROR::2013-01-24 15:40:22,129::clientIF::260::vds::(_initIRS) Error initializing IRS
Traceback (most recent call last):
  File "/usr/share/vdsm/clientIF.py", line 258, in _initIRS
    self.irs = Dispatcher(HSM())
  File "/usr/share/vdsm/storage/hsm.py", line 349, in __init__
    if not multipath.isEnabled():
  File "/usr/share/vdsm/storage/multipath.py", line 90, in isEnabled
    mpathconf = svdsm.readMultipathConf()
  File "/usr/share/vdsm/supervdsm.py", line 76, in __call__
    return callMethod()
  File "/usr/share/vdsm/supervdsm.py", line 66, in <lambda>
    getattr(self._supervdsmProxy._svdsm, self._funcName)(*args,
AttributeError: 'ProxyCaller' object has no attribute 'readMultipathConf'

* All vdsClient commands fail with "Failed to initialize storage".

Comment 3 Federico Simoncelli 2013-01-24 16:03:27 UTC
There is a race in (vdsm/supervdsm.py):

    def isRunning(self):
        try:
            with open(self.pidfile, "r") as f:
                spid = f.read().strip()
            with open(self.timestamp, "r") as f:
                createdTime = f.read().strip()
        except IOError as e:
            # pid file and timestamp file must be exist after first launch,
            # otherwise excpetion will be raised to svdsm caller
            if e.errno == ENOENT and self._firstLaunch:
                return False
            else:
                raise

        try:
            pTime = str(misc.getProcCtime(spid))
        except OSError as e:
            if e.errno == ESRCH:
                # Means pid is not exist, svdsm was killed
                return False
            else:
                raise

        if pTime == createdTime:
            return True
        else:
            return False

When vdsm starts the isRunning check would be successful also for a previous instance of superVdsm (to which vdsm is not connected).
In ProxyCaller then we would skip the launch part going straight to "return callMethod()":

class ProxyCaller(object):
    def __call__(self, *args, **kwargs):
        callMethod = lambda: \
            getattr(self._supervdsmProxy._svdsm, self._funcName)(*args,
                                                                 **kwargs)
        if not self._supervdsmProxy.isRunning():
            # getting inside only when svdsm is down. its rare case so we
            # don't care that isRunning will run twice
            with self._supervdsmProxy.proxyLock:
                if not self._supervdsmProxy.isRunning():
                    self._supervdsmProxy.launch()

        try:
            return callMethod()

This has been also verified adding the following debug line to isRunning:

 self._log.debug("BZ903673: %s %s %s", spid, pTime, createdTime)

And the logs reported that indeed vdsm at the startup found a previous superVdsm instance still running:

PolicyEngine::DEBUG::2013-01-24 17:53:45,170::supervdsm::166::SuperVdsmProxy::(isRunning) BZ903673: 14545 1359042231.31 1359042231.31
[...]
MainThread::INFO::2013-01-24 17:54:15,788::vdsm::88::vds::(run) I am the actual vdsm 4.10-1.2 orange-vdsf.qa.lab.tlv.redhat.com (2.6.32-355.el6.x86_64)
[...]
MainThread::DEBUG::2013-01-24 17:54:16,125::supervdsm::166::SuperVdsmProxy::(isRunning) BZ903673: 14545 1359042231.31 1359042231.31
MainThread::ERROR::2013-01-24 17:54:16,125::clientIF::260::vds::(_initIRS) Error initializing IRS
Traceback (most recent call last):
  File "/usr/share/vdsm/clientIF.py", line 258, in _initIRS
    self.irs = Dispatcher(HSM())
  File "/usr/share/vdsm/storage/hsm.py", line 349, in __init__
    if not multipath.isEnabled():
  File "/usr/share/vdsm/storage/multipath.py", line 90, in isEnabled
    mpathconf = svdsm.readMultipathConf()
  File "/usr/share/vdsm/supervdsm.py", line 76, in __call__
    return callMethod()
  File "/usr/share/vdsm/supervdsm.py", line 66, in <lambda>
    getattr(self._supervdsmProxy._svdsm, self._funcName)(*args,
AttributeError: 'ProxyCaller' object has no attribute 'readMultipathConf'

Comment 5 Federico Simoncelli 2013-01-25 11:05:40 UTC
Probably a duplicate of bug 890365

Comment 6 Yaniv Bronhaim 2013-01-27 10:17:48 UTC
yes. same issue, after blocking storage connectivity, vdsm is restarted and the bug caused a race by using internal uninitialized variable.

This is the fix for that issue - http://gerrit.ovirt.org/#/c/10491

*** This bug has been marked as a duplicate of bug 890365 ***


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