Nextcloud disparu après tentative de mise à jour

Bonsoir,

J’ai tenté de mettre à jour mon appli nextcloud, mais ça a échoué à cause d’une erreur HTTP 504. Depuis, elle n’est plus du tout accessible. La tuile a disparu et taper manuellement l’adresse me redirige vers le portail.

Je suis retourné dans les options de mise à jour et ai refait une tentative, mais ça a de nouveau échoué. Voici le log de l’interface web.

Impossible de mettre à jour nextcloud

+ exit 1

+ echo 'Backup failed, the upgrade process was aborted.'

+ ynh_die 'Backup failed, the upgrade process was aborted.'

Backup failed, the upgrade process was aborted.

+ '[' 5 -eq 0 ']'

The output directory is not empty

+ sudo BACKUP_CORE_ONLY=1 yunohost backup create --ignore-system --apps nextcloud --name nextcloud-pre-upgrade1 --verbose

+ grep -q nextcloud-pre-upgrade1

+ sudo yunohost backup list

+ local app_bck=nextcloud

+ local old_backup_number=2

+ backup_number=1

+ '[' '!' -e /etc/yunohost/apps/nextcloud/scripts/backup ']'

+ ynh_backup_before_upgrade

+ sudo yunohost app setting nextcloud backup_core_only --value=1 --quiet

+ ynh_app_setting_set nextcloud backup_core_only 1

+ '[' 12 -gt 11 ']'

+ current_major_version=12

+ current_version=12.0.4

