Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dhcpcd: Failed to set DNS configuration #76969

Closed
demokritos opened this issue Jan 5, 2020 · 8 comments
Closed

dhcpcd: Failed to set DNS configuration #76969

demokritos opened this issue Jan 5, 2020 · 8 comments

Comments

@demokritos
Copy link

Describe the bug
/etc/resolv.conf doesn't have a name server.

journal:

dhcpcd[685]: Failed to revert interface configuration: Unit dbus-org.freedesktop.resolve1.service not found.

To Reproduce
Steps to reproduce the behavior:

  1. nixos-rebuild switch with the latest nixos-unstable channel.
  2. reboot
  3. cat /etc/resolv.conf

Expected behavior
/etc/resolv.conf should have a nameserver field with my router address.

Screenshots

dhcpcd[685]: Failed to revert interface configuration: Unit dbus-org.freedesktop.resolve1.service not found.
nscd[688]: 688 monitoring file `/etc/hosts` (4)
systemd[1]: Listening on Nix Daemon Socket.
dhcpcd[685]: Failed to revert interface configuration: Unit dbus-org.freedesktop.resolve1.service not found.
nscd[688]: 688 monitoring directory `/etc` (2)
systemd[1]: Reached target Sockets.
dhcpcd[685]: Failed to revert interface configuration: Unit dbus-org.freedesktop.resolve1.service not found.
rngd[689]: Initializing available sources
rngd[689]: [hwrng ]: Initialized
rngd[689]: [jitter]: Initializing AES buffer
rngd[689]: [jitter]: Unable to obtain AES key, disabling AES in JITTER source
rngd[689]: [jitter]: Enabling JITTER rng support
rngd[689]: [jitter]: Initialized
rngd[689]: [pkcs11]: No pkcs11 slots available
rngd[689]: [pkcs11]: Initialization Failed
nscd[688]: 688 monitoring file `/etc/resolv.conf` (5)
systemd[1]: Reached target Basic System.
dhcpcd[685]: Failed to set DNS configuration: Unit dbus-org.freedesktop.resolve1.service not found.
nscd[688]: 688 monitoring directory `/etc` (2)
systemd[1]: Starting Kernel Auditing...
nscd[688]: 688 monitoring file `/etc/services` (6)
systemd[1]: Starting CPU Frequency Setup...
nscd[688]: 688 monitoring directory `/etc` (2)
systemd[1]: Starting DHCP Client...
nscd[688]: 688 disabled inotify-based monitoring for file `/etc/netgroup': No such file or directory
systemd[1]: Starting Name Service Cache Daemon...
7k2j2sl0r491m7l08zfys1kv33knblij-unit-script-network-link-eth0-start[748]: Configuring link...
7k2j2sl0r491m7l08zfys1kv33knblij-unit-script-network-link-eth0-start[748]: bringing up interface... done
nscd[688]: 688 stat failed for file `/etc/netgroup'; will try again later: No such file or directory
systemd[1]: Starting resolvconf update...
s19cz5spvx0y6yaqbvm0arg6i4zi53ps-unit-script-network-link-wlan0-start[753]: Configuring link...
s19cz5spvx0y6yaqbvm0arg6i4zi53ps-unit-script-network-link-wlan0-start[753]: bringing up interface... done
dhcpcd[685]: dev: loaded udev
systemd[1]: Started Hardware RNG Entropy Gatherer Daemon.
dbus-daemon[691]: [system] Activating via systemd: service name='org.freedesktop.resolve1' unit='dbus-org.freedesktop.resolve1.service' requested by ':1.3' (uid=0 pid=729 comm="resolvconf -d eth0.link -f ")
systemd[1]: Started WPA Supplicant.
wpa_supplicant[690]: Successfully initialized wpa_supplicant
systemd[1]: Started D-Bus System Message Bus.
dbus-daemon[691]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.resolve1.service': Unit dbus-org.freedesktop.resolve1.service not found.
systemd[1]: Started Kernel Auditing.
dbus-daemon[691]: [system] Activating via systemd: service name='org.freedesktop.resolve1' unit='dbus-org.freedesktop.resolve1.service' requested by ':1.7' (uid=0 pid=755 comm="resolvconf -d wlan0.link -f ")
systemd[1]: Started CPU Frequency Setup.
dbus-daemon[691]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.resolve1.service': Unit dbus-org.freedesktop.resolve1.service not found.
systemd[1]: Started resolvconf update.
dhcpcd[685]: eth0: waiting for carrier
systemd[1]: Reached target Network (Pre).
dhcpcd[685]: wlan0: waiting for carrier
systemd[1]: Starting Address configuration of eth0...
dhcpcd[685]: wlan0: carrier acquired
systemd[1]: Starting Address configuration of wlan0...
wpa_supplicant[690]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=KR
systemd[1]: Starting Link configuration of eth0...
dhcpcd[685]: DUID xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
systemd[1]: Starting Link configuration of wlan0...
dhcpcd[685]: wlan0: IAID xxxxxxxxxx
systemd[1]: Started Address configuration of eth0.
dhcpcd[685]: wlan0: adding address xxxxxxxxxxxxxxxxxxxxxxxxxx
systemd[1]: Started Address configuration of wlan0.
dhcpcd[685]: wlan0: carrier lost
systemd[1]: Starting Networking Setup...
dbus-daemon[691]: [system] Activating via systemd: service name='org.freedesktop.resolve1' unit='dbus-org.freedesktop.resolve1.service' requested by ':1.8' (uid=0 pid=781 comm="resolvconf -d wlan0.link -f ")
systemd[1]: Started Name Service Cache Daemon.
dbus-daemon[691]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.resolve1.service': Unit dbus-org.freedesktop.resolve1.service not found.
systemd[1]: Reached target Host and Network Name Lookups.

