Long hostname causes networking setup to fail
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| systemd |
Fix Released
|
Unknown
|
||
| systemd (Ubuntu) |
Medium
|
Unassigned | ||
| Xenial |
Medium
|
Dan Streetman | ||
| Bionic |
Medium
|
Dan Streetman |
Bug Description
[impact]
networkd fails to bring up networking on systems with long hostname
[test case]
setting the hostname:
$ sudo hostnamectl set-hostname asdfasdfasdfasd
then reboot and check the networking.
[regression potential]
as this adjusts logging and certain error handling while performing dhcp, any regression would likely cause dhcp failure.
[scope]
this is fixed by upstream commit a8494759b4f14af
This is needed in Bionic and Xenial.
[other info]
the problem around this is that Linux sets HOST_NAME_MAX to 64, but RFC 1035 limits DNS labels to 63 characters, so any host with a max-length single-label hostname (i.e. a 64 character hostname with no dots) will be "valid" from Linux's perspective, but will violate RFC 1035 and thus systemd will consider it invalid and won't pass it to the dhcp server.
Also note that a 64-character hostname that is *not* single-label (i.e. a hostname with at least 1 dot) will not cause this problem.
The systemd patches continue to reject sending the invalid hostname to the dhcp server, but do not prevent networkd from finishing setting up networking.
[original description]
1) ubuntu version
# lsb_release -rd
Description: Ubuntu 18.04.3 LTS
Release: 18.04
2) package version
# apt-cache policy systemd
systemd:
Installed: 237-3ubuntu10.31
Candidate: 237-3ubuntu10.31
Version table:
*** 237-3ubuntu10.31 500
500 http://
es
100 /var/lib/
237-
500 http://
237-3ubuntu10 500
500 http://
3) I expect the network to come online correctly regardless of how long the hostname is. This is what happens with both 14.0 and 19.0 (I tested the same behavior with both of them).
4) the external network interface fails to be configured and is stuck in a (pending) state as reported by networkctl status -a
setting the hostname:
# hostnamectl set-hostname asdfasdfasdfasd
after rebooting the machine, it no longer has network access.
# journalctl
Feb 06 19:29:41 asdfasdfasdfasd
Feb 06 19:29:41 asdfasdfasdfasd
Feb 06 19:29:41 asdfasdfasdfasd
Feb 06 19:29:41 asdfasdfasdfasd
Feb 06 19:29:41 asdfasdfasdfasd
# networkctl status -a:
● 1: lo
Link File: /lib/systemd/
Network File: n/a
Type: loopback
State: carrier (unmanaged)
Address: 127.0.0.1
● 2: eth0
Link File: /run/systemd/
Network File: /run/systemd/
Type: ether
State: off (pending)
Path: pci-0000:00:03.0
Driver: virtio_net
Vendor: Red Hat, Inc.
Model: Virtio network device
HW Address: ae:4d:91:1c:e8:86
DNS: 67.207.67.3
and to bring up the network correctly, set the hostname to something shorter
# hostnamectl set-hostname asdf
# systemctl restart systemd-networkd
# networkctl status -a
● 1: lo
Link File: /lib/systemd/
Network File: n/a
Type: loopback
State: carrier (unmanaged)
Address: 127.0.0.1
● 2: eth0
Link File: /run/systemd/
Network File: /run/systemd/
Type: ether
State: routable (configured)
Path: pci-0000:00:03.0
Driver: virtio_net
Vendor: Red Hat, Inc.
Model: Virtio network device
HW Address: ae:4d:91:1c:e8:86
Address: 10.17.0.5
Gateway: 157.245.208.1 (ICANN, IANA Department)
DNS: 67.207.67.3
Changed in systemd (Ubuntu Bionic): | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in systemd (Ubuntu): | |
importance: | Undecided → Medium |
description: | updated |
Changed in systemd: | |
status: | Unknown → Fix Released |
description: | updated |
Changed in systemd (Ubuntu Bionic): | |
assignee: | nobody → Dan Streetman (ddstreet) |
Changed in systemd (Ubuntu Xenial): | |
assignee: | nobody → Dan Streetman (ddstreet) |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in systemd (Ubuntu Bionic): | |
status: | Confirmed → In Progress |
description: | updated |
description: | updated |
Changed in systemd (Ubuntu): | |
status: | Confirmed → Fix Released |
Hello Daniel, or anyone else affected,
Accepted systemd into bionic-proposed. The package will build now and be available at https:/
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-
Further information regarding the verification process can be found at https:/
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.
Changed in systemd (Ubuntu Bionic): | |
status: | In Progress → Fix Committed |
tags: | added: verification-needed verification-needed-bionic |
All autopkgtests for the newly accepted systemd (237-3ubuntu10.40) for bionic have finished running.
The following regressions have been reported in tests triggered by the package:
gvfs/1.
prometheus-
systemd/
umockdev/0.11.1-1 (armhf)
linux-hwe-
kde4libs/
util-linux/unknown (armhf)
nftables/unknown (armhf)
linux-raspi2-
netplan.
openssh/
Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUp
https:/
[1] https:/
Thank you!
Hello Daniel, or anyone else affected,
Accepted systemd into xenial-proposed. The package will build now and be available at https:/
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-
Further information regarding the verification process can be found at https:/
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.
Changed in systemd (Ubuntu Xenial): | |
status: | In Progress → Fix Committed |
tags: | added: verification-needed-xenial |
All autopkgtests for the newly accepted systemd (229-4ubuntu21.28) for xenial have finished running.
The following regressions have been reported in tests triggered by the package:
udisks2/
multipath-
nplan/0.32~16.04.7 (amd64)
Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUp
https:/
[1] https:/
Thank you!
Daniel (dan353hehe) wrote : | #6 |
I went and updated a machine with the issue to use the -updated packages, and after installing all of them, I no longer see the issue where the long hostname causes the networking setup to fail. The hostname is now truncated at 64 characters.
This is on bionic:
root@asdfasdfas
Description: Ubuntu 18.04.4 LTS
Release: 18.04
root@asdfasdfas
systemd:
Installed: 237-3ubuntu10.40
Candidate: 237-3ubuntu10.40
Version table:
*** 237-3ubuntu10.40 500
500 http://
100 /var/lib/
237-
500 http://
237-
500 http://
237-3ubuntu10 500
500 http://
tags: |
added: verification-done-bionic removed: verification-needed-bionic |
Dan Streetman (ddstreet) wrote : | #7 |
on xenial, additional fix is needed for bug 1877176 for complete fix for this bug, but this patch introduces no regressions and allows networkd to continue requesting the lease for invalid hostnames.
tags: |
added: verification-done verification-done-xenial removed: verification-needed verification-needed-xenial |
Launchpad Janitor (janitor) wrote : | #8 |
This bug was fixed in the package systemd - 237-3ubuntu10.40
---------------
systemd (237-3ubuntu10.40) bionic; urgency=medium
* d/t/logind: skip if nonexistent /sys/power/state (LP: #1862657)
* d/p/lp1839290-
- when restarting service after failure, replace existing queued jobs
(LP: #1839290)
* d/p/lp1867421-
- fix resolution of IntelliMouse (LP: #1867421)
* d/p/lp1858412-
- allow vacuuming journal 'root' dir (LP: #1858412)
* d/p/lp1862232/
d/p/
d/p/
d/p/
d/p/
d/p/
d/p/
- do not fail network setup if hostname is not valid (LP: #1862232)
* d/t/systemd-fsckd: Skip test on arm64 (LP: #1870194)
* d/p/lp1870589-
- fix test-seccomp failure (LP: #1870589)
* d/rules: use meson --print-errorlogs instead of cat testlog
- (LP: #1870811)
* d/p/lp1776654-
- sync journal before reading from it (LP: #1776654)
* d/p/lp1837914-
- do not crash if NULL passted to journal destructor (LP: #1837914)
* d/e/initramfs-
- Follow symlinks when finding link files to copy into initramfs
(LP: #1868892)
-- Dan Streetman <email address hidden> Mon, 20 Apr 2020 10:12:49 -0400
Changed in systemd (Ubuntu Bionic): | |
status: | Fix Committed → Fix Released |
The verification of the Stable Release Update for systemd has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.
Launchpad Janitor (janitor) wrote : | #10 |
This bug was fixed in the package systemd - 229-4ubuntu21.28
---------------
systemd (229-4ubuntu21.28) xenial; urgency=medium
* d/t/logind: skip if nonexistent /sys/power/state (LP: #1862657)
* d/p/lp1839290-
- when restarting service after failure, replace existing queued jobs
(LP: #1839290)
* d/t/storage:
- fix buggy test (LP: #1831459)
- without scsi_debug, skip test (LP: #1847816)
* d/p/lp1867421-
- fix resolution of IntelliMouse (LP: #1867421)
* d/p/lp1858412-
- allow vacuuming journal 'root' dir (LP: #1858412)
* d/p/lp1862232-
- do not let invalid hostname break dhcpv4 (LP: #1862232)
* d/t/systemd-fsckd: Skip test on arm64 (LP: #1870194)
* d/p/lp1837914-
- do not crash if NULL passted to journal destructor (LP: #1837914)
* d/e/initramfs-
- Follow symlinks when finding link files to copy into initramfs
(LP: #1868892)
-- Dan Streetman <email address hidden> Mon, 20 Apr 2020 10:17:40 -0400
Changed in systemd (Ubuntu Xenial): | |
status: | Fix Committed → Fix Released |
Status changed to 'Confirmed' because the bug affects multiple users.