Hi,
how to fine out which issue is here.
In the screenshot you can see the version
error from config-management/0-to1
Hi,
how to fine out which issue is here.
In the screenshot you can see the version
error from config-management/0-to1
When upgrading from one VyOS version to the next a set of migrate scripts will be runned to alter the current config.boot so it matches current syntax.
VyOS will find out which migrate scripts to run based on the last line in config.boot which informs which “version” each block is at. For example if your 230404 config have “interfaces:28” where the current “interfaces version” in 230904 is 30 then the following migrate scripts will be runned:
/opt/vyatta/etc/config-migrate/migrate/interfaces/28-to-29 /config/config.boot
/opt/vyatta/etc/config-migrate/migrate/interfaces/29-to-30 /config/config.boot
Note that when upgrading VyOS a new persistence partition will be created for the new version and then the files and directories in /config is copied to that.
This means that the original config.boot from your 230404 version remains untouched at:
/usr/lib/live/mount/persistence/boot/1.4-rolling-202304040317/rw/config/config.boot
To better find out what the migrate script dislikes with your config I would do something like this (there is probably an easier way to do the below):
Boot 1.4-rolling-202309040919.
Copy the config.boot from 1.4-rolling-202304040317 and call that config.boot.230404:
sudo cp /usr/lib/live/mount/persistence/boot/1.4-rolling-202304040317/rw/config/config.boot /config/config.boot.230404
Now on that config.boot.230404 (well first copy that into config.boot.test) we run the migrate script that failed:
sudo cp /config/config.boot.230404 /config/config.boot.test
sudo /opt/vyatta/etc/config-migrate/migrate/config-management/0-to-1 /config/config.boot.test
Hopefully you will now get a better dump to the console of what this particular migrate script dislikes about your 230404 config.
If possible please paste that into this thread so the migrate script can be fixed.
thx for this good hint
here are my results with more details
here is my config file on line 1806
in line 1806 there are two spaces, see screenshot from nano
@tomcat667 this is not due to a specific migration script, rather, this is due to an interaction between the image tools and a change in the underlying Debian distro: details are in task T5520, but the title tells the story and the fix is (relatively) easy:
" Likely source of corruption on system update exposed by change in coreutils for Bookworm"
It is fixed in new images, however, the source of the problem will be present in the image from which you are upgrading.
If you are willing and able, you can:
copy the revised script:
https://raw.githubusercontent.com/vyos/vyatta-cfg-system/current/scripts/install/install-image-existing
into
/opt/vyatta/sbin
on the image from which you are upgrading, and then do ‘add system image’ etc. again.
If that is not convenient, we can consider some other workarounds to get past the problematical images.
wow for this quick solution, i have replaced the origin file with the file from github.
but something get wrong
add system image /home/vyos/iso/vyos-rolling-latest.iso
Checking SHA256 checksums of files on the ISO image... OK.
Done!
/opt/vyatta/sbin/install-image: line 263: /opt/vyatta/sbin/install-image-existing: cannot execute: required file not found
Granted this is all a bit of a hack. However, check the permissions on the file — it should be executable and owned by root. You can ‘sudo bash’ to change the properties.
Line 263 from the new version /opt/vyatta/sbin/install-image-existing
for line in $(cat $old_grub_cfg); do
and the file permissions looks good
I believe the line 263 refers to
/opt/vyatta/sbin/install-image
which is the line calling
/opt/vyatta/sbin/install-image-existing
As a sanity check, I just walked through the steps with an image from August, before the fix:
vyos@vyos:~$ wget https://raw.githubusercontent.com/vyos/vyatta-cfg-system/current/scripts/install/install-ima
ge-existing
Connecting to raw.githubusercontent.com (185.199.111.133:443)
....
vyos@vyos:~$ sudo bash
root@vyos:/home/vyos#
root@vyos:/home/vyos# cp install-image-existing /opt/vyatta/sbin/
(edited above) Note that you need to set a name-server for the wget.
vyos@vyos# set system name-server ...
Hi,
same error as before
Weird. Well, we can try something different if you want to restore the original: I can point to the file circa April 4th, however, there were some changes around that time that may or may not have been in your image (I don’t have an archived iso of that era). In your April 4th image, does the file
/opt/vyatta/sbin/install-functions
contain the function
try_unmount
?
If so, restore to
https://raw.githubusercontent.com/vyos/vyatta-cfg-system/964e06bc3404b096d55e939b2bdb8d9c61a6a9b9/scripts/install/install-image-existing
try_unmount
found it on my version and replaced with the linked version from your post, but still the same error.
can i upgrade to a version from /june/july and step further?
I have attached my version
install-image-existing.config (8.7 KB)
install-functions.config (10.8 KB)
Wait, perhaps I misunderstood: when you say ‘same error’ which same error were you getting with:
(1) the new copy of install-image-existing
(2) the restored copy of install-image-existing
I want to make sure that we are on the same page …
the restored original file from install-image-existing works as expected, i can install a new image but the migration of the config file after rebooting works not.
i have replaced the install-functions and install-image-existing with the newer version and install a new image works not.
Okay, if we can get back to the original error, then that’s good; let’s start there … so original files; add system image runs; new image hits migration error; that’s where to begin to try a simple workaround. Make a backup of ‘install-image-existing’ and I will suggest a one line change; let me check and then send the suggestion …
Firstly re-save your config file; make sure that /config/config.boot has a last line that is the full release info; from the screenshot of the original error, this should look like:
// Release version: 1.4-rolling-202304040317
Make the following in-place change to /opt/vyatta/sbin/install-image-existing
diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing
index feba6683..3b8c4db1 100755
--- a/scripts/install/install-image-existing
+++ b/scripts/install/install-image-existing
@@ -192,7 +192,7 @@ if [ $space_avail -gt $space_needed_configdata ]; then
ndir=${INST_ROOT}/${VYATTA_NEW_CFG_DIR}
mkdir -p $ndir
find $VYATTA_NEW_CFG_DIR -maxdepth 1 -mindepth 1 \
- -exec cp '-a' '{}' "$ndir/" ';'
+ -exec cp '-a' '--reflink=never' '{}' "$ndir/" ';'
# Set the upgraded flag
touch $ndir/.upgraded
Again, verifying that the config file is intact beforehand is necessary.
thx for thix fix, now it works as expected. I appreciate it
but on my second node it will not work with this fix. this node has the same version.
VyOS 1.4-rolling-202304040317
add system image /home/vyos/vyos-rolling-latest.iso
Checking SHA256 checksums of files on the ISO image... OK.
Done!
/opt/vyatta/sbin/install-image: line 263: /opt/vyatta/sbin/install-image-existing: cannot execute: required file not found
the file from the first one first line is /
any idea what’s now wrong? I am somewhat at a loss
and the file from first node are very strange
install-image-existingnode1.config (8.7 KB)
install-image-existingnode2.config (9.0 KB)
this is the file after migration
Thanks for the update; let me take a look …
any update for me? or must I create commands and reinstall the complete ha cluster?