Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bullseye: systemd-networkd-wait-online timeouts

743 views
Skip to first unread message

Jochen Spieker

unread,
Aug 18, 2021, 4:00:05 PM8/18/21
to
Hi,

I upgraded my virtual server to bullseye already and I found one issue
in the logs:

Aug 18 10:59:20 h2907737 systemd-networkd-wait-online[936688]: Event loop failed: Connection timed out
Aug 18 10:59:20 h2907737 apt-helper[936686]: E: Sub-process /lib/systemd/systemd-networkd-wait-online returned an error code (1)

For some reason systemd does not (fully?) recognize that the system is
online. The network is still configured using ifupdown with this
interfaces(5) file. I know it looks weird, but I have no control over it
on this system. The file is provided by my hosting provider:


| # This configuration file is auto-generated.
| # WARNING: Do not edit this file, otherwise your changes will be lost.
| # Please edit template /etc/network/interfaces.template instead.
|
| auto lo
| iface lo inet loopback
|
| # Auto generated venet0 interfaces
| auto venet0
| iface venet0 inet static
| address 127.0.0.1
| netmask 255.255.255.255
| broadcast 0.0.0.0
| up route add default dev venet0
| auto venet0:0
| iface venet0:0 inet static
| address 85.x.y.z
| netmask 255.255.255.255
|
|
| iface venet0 inet6 static
| address 2a01:dead:beef:dead:beef:dead:beef:dead/128
| up ip -6 r a default dev venet0


Systemd thinks the devices (even lo) are in state "pending":

# networkctl status -a
● 1: lo
Link File: n/a
Network File: n/a
Type: loopback
State: carrier (pending)
HW Address: 00:00:00:00:00:00
MTU: 65536
QDisc: noqueue
IPv6 Address Generation Mode: eui64
Queue Length (Tx/Rx): 1/1
Address: 127.0.0.1
::1

● 2: venet0
Link File: n/a
Network File: n/a
Type: void
State: routable (pending)
MTU: 1500
QDisc: noqueue
IPv6 Address Generation Mode: eui64
Queue Length (Tx/Rx): 1/1
Auto negotiation: no
Speed: 10Gbps
Duplex: full
Port: tp
Address: 85.x.y.z
127.0.0.1
2a01:dead:beef:dead:beef:dead:beef:dead


Is there anything I can do about this without changing
/etc/network/interfaces? As far as I understand, I cannot switch to
systemd network configuration as long as the interfaces file exists.

Regards,
Jochen
--
If nightclub doormen recognised me I would be more fulfilled.
[Agree] [Disagree]
<http://archive.slowlydownward.com/NODATA/data_enter2.html>
signature.asc

Charles Curley

unread,
Aug 18, 2021, 5:40:05 PM8/18/21
to
On Wed, 18 Aug 2021 21:36:30 +0200
Jochen Spieker <m...@well-adjusted.de> wrote:

> Is there anything I can do about this without changing
> /etc/network/interfaces? As far as I understand, I cannot switch to
> systemd network configuration as long as the interfaces file exists.

Can you get anywhere by editing the template?

Also, this interfaces file assigns address 127.0.0.1 to the interface
venet0. Since that block (127.0.0.0/8, I believe) is reserved for the
loopback device (interface lo), and is assigned automatically to lo,
this setup is assigning 127.0.0.1 to both lo and venet:0. And that
strikes me as a recipe for problems.

--
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/

Jochen Spieker

unread,
Aug 19, 2021, 6:00:05 AM8/19/21
to
Charles Curley:
> On Wed, 18 Aug 2021 21:36:30 +0200
> Jochen Spieker <m...@well-adjusted.de> wrote:
>
>> Is there anything I can do about this without changing
>> /etc/network/interfaces? As far as I understand, I cannot switch to
>> systemd network configuration as long as the interfaces file exists.
>
> Can you get anywhere by editing the template?

I do not have access to the template. It does not exist on my VM and I
assume it only exists in the hosting provider's infrastructure.

> Also, this interfaces file assigns address 127.0.0.1 to the interface
> venet0. Since that block (127.0.0.0/8, I believe) is reserved for the
> loopback device (interface lo), and is assigned automatically to lo,
> this setup is assigning 127.0.0.1 to both lo and venet:0. And that
> strikes me as a recipe for problems.

I totally agree and I have no idea why they are doing it this way. I
still would like to know why systemd does not recognize that the
interface configuration using ifupdown was successful and the the system
actually is online.

J.
--
Tony Blair is a hypnotised self-seeking scarecrow just like all the
rest.
[Agree] [Disagree]
<http://archive.slowlydownward.com/NODATA/data_enter2.html>
signature.asc

Andy Smith

unread,
Aug 19, 2021, 4:10:04 PM8/19/21
to
Hi Jochen,

