christianTF / LoxBerry-Plugin-LoxberryBackup

Backup Plugin für den LoxBerry
https://www.loxwiki.eu/display/LOXBERRY/Loxberry+Backup
2 stars 3 forks source link

LoxBerry Backup failed with error code 132 #38

Open spid3r opened 1 year ago

spid3r commented 1 year ago

Hi Christian,

first of all thank you very much for this amazing plugin! Insane what the lox community achieves with loxberry 😎

Problem

Now to my problem. I do get the following error in the log when i try running a backup:

 INFO: LoxBerry Version 3.0.0.2 ( is_raspberry.cfg is_hwmodel_raspberry_pi_3_3+_zero_2.cfg is_arch_aarch64.cfg )
 INFO: LoxBerry Backup Version 1.0.9
 INFO: Loglevel: 3
Script started on 2023-04-01 14:01:27+01:00 []
??? RBK0268E: Only Raspberries running Raspberry PI OS are supported. Use option --unsupportedEnvironment to invoke raspiBackup WITHOUT ANY SUPPORT.
--- RBK0026I: Debug logfile saved in /opt/loxberry/raspiBackup.log.

Script done on 2023-04-01 14:01:31+01:00 [COMMAND_EXIT_CODE="132"]
 ERROR: Backup failed with error code 132

I am running a Raspberry pi 3 B (see also attached healthcheck) with DietPi v8.15.2.

Cause

After doing some research arround the --unsupportedEnvironment option mentioned in the log seems like raspiBackup introduced this new parameter with v0.6.7 (https://github.com/framps/raspiBackup/releases/tag/v0.6.7 https://github.com/framps/raspiBackup/issues/435).

So in general raspiBackup is now a lot more strict when it comes to run on specific OS versions. What i don't understand is why this issue has not been reported before by anyone else since v0.6.7 has been released May 11, 2022. Anyways i managed to fix it locally on my loxberry:

My Fix

To bypass the issue i changed the line calling raspiBackup.sh in runbackup.pl and added the --unsupportedEnvironment parameter. https://github.com/christianTF/LoxBerry-Plugin-LoxberryBackup/blob/333fd3182d54d54ac55ff78e7faf0bc8614da32a/bin/runbackup.pl#L114

and i can confirm that after this change the backup can run successfully:

 INFO: LoxBerry Version 3.0.0.2 ( is_raspberry.cfg is_hwmodel_raspberry_pi_3_3+_zero_2.cfg is_arch_aarch64.cfg )
 INFO: LoxBerry Backup Version 1.0.9
 INFO: Loglevel: 3
Script started on 2023-04-01 14:07:55+01:00 []
!!! RBK0269W: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
!!! RBK0268W: @@@ Unsupported environment @@@
!!! RBK0269W: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
--- RBK0009I: loxberry: raspiBackup.sh V0.6.8 - 2023-03-23 (e2037d2) started at Sat Apr 1 14:07:59 BST 2023.
--- RBK0031I: Checking whether a new version of raspiBackup.sh is available.
/usr/local/bin/raspiBackup.sh: line 2996: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory
--- RBK0151I: Using backuppath /media/usb/Pi1-3B/backup with partition type fuseblk.
!!! RBK0157W: No services to stop.
--- RBK1005I: Copy /etc/fstab to /media/usb/Pi1-3B/backup/loxberry/loxberry-ddz-backup-20230401-140755/raspiBackup/extensionSaveArea
total 4
drwxrwxrwx 1 1001 1001 144 Apr 1 14:08 .
drwxrwxrwx 1 1001 1001 168 Apr 1 14:08 ..
-rwxrwxrwx 1 1001 1001 1276 Apr 1 14:08 fstab
--- RBK0085I: Backup of type ddz started. Please be patient.
--- RBK0078I: Backup time: 00:44:11.
--- RBK0033I: Please wait until cleanup has finished.
--- RBK0159I: 2 backups kept for ddz backup type. Please be patient.
--- RBK0017I: Backup finished successfully.
--- RBK0010I: loxberry: raspiBackup.sh V0.6.8 - 2023-03-23 (e2037d2) stopped at Sat Apr 1 14:52:20 BST 2023 with rc 0.
--- RBK0026I: Debug logfile saved in /opt/loxberry/raspiBackup.log.

Script done on 2023-04-01 14:52:22+01:00 [COMMAND_EXIT_CODE="0"]

The backup also seems to have been created successfully on the usb stick image

Next Steps

So the question now arises how we can enhance loxberry backup to support OS <> Raspberry PI OS.

Thanks in advance and have a great day!

greetings from Ludwigshafen :-)

Kind regards Thorsten

framps commented 1 year ago

So in general raspiBackup is now a lot more strict when it comes to run on specific OS versions.

This option was added because I got mad because people which don't run Raspberry HW and RaspbianOS created issues in github even raspiBackup is supported only for RaspberryHW and RaspbianOS. See here for the details.

What i don't understand is why this issue has not been reported before by anyone else since v0.6.7 has been released May 11, 2022.

Looks like you are the first one who uses Loxberry on non Raspberry HW or on another OS than RaspbianOS :wink:

Because I know raspiBackup successfully runs also on other HW and SW I added an error message which mentions this option and allows to disable the check. But then it's on their own risk.

  • Shouldn't any other OS than Raspberry PI OS be supported also by loxberry backup? I think that would be a bad decision.

loxberryBackup uses raspiBackup and thus fails if raspiBackup fails. As I wrote above other OS can run raspiBackup. You're the first one who faces this issue and it seems to me Loxberry is mostly used on Raspberries with Raspbian. So it's up to Christian whether he want's to add a checkbox or just document your workaround. I think it's quite easy to add `--unsupportedEnvironment' in the Perl script and no checkbox is required.

spid3r commented 1 year ago

Hey Framps,

thanks for your fast feedback! Also big thanks to you for the raspiBackup tool! Jup I agree to everything you say and if i was the maintainer i would also restrict the supported HW / OS to not get flodded with these millions of possible combinations😉

I think might be useful to add an option to the loxberry plugin or just add the parameter statically.

I thought my HW/OS combination is not that exotic but might be the case 😆

ARM / Raspberry Pi 3 Model B Rev 1.2 (aarch64)
DietPi v8.15.2

Maybe more people will get the problem in the future as well since with Loxberry 3 the OS is based on "Diet Pi": https://wiki.loxberry.de/installation_von_loxberry/die_installation_von_loxberry/start#image_vorbereitung

Forgot to attach the healthcheck file that is now added here. healthcheck.txt

framps commented 1 year ago

or just add the parameter statically.

I don't like this approach because then the user of LoxberryBackup will not get notified that the backup may fail or even create inconsistent backups because he doesn't run raspiBackup on a supported - and more important - tested environment :cry:

Maybe more people will get the problem in the future as well since with Loxberry 3 the OS is based on "Diet Pi":

That's new for me. Then it makes sense to add a checkbox.

spid3r commented 1 year ago

agree again 😉 adding a parameter (not set as default) would be the best option inluding mentioning the background in the docu. So people are aware that they do the backup on non tested/supported HW/OS combination if they opt-in for it. @christianTF what do you think?

spid3r commented 1 year ago

@framps just noticed that you also are part of the loxforum 🤣 I guess you run an older version of Loxberry then

framps commented 1 year ago

No. I don't use Loxberry. But I registered in the forum to be able to support LoxberryBackup/raspiBackup 😃