Page MenuHomeVyOS Platform

ipoe: error in migration script logic while renaming mac-address to mac
Closed, ResolvedPublicBUG

Description

Migration from 1.3.1 to 1.4 does not start from 0-to-1 migration script

Steps to reproduce.
VyOS version: VyOS 1.4.0-epa2
I take the config file https://github.com/vyos/vyos-1x/blob/current/smoketest/configs/ipoe-server
Copy it to /config/config.boot
reboot the system:
Config after reboot:

set interfaces ethernet eth0 address 'dhcp'
set interfaces ethernet eth0 hw-id '0c:9c:2e:6f:00:00'
set interfaces ethernet eth0 offload gro
set interfaces ethernet eth1 address '192.168.0.1/24'
set interfaces ethernet eth1 hw-id '0c:9c:2e:6f:00:01'
set interfaces ethernet eth1 offload gro
set interfaces ethernet eth2 hw-id '0c:9c:2e:6f:00:02'
set interfaces ethernet eth2 offload gro
set interfaces ethernet eth3 hw-id '0c:9c:2e:6f:00:03'
set interfaces loopback lo
set nat source rule 100 outbound-interface name 'eth0'
set nat source rule 100 source address '192.168.0.0/24'
set nat source rule 100 translation address 'masquerade'
set service ipoe-server authentication mode 'local'
set service ipoe-server client-ip-pool POOL1 range '192.0.2.0/24'
set service ipoe-server client-ipv6-pool ipv6-pool delegate 2001:db8:1::/48 delegation-prefix '56'
set service ipoe-server client-ipv6-pool ipv6-pool prefix 2001:db8::/48 mask '64'
set service ipoe-server default-ipv6-pool 'ipv6-pool'
set service ipoe-server default-pool 'POOL1'
set service ipoe-server gateway-address '192.0.2.1/24'
set service ipoe-server interface eth1 client-subnet '192.168.0.0/24'
set service ipoe-server interface eth1 network 'vlan'
set service ipoe-server interface eth2 client-subnet '192.168.1.0/24'
set service ipoe-server name-server '10.10.1.1'
set service ipoe-server name-server '10.10.1.2'
set service ipoe-server name-server '2001:db8:aaa::'
set service ipoe-server name-server '2001:db8:bbb::'
set service ntp allow-client address '0.0.0.0/0'
set service ntp allow-client address '::/0'
set service ntp server 0.pool.ntp.org
set service ntp server 1.pool.ntp.org
set service ntp server 2.pool.ntp.org
set service ssh
set system config-management commit-revisions '100'
set system conntrack modules ftp
set system conntrack modules h323
set system conntrack modules nfs
set system conntrack modules pptp
set system conntrack modules sip
set system conntrack modules sqlnet
set system conntrack modules tftp
set system console device ttyS0 speed '115200'
set system host-name 'vyos'
CV9lxMnZPMbcxlU7.FI793MImNHznxGoMFgm3Q6QP3vfKJyOSRCt3Ka/GzFQyW1yZS4NS616NLHaIPPFHc0'
set system login user vyos authentication plaintext-password ''
set system syslog global facility all level 'info'
set system syslog global facility local7 level 'debug'

The part of /config/config.boot after reboot which does not load. ('service ipoe-server authentication')

ipoe-server {
    authentication {
        interface eth1 {
            mac-address 08:00:27:2f:d8:06 {
                rate-limit {
                    download "1000"
                    upload "500"
                }
                vlan-id "100"
            }
        }
        interface eth2 {
            mac-address 08:00:27:2f:d8:06 {
            }
        }
    }
}

As we can see lines with 'mac-address' do not migrate to 'mac'
a part of /config/vyos-migrate.log

