void-linux / void-packages

The Void source packages collection
https://voidlinux.org
Other
2.52k stars 2.12k forks source link

dracut-[network,crypt-ssh] #13304

Closed teldra closed 5 years ago

teldra commented 5 years ago

System

Expected behavior

Get an IP Address via DHCP at boot to unlock luks.

Actual behavior

Suddenly dracut complains "Duplicated address detected" even if there is no duplicated address and try to get a new one forever. Boot impossible, without deleting rd.neednet=1 ip=dhcp (https://wiki.voidlinux.org/Install_LVM_LUKS#Setup) Same complain with static IP.

Steps to reproduce the behavior

https://wiki.voidlinux.org/Install_LVM_LUKS#Setup

tetsumaki commented 5 years ago

Hello, same problem here. The problem come with the package iputils-20190709_1 (major update). Screenshot with ping command before (left) and after update (right) : https://framapic.org/7r52Rfkn2Yiw/AODbp6xEo81n.png

I dont now why, but i reproduce after multiple try in vm, i reproduce after that :

# xbps-install -Su iputils
[*] Updating `https://alpha.de.repo.voidlinux.org/current/x86_64-repodata' ...

Name           Action    Version           New version            Download size
base-voidstrap update    0.9_2             0.9_3                  868B
iputils        update    20180629_2        20190709_1             64KB

Size to download:               66KB
Size required on disk:         123KB
Space available on disk:        18GB

Do you want to continue? [Y/n] y

[*] Downloading packages
base-voidstrap-0.9_3.x86_64.xbps: 868B [avg rate: 14MB/s]
base-voidstrap-0.9_3.x86_64.xbps.sig: 512B [avg rate: 4310KB/s]
iputils-20190709_1.x86_64.xbps: 64KB [avg rate: 937MB/s]
iputils-20190709_1.x86_64.xbps.sig: 512B [avg rate: 8929KB/s]

[*] Verifying package integrity
base-voidstrap-0.9_3: verifying RSA signature...
iputils-20190709_1: verifying RSA signature...

[*] Collecting package files
base-voidstrap-0.9_3: collecting files...
iputils-20190709_1: collecting files...
iputils-20180629_2: collecting files...

[*] Unpacking packages
base-voidstrap-0.9_2: updating to 0.9_3 ...
base-voidstrap-0.9_3: unpacking ...
iputils-20180629_2: updating to 20190709_1 ...
Removing 'ping' alternatives group symlink: ping
Removing 'ping' alternatives group symlink: ping.8
Removing 'ping6' alternatives group symlink: ping6
Removing 'ping6' alternatives group symlink: ping6.8
iputils-20190709_1: unpacking ...
Creating 'ping' alternatives group symlink: ping -> /usr/bin/iputils-ping
Creating 'ping' alternatives group symlink: ping.8 -> /usr/share/man/man8/iputils-ping.8
Creating 'ping6' alternatives group symlink: ping6 -> /usr/bin/iputils-ping
Creating 'ping6' alternatives group symlink: ping6.8 -> /usr/share/man/man8/iputils-ping.8

[*] Configuring unpacked packages
base-voidstrap-0.9_3: configuring ...
base-voidstrap-0.9_3: updated successfully.
iputils-20190709_1: configuring ...
iputils-20190709_1: post-install message:
========================================================================
Since iputils-20161105,
ping and ping6 as well as tracepath and tracepath6 have been unified.
Use ping -4 or tracepath -4 to force ICMPv4.
========================================================================
iputils-20190709_1: updated successfully.

2 downloaded, 0 installed, 2 updated, 0 configured, 0 removed.
tetsumaki commented 5 years ago

Install old version of iputils solve the problem immediatly :

# xbps-install -Sf iputils-20180629_3
[*] Updating `https://alpha.de.repo.voidlinux.org/current/x86_64-repodata' ...
Unable to locate 'iputils-20180629_3' in repository pool.
-bash-5.0# xbps-rindex -a /tmp/*.x*
index: added `iputils-20180629_3' (x86_64).
index: 1 packages registered.
-bash-5.0# xbps-install -Sf iputils-20180629_3
[*] Updating `https://alpha.de.repo.voidlinux.org/current/x86_64-repodata' ...

Name    Action    Version           New version            Download size
iputils downgrade 20190709_1        20180629_3             -

Size required on disk:         181KB
Space available on disk:        18GB

Do you want to continue? [Y/n] y

[*] Downloading packages

[*] Verifying package integrity
iputils-20180629_3: verifying SHA256 hash...

[*] Collecting package files
iputils-20180629_3: collecting files...
iputils-20190709_1: collecting files...

[*] Unpacking packages
iputils-20180629_3: unpacking ...
Creating 'ping' alternatives group symlink: ping -> /usr/bin/iputils-ping
Creating 'ping' alternatives group symlink: ping.8 -> /usr/share/man/man8/iputils-ping.8
Creating 'ping6' alternatives group symlink: ping6 -> /usr/bin/iputils-ping
Creating 'ping6' alternatives group symlink: ping6.8 -> /usr/share/man/man8/iputils-ping.8

[*] Configuring unpacked packages
iputils-20180629_3: configuring ...
iputils-20180629_3: post-install message:
========================================================================
Since iputils-20161105,
ping and ping6 as well as tracepath and tracepath6 have been unified.
Use ping -4 or tracepath -4 to force ICMPv4.
========================================================================
iputils-20180629_3: installed successfully.

0 downloaded, 1 installed, 0 updated, 1 configured, 0 removed.

And rebuild kernel :

# xbps-reconfigure -f linux4.19
linux4.19: configuring ...
Executing post-install kernel hook: 20-dracut ...
Executing post-install kernel hook: 50-grub ...
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.19.25_1
Found initrd image: /boot/initramfs-4.19.25_1.img

Reboot, and problem is solved.

tetsumaki commented 5 years ago

I think, the problem is in /usr/lib/dracut/modules.d, probably 40network and usage of ip command. With the new version of iputils -> problem.

tetsumaki commented 5 years ago

I think the best solution for now is downgrade package in official repository no ? dracut is not ready for new iputils.

teldra commented 5 years ago

For me, it seems to stop around here: https://github.com/dracutdevs/dracut/blob/23acf15227557ea1701bf853b3aa402a9ecba0a3/modules.d/35network-legacy/dhclient-script.sh#L184 or here: https://github.com/dracutdevs/dracut/blob/23acf15227557ea1701bf853b3aa402a9ecba0a3/modules.d/35network-legacy/ifup.sh#L136 (in each if statements). Maybe this issue schould be reported upstream?

tetsumaki commented 5 years ago

Curious return code with arping and iputils_20190709_1 no ?

In screenshot, left is not ok and right is ok : https://framapic.org/sSNjldqjR3is/l2cXAj5vGJHm.png

And the code in /usr/lib/dracut/modules.d/40network/ifup.sh :

if ! arping -f -q -D -c 2 -I $netif $ip ; then
    warn "Duplicate address detected for $ip for interface $netif."
    return 1
fi
teldra commented 5 years ago

For me, arping only works, if I remove -D. With -D:

└[~]> arping -f -D -c 2 -I wlp2s0 10.1.1.2; echo $?
ARPING 10.1.1.2 from 0.0.0.0 wlp2s0
Unicast reply from 10.1.1.2 [MACADDRESS]  3.960ms
Sent 1 probes (1 broadcast(s))
Received 1 response(s)
1

└[~]> arping -f -D -c 2 -I wlp2s0 10.1.1.77; echo $?
ARPING 10.1.1.77 from 0.0.0.0 wlp2s0
Sent 2 probes (2 broadcast(s))
Received 0 response(s)
1

Without -D:

└[~]> arping -f -c 2 -I wlp2s0 10.1.1.2; echo $? 
ARPING 10.1.1.2 from 10.1.1.5 wlp2s0
Unicast reply from 10.1.1.2 [MACADDRESS]  3.934ms
Sent 1 probes (1 broadcast(s))
Received 1 response(s)
0

└[~]> arping -f -c 2 -I wlp2s0 10.1.1.77; echo $? 
ARPING 10.1.1.77 from 10.1.1.5 wlp2s0
Sent 2 probes (2 broadcast(s))
Received 0 response(s)
1

From man arping:

-D
  Duplicate address detection mode (DAD). See RFC2131, 4.4.1. Returns
  0, if DAD succeeded i.e. no replies are received.

Is it necessary?

teldra commented 5 years ago

Update to 049 only works with NetworkManager, as it seems. Removing -D only works from running OS, not at boottime.

teldra commented 5 years ago

Seems to be an error in arping: Wrong exitcode when using -D. Reported it upstream. When using NetworkManager, arping is not used (in version 049) afaik.

teldra commented 5 years ago

Fixed with this: https://github.com/void-linux/void-packages/pull/13446

tetsumaki commented 5 years ago

Very nice.