YunoHost-Apps / monitorix_ynh

Monitorix package for YunoHost
GNU Affero General Public License v3.0
3 stars 10 forks source link

Error during upgrade: "Unknown database 'monitorix'" when selecting the database #40

Closed MayeulC closed 1 year ago

MayeulC commented 2 years ago

Monitorix works, I can see data spanning more than one year.

image

The upgrade script fails to perform a backup, therefore not upgrading monitorix from 3.12.0~ynh2 to 3.14.0~ynh2.

Ynh 11 bare metal (x86_64). I have full access to the system.

Logs: https://paste.yunohost.org/raw/igagilekir

Josue-T commented 2 years ago

I think it's linked to #32 and #34. Monitorix never needed a database. The easiest way it maybe to remove the line which backup the db into the backup script.

MayeulC commented 2 years ago

I commented ynh_mysql_dump_db --database="$db_name" > db.sql in /etc/yunohost/apps/monitorix/scripts/backup, and it went further, but I forgot to comment it out in the restore script, and the upgrade failed again:

2022-11-17 10:54:14,716: DEBUG - nov. 17 10:54:14 nginx[1553622]: nginx: [emerg] invalid port in upstream "127.0.0.1:/monitorix" in /etc/nginx/conf.d/maindomain.tld.d/monitorix.conf:2

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

I edited the backup to remove that line for the restore script as well, and successfully restored it.