Error "directory /etc/resolv.conf for resolv-file is missing, cannot poll"

Hello,

I’m getting these errors at boot (journalctl -b message)

“dnsmasq[2621]: directory /etc/resolv.conf for resolv-file is missing, cannot poll”
“dnsmasq[2621]: FAILED to start up”

which then lead to:

libvirtd[2115]: internal error: Child process (VIR_BRIDGE_NAME=virbr1 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/VirN.conf --leasefile-ro --dhcp-script=/usr/lib64/libvirt/libvi>
dnsmasq: directory /etc/resolv.conf for resolv-file is missing, cannot poll

Could not find any helpful google results.

Thanks.

I’m not sure what you are doing there. Your output shows “libvirt”, so is the problem on the libvirt server or on a virtual machine?

In any case, in Leap 15.1, “/etc/resolv.conf” should be a symbolic link:

lrwxrwxrwx 1 root root 30 May 11  2019 /etc/resolv.conf -> /var/run/netconfig/resolv.conf

If it is actually a directory, then it is not clear how that happened. And then there’s the question of whether “/etc/resolv.conf” is itself a directory, or whether the symlink incorrectly points to a directory.

If “/etc/resolv.conf” is itself a directory, I guess you could try removing (or renaming) that, and then run:

netconfig -f update

to create the correct link.

If, instead, “/var/run/netconfig/resolv.conf” is a directory, then I would suggest rebooting to fix that (it is in a temp file system that is recreated at boot).

Here’s the output.

ls -la /etc
...
lrwxrwxrwx   1 root root          30 Sep 16 18:24 resolv.conf -> /var/run/netconfig/resolv.conf
...


ls /var/run/netconfig/ -la
...
-rw-r--r--  1 root root  625 Feb  5 08:51 resolv.conf
...

I am running a windows guest machine using virt-manager/qemu on the host oss leap. I find that on each boot I have to manually
start the virtual network before being able to run the guest machine, while the specific virtual network has “autostart on boot”
already enabled. The libvirtd service is also enabled as “on boot”.
I’m thinking that the above error leads to this issue. Otherwise I’d not have noticed it at all.

I’m just using bridged networking in virtual machines, and not having problems – probably because I don’t need that virtual network. Perhaps a bug report would be appropriate.

Looks to me a dnsmasq mis-configuration.
Am guessing there’s a trailing forward slash in the line for resolv.conf in the file
/var/lib/libvirt/dnsmasq/VirN.conf

How did you create this bridge device? The name suggests you manually created it somehow. Which tool did you use?
Depending on whether you think the error was User or not, maybe a bug report is warranted.

TSU

I created the VirN with virt-manager (GUI). The content of the file is:

##WARNING:  THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
##OVERWRITTEN AND LOST.  Changes to this configuration should be made using:
##    virsh net-edit VirN
## or other application using the libvirt API.
##
## dnsmasq conf file created by libvirt
strict-order
domain=VirN
expand-hosts
pid-file=/var/run/libvirt/network/VirN.pid
except-interface=lo
bind-dynamic
interface=virbr1
dhcp-range=10.0.2.8,10.0.2.14,255.255.255.240
dhcp-no-override
dhcp-authoritative
dhcp-lease-max=7
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/VirN.hostsfile
addn-hosts=/var/lib/libvirt/dnsmasq/VirN.addnhosts