All of lore.kernel.org
 help / color / mirror / Atom feed
* reports of xend not starting
@ 2010-03-04 19:03 Jim Fehlig
  2010-03-05  6:05 ` Masaki Kanno
  0 siblings, 1 reply; 4+ messages in thread
From: Jim Fehlig @ 2010-03-04 19:03 UTC (permalink / raw)
  To: Masaki Kanno; +Cc: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1998 bytes --]

Hi Kan,

I've received several reports of xend not starting with the following
traceback

[2010-03-04 13:24:10 9096] ERROR (SrvDaemon:349) Exception starting xend ('044dde78-2896-cb88-2ada-3c03a73c35c1')
Traceback (most recent call last):
  File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvDaemon.py", line 341, in run
    servers = SrvServer.create()
  File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvServer.py", line 261, in create
    root.putChild('xend', SrvRoot())
  File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvRoot.py", line 40, in __init__
    self.get(name)
  File "/usr/lib64/python2.6/site-packages/xen/web/SrvDir.py", line 84, in get
    val = val.getobj()
  File "/usr/lib64/python2.6/site-packages/xen/web/SrvDir.py", line 52, in getobj
    self.obj = klassobj()
  File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvNode.py", line 30, in __init__
    self.xn = XendNode.instance()
  File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 1187, in instance
    inst = XendNode()
  File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 161, in __init__
    self._init_PSCSIs()
  File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 339, in _init_PSCSIs
    saved_HBA_uuid = saved_pscsis[pscsi_uuid].get('HBA', None)
KeyError: '044dde78-2896-cb88-2ada-3c03a73c35c1'


All reported cases involve fresh installs of dom0, so
/var/lib/xend/state/ is empty.  I wasn't able to reproduce the issue
myself but a reporter was kind enough to try a debug patch. I found that
vscsi_util.get_all_scsi_devices() returns several records containing
same scsi_id.  With /var/lib/xend/state/pscsi.xml non-existent and
identical scsi_id, we access an element of saved_pscsis that does not
exist.  In fact, the list is empty.

The attached patch catches the exception and allows xend to start but
I'm not sure if this breaks other parts of the code.  It looks safe to
me but would like your review.

Regards,
Jim


[-- Attachment #2: xend-state-store.patch --]
[-- Type: text/x-patch, Size: 821 bytes --]

Index: xen-4.0.0-testing/tools/python/xen/xend/XendNode.py
===================================================================
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendNode.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendNode.py
@@ -336,7 +336,10 @@ class XendNode:
                     pscsi_uuid = uuid.createString()
                     saved_pscsi_table[scsi_id] = pscsi_uuid
                 else:
-                    saved_HBA_uuid = saved_pscsis[pscsi_uuid].get('HBA', None)
+                    try:
+                        saved_HBA_uuid = saved_pscsis[pscsi_uuid].get('HBA', None)
+                    except KeyError:
+                        pass
 
                 physical_host = int(pscsi_record['physical_HCTL'].split(':')[0])
                 if pscsi_HBA_table.has_key(physical_host):

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: reports of xend not starting
  2010-03-04 19:03 reports of xend not starting Jim Fehlig
@ 2010-03-05  6:05 ` Masaki Kanno
  2010-03-05 15:23   ` Jim Fehlig
  0 siblings, 1 reply; 4+ messages in thread
From: Masaki Kanno @ 2010-03-05  6:05 UTC (permalink / raw)
  To: Jim Fehlig; +Cc: xen-devel

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 2413 bytes --]

Thu, 04 Mar 2010 12:03:17 -0700, Jim Fehlig wrote:

>Hi Kan,
>
>I've received several reports of xend not starting with the following
>traceback
>
>[2010-03-04 13:24:10 9096] ERROR (SrvDaemon:349) Exception starting xend (
>'044dde78-2896-cb88-2ada-3c03a73c35c1')
>Traceback (most recent call last):
>  File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvDaemon.py", 
>line 341, in run
>    servers = SrvServer.create()
>  File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvServer.py", 
>line 261, in create
>    root.putChild('xend', SrvRoot())
>  File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvRoot.py", 
>line 40, in __init__
>    self.get(name)
>  File "/usr/lib64/python2.6/site-packages/xen/web/SrvDir.py", line 84, in 
>get
>    val = val.getobj()
>  File "/usr/lib64/python2.6/site-packages/xen/web/SrvDir.py", line 52, in 
>getobj
>    self.obj = klassobj()
>  File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvNode.py", 
>line 30, in __init__
>    self.xn = XendNode.instance()
>  File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 1187
>, in instance
>    inst = XendNode()
>  File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 161,
> in __init__
>    self._init_PSCSIs()
>  File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 339,
> in _init_PSCSIs
>    saved_HBA_uuid = saved_pscsis[pscsi_uuid].get('HBA', None)
>KeyError: '044dde78-2896-cb88-2ada-3c03a73c35c1'
>
>
>All reported cases involve fresh installs of dom0, so
>/var/lib/xend/state/ is empty.  I wasn't able to reproduce the issue
>myself but a reporter was kind enough to try a debug patch. I found that
>vscsi_util.get_all_scsi_devices() returns several records containing
>same scsi_id.  With /var/lib/xend/state/pscsi.xml non-existent and
>identical scsi_id, we access an element of saved_pscsis that does not
>exist.  In fact, the list is empty.
>
>The attached patch catches the exception and allows xend to start but
>I'm not sure if this breaks other parts of the code.  It looks safe to
>me but would like your review.
>

Hi Jim,

Thanks for your report and patch.

Are your SCSI devices multi-path configuration?
If so, the configuration isn't supported by pvSCSI of XenAPI yet.

I added a small fix to your patch.  Could you send your Signed-off-by 
line?

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>

Best regards,
 Kan


[-- Attachment #2: multi_path_scsi.patch --]
[-- Type: application/octet-stream, Size: 850 bytes --]

diff -r b8d2a4134a68 tools/python/xen/xend/XendNode.py
--- a/tools/python/xen/xend/XendNode.py	Wed Mar 03 17:41:58 2010 +0000
+++ b/tools/python/xen/xend/XendNode.py	Fri Mar 05 14:45:57 2010 +0900
@@ -333,7 +333,11 @@
                     pscsi_uuid = uuid.createString()
                     saved_pscsi_table[scsi_id] = pscsi_uuid
                 else:
-                    saved_HBA_uuid = saved_pscsis[pscsi_uuid].get('HBA', None)
+                    try:
+                        saved_HBA_uuid = saved_pscsis[pscsi_uuid].get('HBA', None)
+                    except KeyError:
+                        log.warn("Multi-path SCSI devices are not supported for XenAPI")
+                        return
 
                 physical_host = int(pscsi_record['physical_HCTL'].split(':')[0])
                 if pscsi_HBA_table.has_key(physical_host):

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: reports of xend not starting
  2010-03-05  6:05 ` Masaki Kanno
