YunoHost-Apps / uptime-kuma_ynh

Uptime Kuma package for YunoHost
https://uptime.kuma.pet/
GNU Affero General Public License v3.0
12 stars 4 forks source link

Backup unusable #93

Open ebouaziz opened 10 months ago

ebouaziz commented 10 months ago

Describe the bug

Cannot restore backup from 1.2.38

Context

Steps to reproduce

  1. Uninstall 1.2.39
  2. try to restore with sudo yunohost log share 20231210-234050-backup_restore_app-uptime-kuma
  3. restore fails
  4. here are the logs : https://paste.yunohost.org/raw/uxatunabot

Logs

https://paste.yunohost.org/raw/uxatunabot

additional notes

I opened the backup out of curiosity and noticed:

content of backup.csv

"/etc/nginx/conf.d/uptime.xxx.ynh.fr.d/uptime-kuma.conf","apps/uptime-kuma/backup/etc/nginx/conf.d/uptime.xxx.ynh.fr.d/uptime-kuma.conf"
"/etc/logrotate.d/uptime-kuma","apps/uptime-kuma/backup/etc/logrotate.d/uptime-kuma"
"/etc/systemd/system/uptime-kuma.service","apps/uptime-kuma/backup/etc/systemd/system/uptime-kuma.service"
"/var/log/uptime-kuma","apps/uptime-kuma/backup/var/log/uptime-kuma"
"/home/yunohost.backup/tmp/uptime-kuma-pre-upgrade2/backup.csv","backup.csv"
"/home/yunohost.backup/tmp/uptime-kuma-pre-upgrade2/info.json","info.json"
"/home/yunohost.backup/tmp/uptime-kuma-pre-upgrade2/apps/uptime-kuma","apps/uptime-kuma"
ebouaziz commented 10 months ago

I assume the application's configuration was in /var/www/uptime-kuma 😅

CodeShakingSheep commented 10 months ago

Restoring my backup failed too. image

Here are the logs: https://paste.yunohost.org/raw/ivomexoraw

ebouaziz commented 9 months ago

I took the 1.23.11 upgrade as an opportunity to run a test out of curiosity:

the uptime-kuma-pre-upgrade2 backup does not contain var/www/uptime-kuma while the one created manually does contain it. The sizes are 220KB vs 218MB too. I have no idea on how to fix that as I don't know how ynh app packaging works but I thought it could be a clue.

2. try to restore with sudo yunohost log share 20231210-234050-backup_restore_app-uptime-kuma This is a copy-pasta error, I used the yunohost backup restore command.

ketsapiwiq commented 9 months ago

Hello! I suspect it's due to the new yunohost packaging of the app... I would try to fix it manually by extracting the interesting files (old backup script would backup node_modules). Sorry I lack time for extensive testing...

CodeShakingSheep commented 8 months ago

I can confirm the behavior @ebouaziz described. My manual backup has 964 MB while my pre-upgrade backup has only 2 MB. In the pre-upgrade backup there was this message in the logs: /var/www/uptime-kuma will not be saved, because 'BACKUP_CORE_ONLY' is set.

This line wasn't present in the manual backup logs.

ketsapiwiq commented 8 months ago

OK so it was the --is_big flag in the backup script that made it not backed up when doing an upgrade. Fixed by https://github.com/YunoHost-Apps/uptime-kuma_ynh/pull/103/commits/3d5512361f8b08c86c368537d62a6c34f4b6be02 supposedly.