Additional context
The machine is Raspberry Pi 3B. nixos-rebuild switch upgraded dhcpcd from 8.1.2 to 8.1.4 and linux kernel from 5.4.6 to 5.4.7.

Metadata

 - system: `"aarch64-linux"`
 - host os: `Linux 5.4.7, NixOS, 20.03pre207998.e0470e11c7a (Markhor)`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.1`
 - channels(root): `"nixos-20.03pre207998.e0470e11c7a"`
 - channels(esrevinu): `"nixpkgs-20.03pre207249.7e8454fb856"`
 - nixpkgs: `/home/esrevinu/.nix-defexpr/channels/nixpkgs`
@izuk
Copy link
Contributor

izuk commented Jan 6, 2020

I'm also seeing this.

@karolchmist
Copy link
Member

I have the same problem. In my case, I did a bit of bisecting of the nixpkgs repo, and it seems that it is caused by this commit: cdf79db. Previous commits that I checked, up to dad49d0 (so just one before cdf79db) seem to work fine. HEAD of nixos-unstable have still the same problem (2e8fc97).

Can you check if it is your case as well?

Pinging @infinisil, maybe he has some insight to it.

My /etc/resolv.conf is also almost empty on cdf79db19d6:

~ cat /etc/resolv.conf                                                                               ~
# Generated by resolvconf
options edns0

On dad49d0b5ec:

➜  ~ cat /etc/resolv.conf                                                                               ~
# Generated by resolvconf
domain home
nameserver 192.168.1.1
nameserver xxx
nameserver xxx
nameserver xxx
options edns0

Metadata:

nix-shell -p nix-info --run "nix-info -m"                                                          ~
 - system: `"x86_64-linux"`
 - host os: `Linux 5.4.3, NixOS, 20.03.git.cdf79db (Markhor)`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.1`
 - channels(karol): `""`
 - channels(root): `""`
 - nixpkgs: `/etc/nixos/nixpkgs`

@infinisil
Copy link
Member

Thanks for the ping, I'll take a look

@infinisil
Copy link
Member

@karolchmist Can you run diff on your system build from dad49d0 to cdf79db and show the result? You can find all previous system builds in /nix/var/nix/profiles/system-* so it should be something like

diff /nix/var/nix/profiles/system-100 /nix/var/nix/profiles/system-101

This will show exactly what ended up being different for that commit

@infinisil
Copy link
Member

Can reproduce, so I should be able to run this too

@infinisil
Copy link
Member

Found the culprit! While it does start failing since #75031, the actual mistake is not in that PR, it merely exposes it. In that PR I'm mentioning:

  • Made sure that this change doesn't introduce weird derivation changes (specifically the commit about submodule packing) -> It does, but nothing significant, only value ordering in lists for the same priority, which is arbitrary anyways

And that is indeed what happened for dhcpcd: the ordering of packages in services.dhcpcd.path (which was never fully specified) was changed such that the default systemd packages in

[ { # Default path for systemd services. Should be quite minimal.
path =
[ pkgs.coreutils
pkgs.findutils
pkgs.gnugrep
pkgs.gnused
systemd
];
newly come before the packages dhcpcd adds in
path = [ dhcpcd pkgs.nettools pkgs.openresolv ];

However for dhcpcd that's a problem, because both pkgs.systemd and pkgs.openresolv provide a resolvconf binary! So this means that dhcpcd will end up using the one from systemd instead of the one from openresolv, leading to this failure.

I'll submit a PR that fixes this by explicitly putting systemd's packages after others.

infinisil added a commit to infinisil/nixpkgs that referenced this issue Jan 6, 2020
This fixes the dhcpcd issue in NixOS#76969,
which was exposed by NixOS#75031
introducing changes in the module ordering and therefore option ordering
too.

The dhcpcd issue would also be fixable by explicitly putting
dhcpcd's paths before others, however it makes more sense for systemd's
default paths to be after all others by default, since they should only
be a fallback, which is how binary finding will work if they come after.
@infinisil
Copy link
Member

See above PR

dtzWill pushed a commit to dtzWill/nixpkgs that referenced this issue Jan 6, 2020
This fixes the dhcpcd issue in NixOS#76969,
which was exposed by NixOS#75031
introducing changes in the module ordering and therefore option ordering
too.

The dhcpcd issue would also be fixable by explicitly putting
dhcpcd's paths before others, however it makes more sense for systemd's
default paths to be after all others by default, since they should only
be a fallback, which is how binary finding will work if they come after.

(cherry picked from commit 9327e1c)
@demokritos
Copy link
Author

I confirm that 9327e1c fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants