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 598157 - virt-install: provide better error message if libvirtd not running/installed
Summary: virt-install: provide better error message if libvirtd not running/installed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-virtinst
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Cole Robinson
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-31 15:35 UTC by Michael S. Tsirkin
Modified: 2011-05-19 13:45 UTC (History)
8 users (show)

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.
Clone Of:
Environment:
Last Closed: 2011-05-19 13:45:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0636 0 normal SHIPPED_LIVE python-virtinst bug fix and enhancement update 2011-05-18 17:55:48 UTC

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


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