Bug 598157 - virt-install: provide better error message if libvirtd not running/installed
virt-install: provide better error message if libvirtd not running/installed
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-virtinst (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Cole Robinson
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-31 11:35 EDT by Michael S. Tsirkin
Modified: 2011-05-19 09:45 EDT (History)
8 users (show)

See Also:
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 09:45:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0636 normal SHIPPED_LIVE python-virtinst bug fix and enhancement update 2011-05-18 13:55:48 EDT

  None (edit)
Description Michael S. Tsirkin 2010-05-31 11:35:08 EDT
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 13:37:24 EDT
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 11:32:23 EDT
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 11:35:09 EDT
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 12:26:06 EDT
(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 15:45:08 EDT
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 17:09:02 EST
Fix built in python-virtinst-0.500.5-1.el6
Comment 10 koka xiong 2011-01-19 00:00:20 EST
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 06:07:26 EDT
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 19:40:20 EDT
    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 17:45:29 EDT
    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 09:45:24 EDT
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

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