Bug 598157

Summary: virt-install: provide better error message if libvirtd not running/installed
Product: Red Hat Enterprise Linux 6 Reporter: Michael S. Tsirkin <mst>
Component: python-virtinstAssignee: Cole Robinson <crobinso>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: dallan, hbrock, kxiong, mhideo, snagar, syeghiay, xen-maint, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
An error message informing the user that libvirtd needs to be started is now displayed when virt-install is used without libvirtd running.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 13:45:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michael S. Tsirkin 2010-05-31 15:35:08 UTC
Description of problem:
I installed virt-manager, started it and got this backtrace:

ERROR    unable to connect to '/var/run/libvirt/libvirt-sock', libvirtd may need to be started: No such file or directory
Traceback (most recent call last):
  File "/usr/sbin/virt-install", line 1054, in <module>
    main()
  File "/usr/sbin/virt-install", line 810, in main
    conn = cli.getConnection(options.connect)
  File "/usr/lib/python2.6/site-packages/virtinst/cli.py", line 217, in getConnection
    conn = open_connection(connect)
  File "/usr/lib/python2.6/site-packages/virtinst/cli.py", line 232, in open_connection
    open_flags)
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 111, in openAuth
    if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirtError: unable to connect to '/var/run/libvirt/libvirt-sock', libvirtd may need to be started: No such file or directory


Version-Release number of selected component (if applicable):
virt-manager-0.8.4-3.el6.noarch

How reproducible:
always

Steps to Reproduce:
1. yum install virt-manager
2. virt-install
  
Actual results:
Got error backtrace

Expected results:
Should either succeed or give graceful error
with instructions on how to fix it


Additional info:
I think rpm should start libvirtd or depend
on an rp that does this if it's required.

Comment 2 Cole Robinson 2010-06-01 17:37:24 UTC
virt-manager doesn't strictly require libvirtd, so doesn't and won't have a dependency on it. We do attempt to talk to PackageKit at app startup and check offer to install libvirt and kvm if they aren't available, but it doesn't sound like you have PackageKit installed. Not sure we should make that a hard dependency either though.

Did a dialog not appear that gave a nicer error message? 'Unable to open a connection to the libvirt management daemon... verify that the libvirtd daemon has started."

Comment 3 Michael S. Tsirkin 2010-06-08 15:32:23 UTC
No, I pasted the output above.
Also, I do not really understand why you say 'doesn't strictly require libvirtd'
if it crashes without.

Comment 4 Michael S. Tsirkin 2010-06-08 15:35:09 UTC
No nice message, I pasted the output above.

Also, I do not really understand why you say 'doesn't strictly require libvirtd'
if it crashes without.

Comment 5 Cole Robinson 2010-06-09 16:26:06 UTC
(In reply to comment #4)
> No nice message, I pasted the output above.
> 
> Also, I do not really understand why you say 'doesn't strictly require
> libvirtd'
> if it crashes without.    

Because the crashing is not intended or expected behavior, and I can't reproduce here. If libvirtd isn't installed or running, virt-manager starts up fine, but shows an error dialog with a better message. Not really sure why you aren't seeing that message.

And now that I pay closer attention to your original message, I realize that you are NOT running virt-manager, and instead running virt-install. These are two distinct applications.

virt-install also does not strictly require libvirtd on the local machine, since you could be doing a remote install. We can try and provide a nicer error message though, like we already do with virt-manager. We can use this bug to track that issue.

Comment 7 Cole Robinson 2010-08-23 19:45:08 UTC
Upstream now won't show a backtrace, just the error message:

http://hg.fedorahosted.org/hg/python-virtinst/rev/1ce01e8c1ea4

I think the libvirt error message is descriptive enough for a CLI tool failure, so the above should be sufficient to improve this situation.

Comment 8 Cole Robinson 2011-01-14 22:09:02 UTC
Fix built in python-virtinst-0.500.5-1.el6

Comment 10 koka xiong 2011-01-19 05:00:20 UTC
Verified with python-virtinst-0.500.5-1.el6 passed.
1.Run service libvirtd stop
2.Run virt-install
ERROR    unable to connect to '/var/run/libvirt/libvirt-sock', libvirtd may need to be started: No such file or directory
3.It won't show a backtrace now,just the error message.
So the bug is passed.

Comment 12 zhe peng 2011-04-15 10:07:26 UTC
verified this bug with:
Linux localhost.localdomain 2.6.32-130.el6.x86_64 #1 SMP Tue Apr 5 19:58:31 EDT
2011 x86_64 x86_64 x86_64 GNU/Linux

python-virtinst-0.500.5-3.el6.noarch
libvirt-0.8.7-17.el6.x86_64

passed.

Comment 14 Michael Hideo 2011-05-12 23:40:20 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
* An error message informing the user that libvirtd needs to be started is now displayed when virt-install is used without libvirtd running. (BZ#598157)

Comment 15 Michael Hideo 2011-05-16 21:45:29 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-* An error message informing the user that libvirtd needs to be started is now displayed when virt-install is used without libvirtd running. (BZ#598157)+An error message informing the user that libvirtd needs to be started is now displayed when virt-install is used without libvirtd running.

Comment 16 errata-xmlrpc 2011-05-19 13:45:24 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0636.html