[Nextcloud] Echec de la mise à jour

Bonjour,

Jusqu’à maintenant je n’ai eu aucun soucis pour upgrader les différentes applications. J’ai cependant eu une erreur lorsque j’ai voulu mettre à jour Nextcloud récemment. Il semblerait qu’elle se soit annulée à cause d’une impossibilité de réaliser un backup ?

Je ne suis malheureusement pas très expert dans le domaine, voici donc un extrait des logs si quelqu’un pense pouvoir m’aider :

2017-07-28 13:57:05,119 INFO     yunohost.hook <lambda> - [628.1] + app=nextcloud
2017-07-28 13:57:05,120 INFO     yunohost.hook <lambda> - [628.1] + real_app=nextcloud
2017-07-28 13:57:05,121 INFO     yunohost.hook <lambda> - [628.1] + dbname=nextcloud
2017-07-28 13:57:05,121 INFO     yunohost.hook <lambda> - [628.1] + dbuser=nextcloud
2017-07-28 13:57:05,121 INFO     yunohost.hook <lambda> - [628.1] + backup_number=1
2017-07-28 13:57:05,122 INFO     yunohost.hook <lambda> - [628.1] + old_backup_number=2
2017-07-28 13:57:05,122 INFO     yunohost.hook <lambda> - [628.1] + sudo yunohost backup list
2017-07-28 13:57:05,123 INFO     yunohost.hook <lambda> - [628.1] + grep -q nextcloud-before-upgrade1
2017-07-28 13:57:07,564 INFO     yunohost.hook <lambda> - [628.1] + backup_number=2
2017-07-28 13:57:07,564 INFO     yunohost.hook <lambda> - [628.1] + old_backup_number=1
2017-07-28 13:57:07,565 INFO     yunohost.hook <lambda> - [628.1] + ynh_app_setting_set nextcloud backup_core_only 1
2017-07-28 13:57:07,565 INFO     yunohost.hook <lambda> - [628.1] + sudo yunohost app setting nextcloud backup_core_only -v 1 --quiet
2017-07-28 13:57:09,763 INFO     yunohost.hook <lambda> - [628.1] ++ cat /var/www/nextcloud/version.php
2017-07-28 13:57:09,764 INFO     yunohost.hook <lambda> - [628.1] ++ grep OC_VersionString
2017-07-28 13:57:09,765 INFO     yunohost.hook <lambda> - [628.1] ++ cut '-d'\''' -f2
2017-07-28 13:57:09,783 INFO     yunohost.hook <lambda> - [628.1] + '[' 11.0.2 '>' 11.0.0 ']'
2017-07-28 13:57:09,784 INFO     yunohost.hook <lambda> - [628.1] + sudo yunohost backup create --ignore-hooks --apps nextcloud --name nextcloud-before-upgrade2
2017-07-28 13:57:11,947 WARNING  yunohost.hook <lambda> - [628.1] --ignore-hooks is deprecated and will be removed in thefuture. Please use --ignore-system instead.
2017-07-28 13:57:20,886 WARNING  yunohost.hook <lambda> - [628.1] Data dir will not saved, because backup_core_only is set.
2017-07-28 13:57:22,960 WARNING  yunohost.hook <lambda> - [628.1] dpkg-query: le paquet « nextcloud-deps » n'est pas installé et aucune information n'est disponible
2017-07-28 13:57:22,961 WARNING  yunohost.hook <lambda> - [628.1] Utilisez dpkg --info (= dpkg-deb --info) pour examiner les fichiers
2017-07-28 13:57:22,962 WARNING  yunohost.hook <lambda> - [628.1] archives, et dpkg --contents (= dpkg-deb --contents) pour afficher leur
2017-07-28 13:57:22,962 WARNING  yunohost.hook <lambda> - [628.1] contenu.
2017-07-28 13:57:23,015 WARNING  yunohost.hook <lambda> - [628.1] Impossible de sauvegarder l'application « nextcloud »
2017-07-28 13:57:23,021 WARNING  yunohost.hook <lambda> - [628.1] Il n'y a rien à sauvegarder
2017-07-28 13:57:23,130 INFO     yunohost.hook <lambda> - [628.1] + '[' 22 -eq 0 ']'
2017-07-28 13:57:23,131 INFO     yunohost.hook <lambda> - [628.1] + ynh_die 'Backup failed, the upgrade process was aborted.'
2017-07-28 13:57:23,132 INFO     yunohost.hook <lambda> - [628.1] + echo 'Backup failed, the upgrade process was aborted.'
2017-07-28 13:57:23,133 WARNING  yunohost.hook <lambda> - [628.1] Backup failed, the upgrade process was aborted.
2017-07-28 13:57:23,133 INFO     yunohost.hook <lambda> - [628.1] + exit 1
2017-07-28 13:57:23,173 ERROR    yunohost.app app_upgrade - [628.1] Impossible de mettre à jour nextcloud
2017-07-28 13:57:23,189 WARNING  yunohost.tools tools_upgrade - [628.1] unable to upgrade apps: [Errno 61] Aucune application à mettre à jour
2017-07-28 13:57:23,190 INFO     moulinette.core translate - untranslated key 'app_upgrade_failed' for locale 'fr'
2017-07-28 13:57:23,190 ERROR    moulinette.core translate - unable to retrieve key 'app_upgrade_failed' for default locale 'en'
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/moulinette/core.py", line 201, in translate
    return _load_key(self.default_locale)
  File "/usr/lib/python2.7/dist-packages/moulinette/core.py", line 192, in _load_key
    return value.encode('utf-8').format(*args, **kwargs)
KeyError: 'app'
2017-07-28 13:57:23,197 ERROR    yunohost.tools tools_upgrade - [628.1] app_upgrade_failed

En vous remerciant par avance de toute aide que vous pourrez apporter !

Bonjour @Siklaris,

Te souviens-tu quelle était la toute première version de Nextcloud que tu as installée sur ton serveur (peut-être même ownCloud…?) ?

Bonjour. Merci de ta réponse !

Je ne sais pas exactement quel était le numéro de version, cela fait mois d’un an que j’ai le serveur. Est-ce qu’il y a des logs où je peux trouver ça ?

C’était bien Nextcloud que j’avais installé. Depuis la première installation il y a eu qu’une seule MAJ, et ça c’est deuxième…

Quel résultat te donne la commande dpkg -l |grep nextcloud ?
Le paquet nextcloud-deps est-il présent ?

Le paquet n’est pas présent. J’ai essayé de regarder manuellement avec dpkg -l, et je ne trouve rien concernant Nexcloud.

C’est extrêmement curieux, ce paquet est créé à l’installation de Nextcloud, et également à la mise à jour…

Pour te dépanner, peux-tu STP essayer ceci :

  • cd /tmp
  • equivs-control nextcloud-deps
  • édite le fichier nextcloud-deps généré et édite la ligne Package: ... pour qu’elle indique Package: nextcloud-deps
  • equivs-build nextcloud-deps
  • sudo dpkg -i nextcloud-deps*.deb

Tu peux alors retenter la mise à jour du paquet Nextcloud…

1 Like

Génial, cela fonctionne ! J’ai pu faire la MAJ vers la 11.0.3. Si j’ai bien compris tu m’a fait créer un faux paquet pour que l’opération aille jusqu’au bout ?

Je ne comprends pas comment ce paquet a pu disparaitre, mais avec l’opération que tu as donné ça a fonctionné. Un énorme merci !

1 Like

Bonjour,

Pareil de mon côté echec sur toute la ligne, pour un ugrade de nexcloud 11 à 12, voici la trace
(je précise que l’appli nextcloud a disparu suite à cela et que j’ai plus qu’à me refaire tout à la main, la mise à jour nexcloud est absolument pas fiable sous yunohost, à chaque fois c’est la même chose pour moi, ça plante et je perds tout)

yunohost app upgrade nextcloud

Warning: --ignore-hooks is deprecated and will be removed in thefuture. Please use --ignore-system instead.
Warning: Data dir will not saved, because backup_core_only is set.
Warning:
Warning: Update to nextcloud 12.0.0
Warning: Unable to upgrade Nextcloud
Warning: Upgrade failed.
Warning: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111 “Connection refused”)
Warning: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111 “Connection refused”)
Warning: --ignore-hooks is deprecated and will be removed in thefuture. Please use --ignore-system instead.
Warning: --hooks is deprecated and will be removed in thefuture. Please use --system instead.
Warning: Mounting the backup archive failed
Warning: ‘yunohost app checkurl’ is deprecated and will be removed in the future
Extracting templates from packages: 100%
Warning: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111 “Connection refused”)
Warning: Unable to restore the app 'nextcloud’
Warning: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111 “Connection refused”)
Warning: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111 “Connection refused”)
Warning: Nothing has been restored
Warning: The app was restored to the way it was before the failed upgrade.
Error: Unable to upgrade nextcloud
Error: No app to upgrade

une idée?

Bonjour @FredFF,

Désolé pour ta (tes ?) mésaventures…
Ton serveur MySQL fonctionne-t-il ? Tu peux vérifier via la commande systemctl status mysql.

Sinon, un mise à jour dans le passé s’est peut-être mal passée et le mot de passe MySQL retenu par le package n’est pas le bon ?
Tu peux récupérer le mot de passe connu via la commande :

yunohost app setting nextcloud mysqlpwd

et essayer de te connecter à MySQL via la commande :

mysql -u nextcloud --password="<ton_mot_de_passe>"

Ca ne devrait pas renvoyer d’erreur…

1 Like

Merci JimboJoe, sqlserver est bien actif…
si j’essaie de restaurer la sauvegarde, ça me donne ça:
yunohost backup restore nextcloud-before-upgrade1
Warning: --hooks is deprecated and will be removed in thefuture. Please use --system instead.
Warning: YunoHost is already installed
Do you really want to restore an already installed system? [y/N]: y
Warning: Mounting the backup archive failed
Warning: ‘yunohost app checkurl’ is deprecated and will be removed in the future
Extracting templates from packages: 100%
Warning: ERROR 1007 (HY000) at line 1: Can’t create database ‘nextcloud’; database exists
Error: Unable to restore the app 'nextcloud’
Error: Nothing has been restored

une idée pour pouvoir restaurer malgré tout?

Essaie d’installer archivemount : sudo apt-get install archivemount

EDIT : et qu’en est-il de ton mot de passe mysql pour l’application nextcloud ?

Ouahh super j’ai pu restaurer le backup! (l’installation du paquet archivemount a permis à la restauration d’aller au bout). Après reboot le test mot de passe fonctionne je peux me connecter.

1 Like

OK, c’est déjà ça !
Donc… mysql fonctionne bien, le mot de passe du package est bon, l’erreur que tu as eue est donc très bizarre…
Es-tu assez vaillant pour recommencer l’upgrade… ? :slight_smile:

c’est en cours, je te dis quand ça termine

planté:-(
yunohost app upgrade nextcloud
Warning: --ignore-hooks is deprecated and will be removed in thefuture. Please use --ignore-system instead.
Warning: Data dir will not saved, because backup_core_only is set.
Warning: E: Sub-process /usr/bin/dpkg returned an error code (1)
Warning:
Warning: Update to nextcloud 12.0.0
Warning: Unable to upgrade Nextcloud
Warning: Upgrade failed.
Warning: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111 “Connection refused”)
Warning: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111 “Connection refused”)
Warning: E: Sub-process /usr/bin/dpkg returned an error code (1)
Warning: --ignore-hooks is deprecated and will be removed in thefuture. Please use --ignore-system instead.
Warning: --hooks is deprecated and will be removed in thefuture. Please use --system instead.
Warning: fuse: device not found, try ‘modprobe fuse’ first
Warning: Mounting the backup archive failed
Warning: ‘yunohost app checkurl’ is deprecated and will be removed in the future
Extracting templates from packages: 100%
Warning: E: Sub-process /usr/bin/dpkg returned an error code (1)
Warning: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111 “Connection refused”)
Warning: Unable to restore the app 'nextcloud’
Warning: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111 “Connection refused”)
Warning: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111 “Connection refused”)
Warning: E: Sub-process /usr/bin/dpkg returned an error code (1)
Warning: Nothing has been restored
Warning: The app was restored to the way it was before the failed upgrade.
Error: Unable to upgrade nextcloud
Error: No app to upgrade

Et l’installation d’une autre application passe… ?

oui je peux installer une autre appli.
Par contre de nouveau impossible de restaurer la sauvegarde, même message d’erreur, et rien à faire ça veut pas.
à noter que l’installation de archivemount ne devait pas apporter grand chose car fuse est en erreur , sur ma VM hébergée je n’ai pas accès au kernel, donc imposssible de configurer fuse.
Mais alors pourquoi la restauration est-elle passée et que maintenant ça plante tout le temps.
La sauvegarde n’est pas la même puisque yunohost en a créé une seconde et effacé la première…

yunohost backup restore nextcloud-before-upgrade2

Warning: --hooks is deprecated and will be removed in thefuture. Please use --system instead.
Warning: YunoHost is already installed
Do you really want to restore an already installed system? [y/N]: y
fuse: device not found, try ‘modprobe fuse’ first
Warning: Mounting the backup archive failed
Warning: ‘yunohost app checkurl’ is deprecated and will be removed in the future
Extracting templates from packages: 100%
Warning: E: Sub-process /usr/bin/dpkg returned an error code (1)
Warning: ERROR 1007 (HY000) at line 1: Can’t create database ‘nextcloud’; database exists
Error: Unable to restore the app 'nextcloud’
Warning: E: Sub-process /usr/bin/dpkg returned an error code (1)
Error: Nothing has been restored

EDIT:
j’ai supprimé archivemount et fuse, puis relancé la restauration et là:
sudo yunohost backup restore nextcloud-before-upgrade2
Warning: --hooks is deprecated and will be removed in thefuture. Please use --system instead.
Warning: YunoHost is already installed
Do you really want to restore an already installed system? [y/N]: y
Warning: Mounting the backup archive failed
Warning: ‘yunohost app checkurl’ is deprecated and will be removed in the future
Extracting templates from packages: 100%
Success! The SSOwat configuration has been generated
Success! Restore complete
apps:
nextcloud: Success

Bref je n’y comprends plus rien, il est temps que je me couche.
En attendant , nextcloud ne se met pas à jour chez moi… peut être lié au fait que ma VM soit hébergée et que je n’accède pas aux options du kernel?
est-il possible de lancer une mise à jour “minimale” en empêchant la partie backup (puisque j’en ai un qui semble fonctionnel)
Si tu as une idée j’en serai ravi, dans tous les cas un GRAND merci à toi.

OK, tout cela est très bizarre…
Regarde à l’occasion dans les fichiers de logs mysql afin d’essayer de comprendre l’origine de l’erreur ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111 "Connection refused")

Hourra j’y suis arrivé finalement.
En fait je pense que la réinstallation suite à la première restauration fonctionnelle avait planté à cause de dpkg "E: Sub-process /usr/bin/dpkg returned an error code (1)"
le message d’erreur mysql n’était qu’une conséquence de l’erreur précédente.
En supprimant archivemount et fuse, j’ai remis dpkg d’applomb, et du coup la mise à jour est passée.
Par contre le fait que ça ait planté au tout début restera un mystère…
En tout cas et même si je me répète MERCI à toi!

1 Like

De rien, content que tu t’en sois sorti ! Et je sais que tu saurais aider ton prochain :wink: