YunoHost-Apps / collabora_ynh

Collabora package for YunoHost
https://www.collaboraoffice.com/
GNU General Public License v3.0
16 stars 13 forks source link

Unable to upgrade to version 21.11.0.6~ynh1 #58

Closed fflorent closed 2 years ago

fflorent commented 2 years ago

Describe the bug

I attempted an upgrade from version 6.4.10~ynh2 to 21.11.0.6~ynh1

Extract from the logs:

2021-12-31 07:13:15,091: DEBUG - + '[' -f /var/cache/yunohost/app_tmp_work_dirs/app_rclr48q4/conf/../conf/coolwsd.xml ']'
2021-12-31 07:13:15,092: DEBUG - + template_path=/var/cache/yunohost/app_tmp_work_dirs/app_rclr48q4/conf/../conf/coolwsd.xml
2021-12-31 07:13:15,092: DEBUG - + ynh_backup_if_checksum_is_different --file=/etc/coolwsd/coolwsd.xml
2021-12-31 07:13:15,108: DEBUG - + local checksum_setting_name=checksum__etc_coolwsd_coolwsd.xml
2021-12-31 07:13:15,108: DEBUG - ++ ynh_app_setting_get --app=collabora --key=checksum__etc_coolwsd_coolwsd.xml
2021-12-31 07:13:15,109: DEBUG - ++ local _globalapp=collabora
2021-12-31 07:13:15,157: DEBUG - ++ app=collabora
2021-12-31 07:13:15,157: DEBUG - ++ [[ checksum__etc_coolwsd_coolwsd.xml =~ (unprotected|protected|skipped)_ ]]
2021-12-31 07:13:15,157: DEBUG - ++ ynh_app_setting get collabora checksum__etc_coolwsd_coolwsd.xml
2021-12-31 07:13:15,236: DEBUG - + local checksum_value=
2021-12-31 07:13:15,237: DEBUG - + backup_file_checksum=
2021-12-31 07:13:15,237: DEBUG - + '[' -n '' ']'
2021-12-31 07:13:15,238: DEBUG - + touch /etc/coolwsd/coolwsd.xml
2021-12-31 07:13:15,240: WARNING - touch: impossible de faire un touch '/etc/coolwsd/coolwsd.xml': Aucun fichier ou dossier de ce type
2021-12-31 07:13:15,240: DEBUG - + ynh_exit_properly
2021-12-31 07:13:15,744: DEBUG - + ynh_clean_setup
2021-12-31 07:13:15,745: DEBUG - + ynh_clean_check_starting
2021-12-31 07:13:15,745: DEBUG - + '[' -n '' ']'
2021-12-31 07:13:15,745: DEBUG - + '[' -n '' ']'
2021-12-31 07:13:15,745: DEBUG - + ynh_restore_upgradebackup
2021-12-31 07:13:15,745: DEBUG - + ynh_print_err '--message=Upgrade failed.'

Context

Logs

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

fflorent commented 2 years ago

Note: the restoration also fails, due to the renaming of loolwsd to coolwsd:

Info : Préparation de l'archive pour restauration...
Info : Restauration de collabora...
Info : [+...................] > Loading settings...
Info : [#+..................] > Validating restoration parameters...
Info : [##+++...............] > Restoring the configuration...
Info : [#####++++++++++.....] > Reinstalling dependencies...
Erreur : Impossible de restaurer collabora : Une erreur s'est produite dans le script de restauration de l'application
Info : L'opération 'Restaurer 'collabora' depuis une sauvegarde' a échoué ! Pour obtenir de l'aide, merci de partager le journal de l'opération en utilisant la commande 'yunohost log share 20211231-070421-backup_restore_app-collabora'
Attention : Here's an extract of the logs before the crash. It might help debugging the error:
Info : DEBUG - Correcting dependencies... Done
Info : DEBUG - The following packages will be REMOVED:
Info : DEBUG -   collabora-ynh-deps
Info : DEBUG - 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Info : DEBUG - ++ cat /tmp/tmp.IeYxZg3Q2S/dpkg_log
Info : DEBUG - ++ grep -oP '(?<=-ynh-deps depends on ).*(?=; however)'
Info : DEBUG - ++ tr '\n' ' '
Info : DEBUG - + local 'problematic_dependencies=loolwsd code-brand '
Info : DEBUG - + [[ -n loolwsd code-brand  ]]
Info : DEBUG - + ynh_package_install loolwsd code-brand --dry-run
Info : DEBUG - + ynh_apt --no-remove --option Dpkg::Options::=--force-confdef --option Dpkg::Options::=--force-confold install loolwsd code-brand --dry-run
Info : DEBUG - + ynh_wait_dpkg_free
Info : DEBUG - + grep -v 'fix-broken\|Reading state info'
Info : DEBUG - + sed --quiet '/Reading state info/,$p'
Info : DEBUG - + return 0
Info : DEBUG - + LC_ALL=C
Info : DEBUG - + DEBIAN_FRONTEND=noninteractive
Info : DEBUG - + apt-get --assume-yes --quiet -o=Acquire::Retries=3 -o=Dpkg::Use-Pty=0 --no-remove --option Dpkg::Options::=--force-confdef --option Dpkg::Options::=--force-confold install loolwsd code-brand --dry-run
Info : DEBUG - + ynh_die '--message=Unable to install dependencies'
Info : DEBUG - + ynh_exit_properly
Info : [+++.................] > Loading installation settings...
Info : [###+++..............] > Stopping and removing the systemd service...
Info : [######++++..........] > Removing dependencies...
Info : [##########+++.......] > Removing NGINX web server configuration...
Info : [####################] > Removal of collabora completed
Erreur : L'opération 'Restaurer 'collabora' depuis une sauvegarde' a échoué ! Pour obtenir de l'aide, merci de partager le journal de l'opération en utilisant la commande 'yunohost log share 20211231-070421-backup_restore_app-collabora'
Erreur : Rien n'a été restauré
# LANG=en apt-get --assume-yes --quiet -o=Acquire::Retries=3 -o=Dpkg::Use-Pty=0 --no-remove --option Dpkg::Options::=--force-confdef --option Dpkg::Options::=--force-confold install loolwsd code-brand --dry-run
Reading package lists...
Building dependency tree...
Reading state information...
Package loolwsd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  coolwsd

E: Package 'loolwsd' has no installation candidate
Taekiro commented 2 years ago

It is expected, and kind of normal since the file name changed. Same for the restore since the package doesn't seem to exist anymore on the collabora side.

You need to remove the app and then install it again. (cf https://github.com/YunoHost-Apps/collabora_ynh/pull/55#issuecomment-999781162 & https://forum.yunohost.org/t/collabora-online-development-edition-self-hostable-office-suite/6975/26)

fflorent commented 2 years ago

It is expected, and kind of normal since the file name changed.

I am not sure that's normal. If a user is offered an upgrade, the upgrade has to work, don't you think? :)

Moreover, the upgrade seems to fail due to an error while attempting to create a file. Isn't it something simple to fix?

fflorent commented 2 years ago

BTW, I am attempting to make a fix. I will probably discover why the upgrade cannot work.

If the upgrade cannot work, may I suggest a failure in the upgrade script, like below?

if [test if current_version is lower or equal to `6.4.10~ynh2`]; then
  ynh_die "The application cannot be upgraded. Ensure to remove it and reinstall it. See: https://forum.yunohost.org/t/collabora-online-development-edition-self-hostable-office-suite/6975/26";
fi
Taekiro commented 2 years ago

I am not sure that's normal. If a user is offered an upgrade, the upgrade has to work, don't you think? :)

Yes :D , but I don't know enough about the yunohost packaging system to take care of the issue by myself (I made that clear when I proposed my PR).

Moreover, the upgrade seems to fail due to an error while attempting to create a file. Isn't it something simple to fix?

The upgrade fails because of the backup before upgrading, which tries to backup a non-existing file (yet), since it uses the "new" backup script (instead of the functioning "old" one). But the backup itself is pointless because you cannot restore it as you saw. And because there is not much to backup ether way, the app is kind of empty, it's just the default with not much settings.

fflorent commented 2 years ago

The upgrade fails because of the backup before upgrading, which tries to backup a non-existing file (yet), since it uses the "new" backup script (instead of the functioning "old" one). But the backup itself is pointless because you cannot restore it as you saw. And because there is not much to backup ether way, the app is kind of empty, it's just the default with not much settings.

You're probably right. Maybe that's not much worth the effort to make the upgrade work.

Thanks for your work BTW! :heart:

fflorent commented 2 years ago

I see the main problem with attempting an upgrade: you don't have the history of the deb dependencies in the collabora repo… So the only way to test it is by restoring them by the apt archive :sweat:

https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-debian10/

fflorent commented 2 years ago

PR submitted. Indeed, that's too hard to handle a proper upgrade. I made very simple: I die early if the upgrade cannot be processed.