Page MenuHomeVyOS Platform

Empty ntp CLI node causes config migration error when upgrading from 1.3 series
Closed, ResolvedPublicBUG

Description

This started happening in 1.4 and persists through at least VyOS 1.5-rolling-202411070006.

Smallest reproduce case:

[email protected]# delete service ntp
[edit]
[email protected]# commit
[edit]
[email protected]# set service ntp server 1.2.3.4 
[edit]
[email protected]# commit
[edit]
[email protected]# delete service ntp server 1.2.3.4
[edit]
[email protected]# commit

NTP server not configured

[[service ntp]] failed
Commit failed
[edit]

Under 1.3 and before, removing the last configuration element resulted in the entire configuration being removed, as expected and no error.

Details

Version
1.4.0
Is it a breaking change?
Behavior change
Issue type
Bug (incorrect behavior)

Event Timeline

I’d expect the behavior is correct now. There shouldn't be empty nodes. As some of them uses “default values” and system can see it as partly configured,
In any case the check is here https://github.com/vyos/vyos-1x/blob/ec18cc393591052fd1f021c4a62220ab2e537a2e/src/conf_mode/service_ntp.py#L68

And you’ll get the same behavior for every config.

With T3008 we moved from ntpd to chrony. This came with a restructuring of the CLI (mainly moving ntp out of system to services).

In addition the definition of a server was made mandatory.

The bug itself manifests at a more crucial point - config migration

Jan 23 20:51:18 LR3.wue3 vyos-router[1265]: Migration script error: /opt/vyatta/etc/config-migrate/migrate/ntp/1-to-2: [Errno 1] failed to run command: ['/opt/vyatta/etc/config-migrate/migrate/ntp/1-to-2', '/opt/vyatta/etc/config/config.boot']
Jan 23 20:51:18 LR3.wue3 vyos-router[1265]: returned: - op: copy old_path: ['system', 'ntp'] new_path: ['service', 'ntp']
Jan 23 20:51:18 LR3.wue3 vyos-router[1265]: - op: delete path: ['system', 'ntp']

A valid configuration for VyOS 1.3 is:

system {
  ntp {
  }
}

But VyOS 1.4 does not allow something like:

service {
  ntp {
  }
}

hence the configuration needs to be properly migrated "away" to not have an empty service ntp node

c-po renamed this task from VyOS fails to commit if all elements of NTP service configuration are deleted to Empty ntp CLI node causes config migration error when upgrading from 1.3 series.Fri, Jan 24, 6:32 AM
c-po moved this task from Need Triage to Completed on the VyOS Rolling board.
c-po moved this task from Open to Finished on the VyOS 1.5 Circinus board.
c-po moved this task from Backlog to Finished on the VyOS 1.4 Sagitta (1.4.2) board.