@ 2010-03-05 15:23   ` Jim Fehlig
  0 siblings, 0 replies; 4+ messages in thread
From: Jim Fehlig @ 2010-03-05 15:23 UTC (permalink / raw)
  To: Masaki Kanno; +Cc: xen-devel

Masaki Kanno wrote:
> Thu, 04 Mar 2010 12:03:17 -0700, Jim Fehlig wrote:
>
>   
>> Hi Kan,
>>
>> I've received several reports of xend not starting with the following
>> traceback
>>
>> [2010-03-04 13:24:10 9096] ERROR (SrvDaemon:349) Exception starting xend (
>> '044dde78-2896-cb88-2ada-3c03a73c35c1')
>> Traceback (most recent call last):
>>  File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvDaemon.py", 
>> line 341, in run
>>    servers = SrvServer.create()
>>  File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvServer.py", 
>> line 261, in create
>>    root.putChild('xend', SrvRoot())
>>  File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvRoot.py", 
>> line 40, in __init__
>>    self.get(name)
>>  File "/usr/lib64/python2.6/site-packages/xen/web/SrvDir.py", line 84, in 
>> get
>>    val = val.getobj()
>>  File "/usr/lib64/python2.6/site-packages/xen/web/SrvDir.py", line 52, in 
>> getobj
>>    self.obj = klassobj()
>>  File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvNode.py", 
>> line 30, in __init__
>>    self.xn = XendNode.instance()
>>  File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 1187
>> , in instance
>>    inst = XendNode()
>>  File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 161,
>> in __init__
>>    self._init_PSCSIs()
>>  File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 339,
>> in _init_PSCSIs
>>    saved_HBA_uuid = saved_pscsis[pscsi_uuid].get('HBA', None)
>> KeyError: '044dde78-2896-cb88-2ada-3c03a73c35c1'
>>
>>
>> All reported cases involve fresh installs of dom0, so
>> /var/lib/xend/state/ is empty.  I wasn't able to reproduce the issue
>> myself but a reporter was kind enough to try a debug patch. I found that
>> vscsi_util.get_all_scsi_devices() returns several records containing
>> same scsi_id.  With /var/lib/xend/state/pscsi.xml non-existent and
>> identical scsi_id, we access an element of saved_pscsis that does not
>> exist.  In fact, the list is empty.
>>
>> The attached patch catches the exception and allows xend to start but
>> I'm not sure if this breaks other parts of the code.  It looks safe to
>> me but would like your review.
>>
>>     
>
> Hi Jim,
>
> Thanks for your report and patch.
>
> Are your SCSI devices multi-path configuration?
>   

Yes, it appears all of the reports have multipath configured.

> If so, the configuration isn't supported by pvSCSI of XenAPI yet.
>
> I added a small fix to your patch.  Could you send your Signed-off-by 
> line?
>   

Ok, thanks for the review and changes.

Cheers,
Jim

Signed-off-by: Jim Fehlig<jfehlig@novell.com>


> Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
>
> Best regards,
>  Kan
>
>   

^ permalink raw reply	[flat|nested] 4+ messages in thread

* reports of xend not starting
@ 2010-03-22 23:07 Jim Fehlig
  0 siblings, 0 replies; 4+ messages in thread
From: Jim Fehlig @ 2010-03-22 23:07 UTC (permalink / raw)
  To: yunhong.jiang; +Cc: xen-devel

[-- Attachment #1: Type: text/plain, Size: 2193 bytes --]

Hi,

I received reports of xend not starting with following traceback:

[2010-03-22 14:11:56 4943] ERROR (SrvDaemon:349) Exception starting xend (ord()
expected a character, but string of length 0 found)
Traceback (most recent call last):
  File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvDaemon.py", line
341, in run
    servers = SrvServer.create()
  File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvServer.py", line
261, in create
    root.putChild('xend', SrvRoot())
  File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvRoot.py", line
40, in __init__
    self.get(name)
  File "/usr/lib64/python2.6/site-packages/xen/web/SrvDir.py", line 84, in get
    val = val.getobj()
  File "/usr/lib64/python2.6/site-packages/xen/web/SrvDir.py", line 52, in
getobj
    self.obj = klassobj()
  File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvNode.py", line
30, in __init__
    self.xn = XendNode.instance()
  File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 1191, in
instance
    inst = XendNode()
  File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 159, in
__init__
    self._init_PPCIs()
  File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 282, in
_init_PPCIs
    for pci_dev in PciUtil.get_all_pci_devices():
  File "/usr/lib64/python2.6/site-packages/xen/util/pci.py", line 469, in
get_all_pci_devices
    return map(PciDevice, get_all_pci_dict())
  File "/usr/lib64/python2.6/site-packages/xen/util/pci.py", line 693, in
__init__
    self.get_info_from_sysfs()
  File "/usr/lib64/python2.6/site-packages/xen/util/pci.py", line 1256, in
get_info_from_sysfs
    self.find_capability(0x11)
  File "/usr/lib64/python2.6/site-packages/xen/util/pci.py", line 1229, in
find_capability
    capa_pointer = ord(conf_file.read(1))
TypeError: ord() expected a character, but string of length 0 found
[2010-03-22 14:11:56 4942] INFO (SrvDaemon:220) Xend exited with status 1.


I won't pretend to know the code but looks like some protection against
read() returning an empty string (EOF) is in order.  Is the attached
patch appropriate?

Regards,
Jim

    Signed-off-by:  Jim Fehlig <jfehlig@novell.com>



[-- Attachment #2: xend-startup-fix.patch --]
[-- Type: text/x-patch, Size: 624 bytes --]

Index: xen-4.0.0-testing/tools/python/xen/util/pci.py
===================================================================
--- xen-4.0.0-testing.orig/tools/python/xen/util/pci.py
+++ xen-4.0.0-testing/tools/python/xen/util/pci.py
@@ -1251,6 +1251,9 @@ class PciDevice:
         except IOError, (errno, strerr):
             raise PciDeviceParseError(('Failed to locate sysfs mount: %s: %s (%d)' %
                 (PROC_PCI_PATH, strerr, errno)))
+        except TypeError, err:
+            log.debug("Caught TypeError '%s'" % err)
+            pass
 
     def get_info_from_sysfs(self):
         self.find_capability(0x11)

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-22 23:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-04 19:03 reports of xend not starting Jim Fehlig
2010-03-05  6:05 ` Masaki Kanno
2010-03-05 15:23   ` Jim Fehlig
2010-03-22 23:07 Jim Fehlig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.