++ cut '-d'\''' -f2

++ grep OC_VersionString /var/www/nextcloud/version.php

+ '[' -z /var/www/nextcloud ']'

+ '[' -z nextcloud ']'

+ user_home=1

++ sudo yunohost app setting nextcloud user_home --output-as plain --quiet

++ ynh_app_setting_get nextcloud user_home

+ db_name=nextcloud

++ sudo yunohost app setting nextcloud db_name --output-as plain --quiet

++ ynh_app_setting_get nextcloud db_name

+ final_path=/var/www/nextcloud

++ sudo yunohost app setting nextcloud final_path --output-as plain --quiet

++ ynh_app_setting_get nextcloud final_path

+ admin=pierre

++ sudo yunohost app setting nextcloud admin --output-as plain --quiet

++ ynh_app_setting_get nextcloud admin

+ path_url=/nextcloud

++ sudo yunohost app setting nextcloud path --output-as plain --quiet

++ ynh_app_setting_get nextcloud path

+ domain=stemy.me

++ sudo yunohost app setting nextcloud domain --output-as plain --quiet

++ ynh_app_setting_get nextcloud domain

+ app=nextcloud

++ . /usr/share/yunohost/helpers.d/utils

++ '[' -r /usr/share/yunohost/helpers.d/utils ']'

++ for helper in '$(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)'

++ . /usr/share/yunohost/helpers.d/user

++ '[' -r /usr/share/yunohost/helpers.d/user ']'

++ for helper in '$(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)'

++ . /usr/share/yunohost/helpers.d/system

++ '[' -r /usr/share/yunohost/helpers.d/system ']'

++ for helper in '$(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)'

++ . /usr/share/yunohost/helpers.d/string

++ '[' -r /usr/share/yunohost/helpers.d/string ']'

++ for helper in '$(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)'

++ . /usr/share/yunohost/helpers.d/setting

++ '[' -r /usr/share/yunohost/helpers.d/setting ']'

++ for helper in '$(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)'

++ . /usr/share/yunohost/helpers.d/print

++ '[' -r /usr/share/yunohost/helpers.d/print ']'

++ for helper in '$(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)'

++ . /usr/share/yunohost/helpers.d/package

++ '[' -r /usr/share/yunohost/helpers.d/package ']'

++ for helper in '$(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)'

+++ N_PREFIX=/opt/node_n

+++ export N_PREFIX=/opt/node_n

+++ node_version_path=/opt/node_n/n/versions/node

+++ n_install_dir=/opt/node_n

++ . /usr/share/yunohost/helpers.d/nodejs

++ '[' -r /usr/share/yunohost/helpers.d/nodejs ']'

++ for helper in '$(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)'

++ . /usr/share/yunohost/helpers.d/network

++ '[' -r /usr/share/yunohost/helpers.d/network ']'

++ for helper in '$(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)'

+++ MYSQL_ROOT_PWD_FILE=/etc/yunohost/mysql

++ . /usr/share/yunohost/helpers.d/mysql

++ '[' -r /usr/share/yunohost/helpers.d/mysql ']'

++ for helper in '$(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)'

++ . /usr/share/yunohost/helpers.d/ip

++ '[' -r /usr/share/yunohost/helpers.d/ip ']'

++ for helper in '$(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)'

+++ CAN_BIND=1

++ . /usr/share/yunohost/helpers.d/filesystem

++ '[' -r /usr/share/yunohost/helpers.d/filesystem ']'

++ for helper in '$(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)'

++ . /usr/share/yunohost/helpers.d/backend

++ '[' -r /usr/share/yunohost/helpers.d/backend ']'

++ for helper in '$(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)'

+++ run-parts --list /usr/share/yunohost/helpers.d

+ source /usr/share/yunohost/helpers

++ '[' jessie '!=' jessie ']'

+++ lsb_release --codename --short

++ pkg_dependencies='php5-gd php5-json php5-intl php5-mcrypt php5-curl php5-apcu php5-redis php5-ldap php5-imagick imagemagick acl tar smbclient'

+ source _common.sh

Exécution du script « /var/cache/yunohost/from_file/nextcloud_ynh-1e35eb7e6a6d327d57c872efe65205a18d2bea3a/scripts/upgrade »...

Vérification des paquets requis pour nextcloud...

Terminé

Extraction...

Téléchargement...

Mise à jour de l'application nextcloud...

Upgrading apps nextcloud

Est-ce que j’ai encore un espoir où bien vais-je devoir reconfigurer mon cloud depuis zéro ?

Merci d’avance.

Non, tu ne devrais pas avoir perdu de données (en supposant que tu n’as pas enlevé l’app pour la réinstaller…).

De là où tu es, je suggèrerais plutôt de repartir de la sauvegarde (il y en a une faite automatiquement à la mise-à-jour).
Fais attention à prendre celle de ta première tentative de mise à jour, la derière faite sur l’app pendant que ça marchait encore!

Ensuite, vérifie les logs de cette première tentative mise à jour, et c’est là qu’il trouver ce qui a foiré avant de t’y remettre.

Bonne chance!

Mise à jour: je l’ai réinstallé et maintenant, ça fonctionne. Ou presque: l’emplacement de mes fichiers n’étant pas celui par défaut, j’avais mis le fichier config en lieu sûr puis je l’ai restauré, mais je n’ai toujours pas accès à mes fichiers (erreur HTTP 500, même après redémarrage). Il me semble que je dois faire une opération supplémentaire, mais je ne sais plus laquelle.

Si tu as réinstallé, est-ce que ce n’est pas une simple indexation?
occ files:scan --all

Mais tu perds toutes les permissions fines, les tags, tout va sembler avoir été ajouté aujourd’hui, etc.

C’est pour ça que je conseillais la récup du backup.

J’ai eu un souci récemment, où la mise-à-jour se passait mal et la restauration auto aussi: résultat, il semble ne rien rester.
Après avoir enlevé le paquet fautif (archivemount dans mon cas), j’ai restauré, j’ai retrouvé tous mes petits, et ensuite la mise à jour s’est bien passée.

1 Like

En fait, la commande correcte est sudo -u nextcloud php occ files:scan --all(sinon, c’est occ: command not found). Sauf qu’elle me donne un message d’erreur incompréhensible:

root@stemy:/var/www/nextcloud# sudo -u nextcloud php occ files:scan --all
An unhandled exception has been thrown:
exception 'Doctrine\DBAL\DBALException' with message 'Failed to connect to the database: An exception occured in driver: SQLSTATE[28000] [1045] Access denied for user 'nextcloud'@'localhost' (using password: YES)' in /var/www/nextcloud/lib/private/DB/Connection.php:64
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /var/www/nextcloud/lib/private/DB/Connection.php(151): Doctrine\DBAL\Connection->setTransactionIsolation(2)
#5 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventManager))
#6 /var/www/nextcloud/lib/private/DB/ConnectionFactory.php(153): Doctrine\DBAL\DriverManager::getConnection(Array, Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventManager))
#7 /var/www/nextcloud/lib/private/Server.php(628): OC\DB\ConnectionFactory->getConnection('mysql', Array)
#8 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#9 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(116): Pimple\Container->offsetGet('OCP\\IDBConnecti...')
#10 /var/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('OCP\\IDBConnecti...')
#11 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(164): OC\ServerContainer->query('OCP\\IDBConnecti...')
#12 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(109): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
#13 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(116): Pimple\Container->offsetGet('DatabaseConnect...')
#14 /var/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('DatabaseConnect...')
#15 /var/www/nextcloud/lib/private/Server.php(1511): OC\ServerContainer->query('DatabaseConnect...')
#16 /var/www/nextcloud/lib/private/Server.php(332): OC\Server->getDatabaseConnection()
#17 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#18 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(116): Pimple\Container->offsetGet('OC\\Authenticati...')
#19 /var/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('OC\\Authenticati...')
#20 /var/www/nextcloud/lib/private/Server.php(336): OC\ServerContainer->query('OC\\Authenticati...')
#21 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#22 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(116): Pimple\Container->offsetGet('OC\\Authenticati...')
#23 /var/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('OC\\Authenticati...')
#24 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(164): OC\ServerContainer->query('OC\\Authenticati...')
#25 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(109): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
#26 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(116): Pimple\Container->offsetGet('OC\\Authenticati...')
#27 /var/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('OC\\Authenticati...')
#28 /var/www/nextcloud/lib/private/Server.php(352): OC\ServerContainer->query('OC\\Authenticati...')
#29 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#30 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(116): Pimple\Container->offsetGet('OCP\\IUserSessio...')
#31 /var/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('OCP\\IUserSessio...')
#32 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(164): OC\ServerContainer->query('OCP\\IUserSessio...')
#33 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(109): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
#34 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(116): Pimple\Container->offsetGet('UserSession')
#35 /var/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('UserSession')
#36 /var/www/nextcloud/lib/private/Server.php(1380): OC\ServerContainer->query('UserSession')
#37 /var/www/nextcloud/lib/private/Server.php(688): OC\Server->getUserSession()
#38 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#39 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(116): Pimple\Container->offsetGet('OC\\App\\AppManag...')
#40 /var/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('OC\\App\\AppManag...')
#41 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(164): OC\ServerContainer->query('OC\\App\\AppManag...')
#42 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(109): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
#43 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(116): Pimple\Container->offsetGet('AppManager')
#44 /var/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('AppManager')
#45 /var/www/nextcloud/lib/private/Server.php(1684): OC\ServerContainer->query('AppManager')
#46 /var/www/nextcloud/lib/private/legacy/app.php(332): OC\Server->getAppManager()
#47 /var/www/nextcloud/lib/private/legacy/app.php(113): OC_App::getEnabledApps()
#48 /var/www/nextcloud/lib/base.php(661): OC_App::loadApps(Array)
#49 /var/www/nextcloud/lib/base.php(1080): OC::init()
#50 /var/www/nextcloud/console.php(46): require_once('/var/www/nextcl...')
#51 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#52 {main}root@stemy:/var/www/nextcloud#

Gros PEBKAC de ma part. J’ai fini par comprendre que le mot de passe de la base de données changeait à chaque nouvelle installation. Et moi, comme un con, j’ai écrasé le fichier de config de la nouvelle install avec celui de l’ancienne, donc forcément, le mot de passe n’était plus le bon.

Bref, je suis sorti d’affaire. Ça aurait été vachement plus simple si il n’y avait pas eu cette foutue erreur 504 en plein milieu de l’upgrade.

Celà dit, c’est pas hérétique q’une érreur d’upgrade désinstalle nextcloud? j’ai eu le même problème j’avais un apt qui trainait dans un screen en même temps qu’un yunohost app upgrade:

root@intra:~# yunohost app upgrade
Warning: Upgrading app gitlab...
Warning: Upgrading app grafana...
Warning: Upgrading app kanboard...
Warning: Upgrading app netdata...
Warning: Upgrading app nextcloud...
Warning: Data dir will not be saved, because backup_core_only is set.
Warning: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
Warning: E: Unable to lock the administration directory (/var/lib/dpkg/), is another process     using it?
Warning: Unable to install dependencies
Warning: !!
Warning:   nextcloud's script has encountered an error. Its execution was cancelled.
Warning: !!
Warning: Upgrade failed.
Warning: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
Warning: E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Warning: Removing database nextcloud
Warning: Job for php5-fpm.service failed. See 'systemctl status php5-fpm.service' and 'journalctl -xn' for details.
Warning: Remove the user nextcloud
Warning: Mounting the backup archive failed
Warning: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
Warning: E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Warning: Unable to install dependencies
Warning: !!
Warning:   nextcloud's script has encountered an error. Its execution was cancelled.
Warning: !!
Warning: 
Warning: Unable to restore the app 'nextcloud'
Warning: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
Warning: E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Warning: Removing database nextcloud
Warning: Job for php5-fpm.service failed. See 'systemctl status php5-fpm.service' and 'journalctl -xn' for details.
Warning: /etc/cron.d/nextcloud wasn't deleted because it doesn't exist.
Warning: Remove the user nextcloud
Warning: Nothing has been restored
Warning: The app was restored to the way it was before the failed upgrade.
Error: Unable to upgrade nextcloud
Warning: Upgrading app rainloop...
Error: No app to upgrade

Pour une app officielle, désinstaller complètement pour ça ou pour une 503 ça me parait vraiment pas le bon comportement par défaut…

J’ai le même soucis, j’ai mon instance Nextcloud qui à disparu après une tentative de mise à jour ratée.

Restaurer le backup pre mise à jour ne fonctionne pas, " 2018-10-08 11:57:58,116: ERROR - Une application est déjà installée avec l’id « nextcloud »
"

J’ai regardé vos réponses mais ça ne m’aide pas trop pour savoir quoi faire.

Voici les logs des problèmes que j’ai eu :

 Première tentative : 

2018-10-02 10:55:48,874: WARNING - Data dir will not be saved, because backup_core_only is set.
2018-10-02 10:57:22,067: WARNING - php7.0-fpm.service is not active, cannot reload.
2018-10-02 10:57:22,068: WARNING - !!
2018-10-02 10:57:22,068: WARNING - nextcloud’s script has encountered an error. Its execution was cancelled.
2018-10-02 10:57:22,068: WARNING - !!
2018-10-02 10:57:22,068: WARNING - Upgrade failed.
2018-10-02 10:57:25,176: WARNING - E: dpkg a été interrompu. Il est nécessaire d’utiliser « sudo dpkg --configure -a » pour corriger le problème.
2018-10-02 10:57:25,377: WARNING - Removing database nextcloud
2018-10-02 10:57:30,690: WARNING - php7.0-fpm.service is not active, cannot reload.
2018-10-02 10:57:30,790: WARNING - Remove the user nextcloud

J’avais fait une maj de yunohost juste avant.
J’ai corrigé mon probleme de php7 que cette maj avait provoqué.

Ensuite j’ai retenté de mettre a jour nextcloud :

2018-10-02 11:19:29,595: WARNING - Source path ‘/etc/logrotate.d/nextcloud’ does not exist
2018-10-02 11:19:29,596: WARNING - !!
2018-10-02 11:19:29,597: WARNING - nextcloud’s script has encountered an error. Its execution was cancelled.
2018-10-02 11:19:29,597: WARNING - !!
2018-10-02 11:19:29,597: WARNING -
2018-10-02 11:19:29,698: WARNING - Impossible de sauvegarder l’application « nextcloud »
2018-10-02 11:19:29,799: WARNING - Il n’y a rien à sauvegarder
2018-10-02 11:19:29,800: WARNING - Backup failed, the upgrade process was aborted.
2018-10-02 11:19:29,953: ERROR - Impossible de mettre à jour nextcloud

Je ne sais pas où tu en es parce que je réponds un peu tard, mais surtout et avant tout: pas de panique!!

Quand une mise-à-jour échoue, l’app NC est désinstallée, mais les données sont toujours là!
Avant de relancer ta mise à jour, il faut récupérer l’appli depuis ta dernière sauvegarde.

Personellement, dans mon cas, les backup sont indisponibles.

Bonjour @Neru ,

Il semble que php7.0 ne soit pas installé, tout comme php7.0-fpm
Avec les versions 2.x.x du YunoHost, php5 était utilsé, maintenant, avec les versions 3.x.x c’est php7 qui est utilisé.
Avant tout : faire des exports, des sauvegardes de tout ce qui est possible.
Ensuite, tu pourrais essayer de faire un

sudo apt-get install php7.0 php7.0-fpm
sudo dpkg --configure -a #si nécessaire

ppr

Comme je disais, ce probleme de php7 avait ensuite été corrigé :wink: Ils était installé mais une mise a jour de yuno l’avait break

Je n’ai toujours pas de solution, mon nextcloud est indiqué comme installé dans yunohost, les mises a jour échouent, l’adresse mène sur un bad getaway :’(