Can't upgrade nextcloud, issue with nextcloud-deps?

#1

My YunoHost server

Hardware: bare metal x86
YunoHost version: 3.5.2.2 (stable)
I have access to my server : Through SSH
**Current nextcloud version :**12.0.2

Description of my issue

Trying to manually upgrade nextcloud through SSH, and process failed with some odd warnings :

root@yourte:~# yunohost app upgrade nextcloud
Info : Mise à jour de l’application nextcloud …
Info : Loading installation settings...
Info : Ensuring downward compatibility...
Info : Backing up the app before upgrading (may take a while)...
Attention : 1982 Data dir will not saved, because backup_core_only is set.
Attention : 4545 dpkg-query: le paquet « nextcloud-deps » n'est pas installé et aucune information n'est disponible
Attention : 4547 Utilisez dpkg --info (= dpkg-deb --info) pour examiner les fichiers
Attention : 4548 archives, et dpkg --contents (= dpkg-deb --contents) pour afficher leur
Attention : 4550 contenu.
Attention : 4705 Impossible de sauvegarder l’application 'nextcloud'
Attention : Traceback (most recent call last):
Attention :   File "/usr/lib/moulinette/yunohost/backup.py", line 701, in _collect_app_files
Attention :     raise_on_error=True, chdir=tmp_app_bkp_dir, env=env_dict)[0]
Attention :   File "/usr/lib/moulinette/yunohost/hook.py", line 396, in hook_exec
Attention :     raise YunohostError('hook_exec_failed', path=path)
Attention : YunohostError: Échec de l’exécution du script : /tmp/backup_I6q73M
Attention : 4708 Il n’y a rien à sauvegarder
Attention : Backup failed, the upgrade process was aborted.
Erreur : Impossible de mettre à jour nextcloud
Info : L’opération 'Mettre à jour l’application 'nextcloud'' a échouée ! Pour avoir de l’aide, merci de partager le journal historisé de cette opération en utilisant la commande 'yunohost log display 20190429-133311-app_upgrade-nextcloud --share'
Erreur : Les applications suivantes n'ont pas été mises à jour : nextcloud

Full log is here https://paste.yunohost.org/raw/ezufulobez

Maybe I’m trying to upgrade from a too old version, where the ǹextcloud-deps fake package was not used… Is there a way to upgrade to an intermediate version ? (my current nextcloud_ynh revision is 8f98d512b17c12b3f6225414c8dd5546ea482307)

#2

That error comes from a very old backup script

This was used to restore the dependencies during the restore script.
You should probably still have this package.

Anyway, in order to upgrade, and because apparently this package is missing, edit your backup script and comment the line 45. As well as the lines 47 and 48 of the restore script, in case the upgrade fails.

#3

Hi Maniack, thanks for you answer.

I commented out the liens about nextcloud-deps package in both my backup & restore scripts.
The upgrade process goes further, but failed anyway. Here’s the full log https://paste.yunohost.org/raw/alesujizeb .

I guess the main error is Argument 4 passed to OCA\Theming\ThemingDefaults::__construct() must implement interface OCP\Files\IAppData, instance of OC\Memcache\Factory given, called in lib/private/Server.php on line 952 and defined in /var/www/nextcloud/apps/theming/lib/ThemingDefaults.php:93 and I found a relevant issue upstream: https://github.com/nextcloud/server/issues/12516 ; I try to do what is mentionned there (disable the theming app before upgrade)

The upgrade failed again, with this error 242729 DEBUG UnexpectedValueException: The files of the app "files_pdfviewer" were not correctly replaced before running the update. ( Full log: https://paste.yunohost.org/raw/cexuquwoxo).

I disable the “files_pdfviewer” app and try again :wink:

It failed again, with this error Column not found: 1054 Unknown column 'uid' in 'where clause'; I found another upsteam issue https://github.com/nextcloud/server/issues/13004 and try the proposed solution https://github.com/nextcloud/server/issues/13004#issuecomment-453882378, and try to upgrade again !

But it failed, with the same error (Unknown column 'uid').

I’ll try by disabling more apps (contacts, calendar, etc).

#4

I believe (not using nextcloud apps) that you’re supposed to disable all apps before doing an upgrade.
Not sure by the way to understand why nextcloud isn’t doing it itself…

EDIT: https://docs.nextcloud.com/server/16/admin_manual/maintenance/upgrade.html#prerequisites
That’s about “3rd party apps”, don’t know if it’s only some specific not officially supported apps or all apps though.

#5

My thought was that the YNH package does is itself (disabling apps, upgrade nexcloud and the enabling apps), but maybe not.

Actually disabling these apps does not solve the issue. Still have the “unknown column uid” error

I end up doing something crazy : By constantly viewing the output of DESCRIBE nextcloud from MySQL, I saw that the uid column is being remove. The I do the ALTER TABLE oc_cards ADD COLUMN uid VARCHAR(255); again. I happens a few times during my Nexcloud 12 to 15 upgrade, by finally succceed !!! \o/

=> 404201 SUCCESS nextcloud a été mis à jour. !!

#6

I checked, but no the upgrade script doesn’t do that. Don’t know why.

That’s strange that nextcloud removes itself one of is needed table…
Also upgrading from 12 to 15 shouldn’t be a problem since the upgrade script upgrade to 13, then 14 before 15.
Either it was a table from a third party app, or just nextcloud messing with its own stuff.

Anyway, glad you finally succeed.

1 Like
#7

Everything went fine except the calendar app.

In my Nextcloud log I have the following errors : Unknown column 'synctoken' in 'field list'.

I have to run some migrations manually:

# sudo -u nextcloud php occ migrations:execute dav 1006Date20180628111625
# sudo -u nextcloud php occ migrations:execute dav 1008Date20181114084440

Now it seems to work, but I wonder why some migrations were skipped…