On Wed, Aug 18, 2021 at 09:36:30PM +0200, Jochen Spieker wrote:
> Aug 18 10:59:20 h2907737 systemd-networkd-wait-online[936688]: Event loop failed: Connection timed out
> Aug 18 10:59:20 h2907737 apt-helper[936686]: E: Sub-process /lib/systemd/systemd-networkd-wait-online returned an error code (1)
>
> For some reason systemd does not (fully?) recognize that the system is
> online.

I don't know yet about bullseye but in buster systemd does assume
that you are online when using ifupdown unless you enable the
"ifupdown-wait-online" service, which actually waits for every
interface marked auto be be ready before allowing "network-online"
target to be reached.

Is that service enabled? If you disable it, what happens? I expect
systemd to assume it is online.

Also are you absolutely sure that you aren't using systemd-networkd
and/or NetworkManager and there isn't any .link files for systemd
anywhere, that it's purely ifupdown?

May be worth asking your hosting provider as well because uf they
are mandating how your /etc/network/interfaces looks (and its use)
then they need to know how to make it play nice with systemd in
Debian 11.

Cheers,
Andy

--
https://bitfolk.com/ -- No-nonsense VPS hosting

Jochen Spieker

unread,
Aug 20, 2021, 6:00:06 PM8/20/21
to
Andy Smith:
> On Wed, Aug 18, 2021 at 09:36:30PM +0200, Jochen Spieker wrote:
>
>> Aug 18 10:59:20 h2907737 systemd-networkd-wait-online[936688]: Event loop failed: Connection timed out
>> Aug 18 10:59:20 h2907737 apt-helper[936686]: E: Sub-process /lib/systemd/systemd-networkd-wait-online returned an error code (1)
>>
>> For some reason systemd does not (fully?) recognize that the system is
>> online.
>
> I don't know yet about bullseye but in buster systemd does assume
> that you are online when using ifupdown unless you enable the
> "ifupdown-wait-online" service, which actually waits for every
> interface marked auto be be ready before allowing "network-online"
> target to be reached.
>
> Is that service enabled? If you disable it, what happens? I expect
> systemd to assume it is online.

Sounds like a good idea! But:

# systemctl status ifupdown-wait-online.service
● ifupdown-wait-online.service - Wait for network to be configured by ifupdown
Loaded: loaded (/lib/systemd/system/ifupdown-wait-online.service; enabled; vendor preset: enabled)
Active: active (exited) since Sun 2021-08-15 00:16:58 CEST; 5 days ago
Main PID: 79 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 105)
Memory: 0B
CGroup: /system.slice/ifupdown-wait-online.service

Aug 15 00:16:58 xxxxxxxx.stratoserver.net systemd[1]: Finished Wait for network to be configured by ifupdown.
Warning: journal has been rotated since unit was started, output may be incomplete.

# systemctl disable --now ifupdown-wait-online.service
Removed /etc/systemd/system/network-online.target.wants/ifupdown-wait-online.service.

# /lib/systemd/systemd-networkd-wait-online --timeout=2 --any
Event loop failed: Connection timed out


> Also are you absolutely sure that you aren't using systemd-networkd
> and/or NetworkManager and there isn't any .link files for systemd
> anywhere, that it's purely ifupdown?

The package network-manager is not installed, /etc/systemd/network is
empty and /etc/systemd/networkd.conf only contains comments, so I think
I am sure.

> May be worth asking your hosting provider as well because uf they
> are mandating how your /etc/network/interfaces looks (and its use)
> then they need to know how to make it play nice with systemd in
> Debian 11.

That is probable the right approach. Thanks for your suggestions!

J.
--
No-one appears to be able to help me.
[Agree] [Disagree]
<http://archive.slowlydownward.com/NODATA/data_enter2.html>

signature.asc

Jochen Spieker

unread,
Aug 25, 2021, 2:30:05 AM8/25/21
to
Jochen Spieker:
>
> Aug 18 10:59:20 h2907737 systemd-networkd-wait-online[936688]: Event loop failed: Connection timed out
> Aug 18 10:59:20 h2907737 apt-helper[936686]: E: Sub-process /lib/systemd/systemd-networkd-wait-online returned an error code (1)

I was able to at least work around this problem by editing the file
/etc/apt/apt.conf.d/50unattended-upgrades:

| // Download and install upgrades only on non-metered connection
| // (i.e. skip or gracefully stop updates on a metered connection)
| Unattended-Upgrade::Skip-Updates-On-Metered-Connections "false";

This way I still get the errors in the logs, but apt continues fetching
updates as intended. Since this is a VPS there is no risk that the
system will suddenly start using a metered connection.

J.
--
If I was Mark Chapman I would have shot John Lennon with a water pistol.
[Agree] [Disagree]
<http://archive.slowlydownward.com/NODATA/data_enter2.html>
signature.asc
0 new messages