Page MenuHomeVyOS Platform

Configuration corrupted after saving and powercut or force reboot
Closed, ResolvedPublicBUG

Description

Configuration corrupted after force reboot/shutdown after the saving.

To reproduce

echo 1 | sudo tee /proc/sys/kernel/sysrq
set protocols static route 192.0.2.5/32 blackhole
commit

Add script:

cat /config/scripts/myscript.sh
#!/bin/vbash
source /opt/vyatta/etc/functions/script-template
configure
delete protocols static route 192.0.2.5/32
commit
set protocols static route 192.0.2.5/32 dhcp-interface eth2
commit
save
exit

Execute the script, waiting for the message Saving configuration to '/config/config.boot'...Done
And immediately force reboot of powercut the instance

vyos@r15-left# sudo sg vyattacfg -c /config/scripts/myscript.sh
Saving configuration to '/config/config.boot'...
Done
[edit]
vyos@r15-left# echo b | sudo tee /proc/sysrq-trigger
b

After the reboot the configuration is corrupted

config-fails.png (592×833 px, 15 KB)

The configuration after the reboot:

vyos@r15-left:~$ cat /config/config.boot
system {
    conntrack {
        modules {
            tftp {
            }
            sqlnet {
            }
            sip {
            }
            pptp {
            }
            nfs {
            }
            h323 {
            }
            ftp {
            }
        }
    }
    config-management {
        commit-revisions "200"
    }
}
interfaces {
    ethernet eth0 {
        hw-id 52:54:00:44:35:57
    }
    ethernet eth1 {
        hw-id 52:54:00:2f:77:99
    }
    ethernet eth2 {
        hw-id 52:54:00:8b:59:41
    }
}
vyos@r15-left:~$

Reproduced on VM and baremetal server.

Details

Difficulty level
Unknown (require assessment)
Version
1.3.6
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

Viacheslav triaged this task as Urgent! priority.Mar 2 2024, 10:37 AM
Viacheslav created this task.
Viacheslav renamed this task from Configurration corrupted after saving and powercut of force reboot to Configuration corrupted after saving and powercut of force reboot.Mar 2 2024, 10:42 AM
Viacheslav renamed this task from Configuration corrupted after saving and powercut of force reboot to Configuration corrupted after saving and powercut or force reboot.Mar 2 2024, 10:59 AM

Instead of that sysrq stuff, how does it work if you try these 3 tests?

Test1:

configure
set protocols static route 192.0.2.5/32 blackhole
commit

/config/scripts/myscript.sh

reboot

vs.

Test2:

configure
set protocols static route 192.0.2.5/32 blackhole
commit

/config/scripts/myscript.sh

sync && sync && reboot

vs.

Test3:

configure
set protocols static route 192.0.2.5/32 blackhole
commit

/config/scripts/myscript.sh

sleep 5 && sync && sleep 5 && sync && reboot

Also I assume that you have installed VyOS onto a harddrive to boot from or is this an liveimage only?

Viacheslav changed the task status from Open to Needs testing.Mar 4 2024, 5:34 PM
Viacheslav claimed this task.