Page MenuHomeVyOS Platform

ddclient tries to bind to Ethernet VIFs before they're configured on boot
Closed, InvalidPublicBUG

Description

When rebooting a VyOS install with ddclient configured to monitor Ethernet VIF interfaces, ddclient tries to bind to the VIFs before they exist. This causes most of the boot config to fall to apply, including all network interfaces.

The startup of the ddclient process should be made dependent on the creation of all interfaces on boot.

Details

Difficulty level
Unknown (require assessment)
Version
1.4.0-rc1
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

@MattK provide a simple example of "set" commands to reproduce

Hi @Viacheslav,

I haven't had the chance to test this, but the following should be sufficient to replicate the behaviour:

set interfaces ethernet eth0 vif 101 address 'dhcp'
set service dns dynamic name ddns address 'eth0.101'
set service dns dynamic name ddns host-name 'example.duckdns.org'
set service dns dynamic name ddns ip-version 'both'
set service dns dynamic name ddns password <REDACTED>
set service dns dynamic name ddns protocol 'duckdns'

I've done more investigation of this issue today, and I believe I understand the cause.

On boot, the configuration is attempted to be applied by the service_dns_dynamic.py script, which uses the verify_interface_exists function from vyos.configverify to verify if the interface to be bound exists: https://github.com/vyos/vyos-1x/blob/current/src/conf_mode/service_dns_dynamic.py#L101

The issue seems to be that this function throws a ConfigError exception if the interface doesn't exist, which I believe causes the boot time configuration load to be aborted before it has finished, leaving the router in a broken state: https://github.com/vyos/vyos-1x/blob/current/python/vyos/configverify.py#L279

I believe that the best method of dealing with this issue would be to make service_dns_dynamic dependent upon the interfaces ethernet configuration, by adding it as a dependency to data/config-mode-dependencies/vyos-1x.json. I'm opening a PR on Github for this.

Viacheslav changed the task status from Open to In progress.Jan 17 2024, 9:52 AM
Viacheslav assigned this task to MattK.

I can not reproduce it with the above commands. Even not getting any IP address on the DHCP interface lets ddclient start

[email protected]:~$ show log dns dynamic
Jan 18 07:41:41 systemd[1]: Starting ddclient.service - Update dynamic domain name service entries...
Jan 18 07:41:41 systemd[1]: Started ddclient.service - Update dynamic domain name service entries.
Jan 18 07:41:41 ddclient[2660]: WARNING:  Could not determine an IP for example.duckdns.org

Can you boot using vyos-config-boot kernel parameter and then show us the logfile from /tmp?

I've traced the issue back to a USB device that creates an Ethernet interface on the OS. I suspect that the issue was caused by the USB device not being ready by the time ddclient tried to start and bind to configured interfaces, causing the boot time configuration to fail. Given that this is an edge case that would rarely occur, and now that I have replaced the USB device with an actual Ethernet device, I'm happy to close this bug report.