Bug 1260885

Summary: Misleading error message if run directory doesn't exit
Product: Red Hat Enterprise Linux 6 Reporter: Pavel Zhukov <pzhukov>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.7CC: dyuan, fjin, jtomko, rbalakri, zhwang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-10 07:57:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pavel Zhukov 2015-09-08 07:18:11 UTC
Description of problem:
If /var/run/libvirt directory doesn't exist for any reason libvirt is failed to start with message:
"2015-09-07 13:28:51.647+0000: 13167: error : virNetSocketNewListenTCP:239 : Unable to resolve address '0.0.0.0' service '16514': Address family for hostname not supported" 
which is absolutely misleading and making debug time consuming

Version-Release number of selected component (if applicable):
2015-09-07 13:28:51.647+0000: 13167: info : libvirt version: 0.10.2, package: 54.el6 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2015-04-28-09:24:16, x86-033.build.eng.bos.redhat.com)


How reproducible:
100%

Steps to Reproduce:
1. service libvirtd stop
2. rm -rf /var/run/libvirtd
3. service libvird start

Actual results:
2015-09-07 13:28:51.647+0000: 13167: info : libvirt version: 0.10.2, package: 54.el6 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2015-04-28-09:24:16, x86-033.build.eng.bos.redhat.com)
2015-09-07 13:28:51.647+0000: 13167: error : virNetSocketNewListenTCP:239 : Unable to resolve address '0.0.0.0' service '16514': Address family for hostname not supported


Expected results:
Something like
"Unable to open "/var/run/livirt" no such file or directory"

Additional info:

Comment 2 Ján Tomko 2015-09-08 14:11:35 UTC
Libvirt automatically creates /var/run/libvirt on startup, there should be no error message if it does not exist.

The error message comes from calling getaddrinfo on "0.0.0.0" with AI_ADDRCONFIG set in the hints. It means there are no IPv4 addresses configured (apart from 127.0.0.1) and it is unrelated to the existence of /var/run/libvirt, making this NOTABUG.

On RHEL 7, libvirt no longer uses AI_ADDRCONFIG for wildcard addresses, because it interfered with systemd's parallel startup:
https://bugzilla.redhat.com/show_bug.cgi?id=1098659
On RHEL 6, libvirt should only be started after the network is configured.

Comment 4 Pavel Zhukov 2015-09-10 07:57:22 UTC
Closed as per #2