/opt/vyatta/etc/config-migrate/migrate/ipoe-server/1-to-2
- op: set path: ['service', 'ipoe-server', 'client-ip-pool', 'POOL1', 'range'] value: 192.0.2.0/24 replace: False
- op: set path: ['service', 'ipoe-server', 'gateway-address'] value: 192.0.2.1/24 replace: False
- op: delete path: ['service', 'ipoe-server', 'client-ip-pool', 'name']
- op: set path: ['service', 'ipoe-server', 'default-pool'] value: POOL1 replace: True
/opt/vyatta/etc/config-migrate/migrate/ipoe-server/2-to-3
- op: copy old_path: ['service', 'ipoe-server', 'client-ipv6-pool'] new_path: ['service', 'ipoe-server', 'client-ipv6-pool', 'ipv6-pool']
- op: delete path: ['service', 'ipoe-server', 'client-ipv6-pool', 'prefix']
- op: set path: ['service', 'ipoe-server', 'default-ipv6-pool'] value: ipv6-pool replace: True
- op: delete path: ['service', 'ipoe-server', 'client-ipv6-pool', 'delegate']

There is no script 0-to-1 execution in the log

The same story with nat in this configuration
/opt/vyatta/etc/config-migrate/migrate/nat/5-to-6

/opt/vyatta/etc/config-migrate/migrate/nat/5-to-6
- op: delete path: ['nat', 'source', 'rule', '100', 'outbound-interface']
- op: set path: ['nat', 'source', 'rule', '100', 'outbound-interface', 'interface-name'] value: eth0 replace: True
/opt/vyatta/etc/config-migrate/migrate/nat/6-to-7
- op: delete path: ['nat', 'source', 'rule', '100', 'outbound-interface', 'interface-name']
- op: set path: ['nat', 'source', 'rule', '100', 'outbound-interface', 'name'] value: eth0 replace: True

I noticed that

// Warning: Do not remove the following line.
// vyos-config-version: "broadcast-relay@1:cluster@1:config-management@1:conntrack@1:conntrack-sync@1:dhcp-relay@2:dhcp-server@5:dhcpv6-server@1:dns-forwarding@3:firewall@5:https@2:interfaces@13:ipoe-server@1:ipsec@5:l2tp@3:lldp@1:mdns@1:nat@5:ntp@1:pppoe-server@5:pptp@2:qos@1:quagga@6:salt@1:snmp@2:ssh@2:sstp@3:system@19:vrrp@2:vyos-accel-ppp@2:wanloadbalance@3:webgui@1:webproxy@2:zone-policy@1"
// Release version: 1.3.1

ipoe-server@1 and nat@5. It seems that migration scripts start from these numbers. But it is migration between brunches.
And migration from 1.3.1 to 1.4.0-epa2 fails.

Details

Version
VyOS 1.4.0-epa2, VyOS 1.5-rolling-202404040019
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

a.apostoliuk triaged this task as High priority.
n.fort changed the task status from Open to Confirmed.Apr 5 2024, 2:59 PM
n.fort claimed this task.
c-po renamed this task from Migration from 1.3.1 to 1.4 does not start from 0-to-1 migration script to ipoe: error in migration script logic while renaming mac-address to mac node.Apr 5 2024, 8:02 PM
c-po claimed this task.
c-po added a subscriber: n.fort.

Handling of the above migration scripts are all correct and this is a false assumption.

The problem was introduced in https://github.com/vyos/vyos-1x/commit/05df2a5f021f0c7aab7c06db645d210858b6e98d#diff-08291bf77870abe3af8bbe3e8ce4bbf344fd0498b2c5c75a75aa7235d381c88eL168

But the config migrator part unfortunately was added to the wrong version https://github.com/vyos/vyos-1x/commit/05df2a5f021f0c7aab7c06db645d210858b6e98d#diff-b8bb58b75607d3653e74d82eff02442f9f3ab82698f160ba37858f7cdf6c79ccR44-R46

As the syntax is valid from VyOS 1.3.0 which uses ipoe-server@1 the migration code must actually be part of the 1-to-2 migrator.

c-po moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta (1.4.0) board.
c-po moved this task from Open to Finished on the VyOS 1.5 Circinus board.
dmbaturin renamed this task from ipoe: error in migration script logic while renaming mac-address to mac node to ipoe: error in migration script logic while renaming mac-address to mac.May 11 2024, 5:57 PM
dmbaturin edited a custom field.