Mysql Hors service

Mon serveur YunoHost 11.2.91
Matériel: VM sur FreeBox Delta
Système d’exploitation: Linux 5.10.0-27-arm64
Version de YunoHost: 11.2.4.18 sur Debian 11.8
Nextcloud version : 28.0.1~ynh1
J’ai accès à mon serveur :** En SSH | Par la webadmin
Êtes-vous dans un contexte particulier ou avez-vous effectué des modifications particulières sur votre instance ?** : non

Sans que je comprenne pourquoi et que je fasse quoi que ce soit dans le code Mysql a cessé de fonctionner et ne redémarre pas.
Log Yunohost : https://paste.yunohost.org/raw/ewarehoceq
Log Mysql : hastebin

Que faire ? (Je ne suis pas expert Linux)

Pour continuer j’ai réussi à redémarrer mysql en redémarrant ma Box mais il y a toujours quelque chose de corrompu :
https://paste.yunohost.org/acereyokop

Avez-vous essayé :

cd /var/www/nextcloud
sudo -u nextcloud php8.2 --define apc.enable_cli=1 occ files:scan -vv --all
This version of Nextcloud requires at least PHP 8.0<br/>You are currently running 7.4.33. Please update your PHP version.root@sphd:/var/www/nextcloud#

ça c’est très curieux car j’ai PHP 8.1 et 8.2 …

Oui il suffit de remplacer php par php8.2 dans la commande

Je veux bien que vous me disiez comment faire …

J’ai corrigé ma réponse plus haut

Merci beaucoup @jarod5001

Désolé je reviens mais après avoir redémarré Yunohost tout semblait OK j’ai essayé de me connecter à Nextcloud → échec et à nouveau j’ai des erreurs dans Mysql
https://paste.yunohost.org/wezumirina

J’ai recommencé les commandes que vous m’aviez envoyées et en fait Nextcloud est toujours sur PHP 7.4
Il semble que quelque chose soit corrompu …

Exception during scan: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1712 Index oc_filecache is corrupted
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1938): Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1880): Doctrine\DBAL\Connection->handleDriverException()
#2 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1105): Doctrine\DBAL\Connection->convertExceptionDuringQuery()
#3 /var/www/nextcloud/lib/private/DB/Connection.php(261): Doctrine\DBAL\Connection->executeQuery()
#4 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(337): OC\DB\Connection->executeQuery()
#5 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(377): Doctrine\DBAL\Query\QueryBuilder->executeQuery()
#6 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(280): Doctrine\DBAL\Query\QueryBuilder->execute()
#7 /var/www/nextcloud/lib/private/Files/Cache/Cache.php(504): OC\DB\QueryBuilder\QueryBuilder->execute()
#8 /var/www/nextcloud/lib/private/Files/Mount/MountPoint.php(299): OC\Files\Cache\Cache->getId()
#9 /var/www/nextcloud/lib/private/Files/SetupManager.php(256): OC\Files\Mount\MountPoint->getStorageRootId()
#10 /var/www/nextcloud/lib/private/Files/SetupManager.php(315): OC\Files\SetupManager->oneTimeUserSetup()
#11 /var/www/nextcloud/lib/private/Files/SetupManager.php(214): OC\Files\SetupManager->setupForUserWith()
#12 /var/www/nextcloud/lib/private/legacy/OC_Util.php(110): OC\Files\SetupManager->setupForUser()
#13 /var/www/nextcloud/lib/private/Files/Utils/Scanner.php(115): OC_Util::setupFS()
#14 /var/www/nextcloud/lib/private/Files/Utils/Scanner.php(200): OC\Files\Utils\Scanner->getMounts()
#15 /var/www/nextcloud/apps/files/lib/Command/Scan.php(180): OC\Files\Utils\Scanner->scan()
#16 /var/www/nextcloud/apps/files/lib/Command/Scan.php(241): OCA\Files\Command\Scan->scanFiles()
#17 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(298): OCA\Files\Command\Scan->execute()
#18 /var/www/nextcloud/core/Command/Base.php(177): Symfony\Component\Console\Command\Command->run()
#19 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1040): OC\Core\Command\Base->run()
#20 /var/www/nextcloud/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#21 /var/www/nextcloud/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#22 /var/www/nextcloud/lib/private/Console/Application.php(206): Symfony\Component\Console\Application->run()
#23 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#24 /var/www/nextcloud/occ(11): require_once('...')
#25 {main}

+---------+-------+-----+---------+---------+--------+--------------+
| Folders | Files | New | Updated | Removed | Errors | Elapsed time |
+---------+-------+-----+---------+---------+--------+--------------+
| 0       | 0     | 0   | 0       | 0       | 3      | 00:00:00     |
+---------+-------+-----+---------+---------+--------+--------------+

@Aleks Pourrais-tu regarder mon problème STP ?

@jarod5001

Quand je fais cette commande j’ai un message d’erreur de pointage sur php7.4 au lieu de php8.2

This version of Nextcloud requires at least PHP 8.0<br/>You are currently running 7.4.33. Please update your PHP version.root@sphd:/var/www/nextcloud#

Pourtant quand j’arrive à redémarrer mon serveur Nextcloud et que je regarde dans Paramètres d’administration/système j’ai l’indication que Nextcloud utilise php8.2

`
sudo -i

cd /var/www/nextcloud

sudo -u nextcloud php8.2 --define apc.enable_cli=1 occ files:scan -vv --all`

@jarod5001
J’ai exécuté vos commandes mais il semble que quelque chose soit corrompue

root@sphd:~# cd /var/www/nextcloud
root@sphd:/var/www/nextcloud# sudo -u nextcloud php8.2 --define apc.enable_cli=1 occ files:scan -vv --all
Starting scan for user 1 out of 3 (adminyunohost)
        Folder  /adminyunohost/
        Folder  /adminyunohost/files
        File    /adminyunohost/files/Nextcloud.png
        File    /adminyunohost/files/Nextcloud Manual.pdf
        File    /adminyunohost/files/Readme.md
        File    /adminyunohost/files/Templates credits.md
        File    /adminyunohost/files/Reasons to use Nextcloud.pdf
        File    /adminyunohost/files/Nextcloud intro.mp4
        Folder  /adminyunohost/files/Documents
        File    /adminyunohost/files/Documents/Example.md
        File    /adminyunohost/files/Documents/Nextcloud flyer.pdf
        File    /adminyunohost/files/Documents/Readme.md
        File    /adminyunohost/files/Documents/Welcome to Nextcloud Hub.docx
        Folder  /adminyunohost/files/Photos
        File    /adminyunohost/files/Photos/Toucan.jpg
        File    /adminyunohost/files/Photos/Birdie.jpg
        File    /adminyunohost/files/Photos/Nextcloud community.jpg
        File    /adminyunohost/files/Photos/Vineyard.jpg
        File    /adminyunohost/files/Photos/Steps.jpg
        File    /adminyunohost/files/Photos/Library.jpg
        File    /adminyunohost/files/Photos/Gorilla.jpg
        File    /adminyunohost/files/Photos/Readme.md
        File    /adminyunohost/files/Photos/Frog.jpg
        Folder  /adminyunohost/cache
        Folder  /adminyunohost/files_trashbin
        Folder  /adminyunohost/files_trashbin/versions
        Folder  /adminyunohost/files_trashbin/files
        Folder  /adminyunohost/files_trashbin/files/Modèles.d1691656298
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Party invitation.odt
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Timesheet.ods
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Syllabus.odt
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Mother's day.odt
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Impact effort matrix.whiteboard
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Org chart.odg
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Flowchart.odg
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Photo book.odt
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Mindmap.odg
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Gotong royong.odp
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Letter.odt
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Modern company.odp
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Meeting notes.md
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Diagram & table.ods
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Elegant.odp
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Business model canvas.ods
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Simple.odp
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Invoice.odt
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Product plan.md
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Yellow idea.odp
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Readme.md
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/SWOT analysis.whiteboard
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Resume.odt
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Expense report.ods
        File    /adminyunohost/files_trashbin/files/Modèles.d1691656298/Business model canvas.odg
        Folder  /adminyunohost/files_trashbin/keys
        Folder  /adminyunohost/files/Home/
        File    /adminyunohost/files/Home/.bashrc
        File    /adminyunohost/files/Home/.bash_logout
        File    /adminyunohost/files/Home/.profile
        File    /adminyunohost/files/Home/.bash_history
        Folder  /adminyunohost/files/Home/.local
        Folder  /adminyunohost/files/Home/.local/share
Error during scan: opendir(/home/adminyunohost/.local/share): Failed to open directory: Permission denied
#0 /var/www/nextcloud/apps/files/lib/Command/Scan.php(268): OCA\Files\Command\Scan->exceptionErrorHandler()
#1 [internal function]: OCA\Files\Command\Scan->OCA\Files\Command\{closure}()
#2 /var/www/nextcloud/lib/private/Files/Storage/Local.php(164): opendir()
#3 /var/www/nextcloud/lib/private/Files/Storage/Common.php(896): OC\Files\Storage\Local->opendir()
#4 [internal function]: OC\Files\Storage\Common->getDirectoryContent()
#5 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(427): iterator_to_array()
#6 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(397): OC\Files\Cache\Scanner->handleChildren()
#7 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(400): OC\Files\Cache\Scanner->scanChildren()
#8 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(400): OC\Files\Cache\Scanner->scanChildren()
#9 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(347): OC\Files\Cache\Scanner->scanChildren()
#10 /var/www/nextcloud/lib/private/Files/Utils/Scanner.php(273): OC\Files\Cache\Scanner->scan()
#11 /var/www/nextcloud/apps/files/lib/Command/Scan.php(180): OC\Files\Utils\Scanner->scan()
#12 /var/www/nextcloud/apps/files/lib/Command/Scan.php(241): OCA\Files\Command\Scan->scanFiles()
#13 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(298): OCA\Files\Command\Scan->execute()
#14 /var/www/nextcloud/core/Command/Base.php(177): Symfony\Component\Console\Command\Command->run()
#15 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1040): OC\Core\Command\Base->run()
#16 /var/www/nextcloud/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#17 /var/www/nextcloud/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#18 /var/www/nextcloud/lib/private/Console/Application.php(206): Symfony\Component\Console\Application->run()
#19 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#20 /var/www/nextcloud/occ(11): require_once('...')
#21 {main}
        Folder  /adminyunohost/files/Home/Multimedia
        Folder  /adminyunohost/files/Home/Multimedia/Picture
        Folder  /adminyunohost/files/Home/Multimedia/Music
        Folder  /adminyunohost/files/Home/Multimedia/eBook
        Folder  /adminyunohost/files/Home/Multimedia/Share
        Folder  /adminyunohost/files/Home/Multimedia/Share/Picture
        Folder  /adminyunohost/files/Home/Multimedia/Share/Music
        Folder  /adminyunohost/files/Home/Multimedia/Share/eBook
        Folder  /adminyunohost/files/Home/Multimedia/Share/Video
        Folder  /adminyunohost/files/Home/Multimedia/Video
        Folder  /adminyunohost/files/Home/media
        Folder  /adminyunohost/files/Séverine/
        File    /adminyunohost/files/Séverine/Repertoire.ini
        File    /adminyunohost/files/Séverine/Galaxy_Orientation_2021.exe
        Folder  /adminyunohost/files/Séverine/Perso
        Folder  /adminyunohost/files/Séverine/Perso/Appartement Jean de la Varende
Exception during scan: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1938): Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1880): Doctrine\DBAL\Connection->handleDriverException()
#2 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1105): Doctrine\DBAL\Connection->convertExceptionDuringQuery()
#3 /var/www/nextcloud/lib/private/DB/Connection.php(261): Doctrine\DBAL\Connection->executeQuery()
#4 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(337): OC\DB\Connection->executeQuery()
#5 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(377): Doctrine\DBAL\Query\QueryBuilder->executeQuery()
#6 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(280): Doctrine\DBAL\Query\QueryBuilder->execute()
#7 /var/www/nextcloud/lib/private/Files/Cache/Cache.php(248): OC\DB\QueryBuilder\QueryBuilder->execute()
#8 /var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php(120): OC\Files\Cache\Cache->getFolderContentsById()
#9 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(373): OC\Files\Cache\Wrapper\CacheWrapper->getFolderContentsById()
#10 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(426): OC\Files\Cache\Scanner->getExistingChildren()
#11 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(397): OC\Files\Cache\Scanner->handleChildren()
#12 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(400): OC\Files\Cache\Scanner->scanChildren()
#13 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(400): OC\Files\Cache\Scanner->scanChildren()
#14 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(347): OC\Files\Cache\Scanner->scanChildren()
#15 /var/www/nextcloud/lib/private/Files/Utils/Scanner.php(273): OC\Files\Cache\Scanner->scan()
#16 /var/www/nextcloud/apps/files/lib/Command/Scan.php(180): OC\Files\Utils\Scanner->scan()
#17 /var/www/nextcloud/apps/files/lib/Command/Scan.php(241): OCA\Files\Command\Scan->scanFiles()
#18 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(298): OCA\Files\Command\Scan->execute()
#19 /var/www/nextcloud/core/Command/Base.php(177): Symfony\Component\Console\Command\Command->run()
#20 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1040): OC\Core\Command\Base->run()
#21 /var/www/nextcloud/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#22 /var/www/nextcloud/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#23 /var/www/nextcloud/lib/private/Console/Application.php(206): Symfony\Component\Console\Application->run()
#24 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#25 /var/www/nextcloud/occ(11): require_once('...')
#26 {main}


In Connection.php line 139:

  [Doctrine\DBAL\Exception (2002)]
  Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused


Exception trace:
  at /var/www/nextcloud/lib/private/DB/Connection.php:139
 OC\DB\Connection->connect() at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php:1654
 Doctrine\DBAL\Connection->getWrappedConnection() at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php:1081
 Doctrine\DBAL\Connection->executeQuery() at /var/www/nextcloud/lib/private/DB/Connection.php:261
 OC\DB\Connection->executeQuery() at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php:337
 Doctrine\DBAL\Query\QueryBuilder->executeQuery() at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php:377
 Doctrine\DBAL\Query\QueryBuilder->execute() at /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php:280
 OC\DB\QueryBuilder\QueryBuilder->execute() at /var/www/nextcloud/lib/private/User/Database.php:392
 OC\User\Database->loadUser() at /var/www/nextcloud/lib/private/User/Database.php:438
 OC\User\Database->userExists() at /var/www/nextcloud/lib/private/User/Manager.php:179
 OC\User\Manager->get() at /var/www/nextcloud/lib/private/User/Manager.php:223
 OC\User\Manager->userExists() at /var/www/nextcloud/apps/files/lib/Command/Scan.php:239
 OCA\Files\Command\Scan->execute() at /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at /var/www/nextcloud/core/Command/Base.php:177
 OC\Core\Command\Base->run() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:1040
 Symfony\Component\Console\Application->doRunCommand() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:301
 Symfony\Component\Console\Application->doRun() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at /var/www/nextcloud/lib/private/Console/Application.php:206
 OC\Console\Application->run() at /var/www/nextcloud/console.php:100
 require_once() at /var/www/nextcloud/occ:11

files:scan [--output [OUTPUT]] [-p|--path PATH] [--generate-metadata [GENERATE-METADATA]] [--all] [--unscanned] [--shallow] [--home-only] [--] [<user_id>...]

Ok so let’s
ls -la /home/adminyunohost/.local
to see why is the permission denied

@jarod5001

root@sphd:~# ls -la /home/adminyunohost/.local
total 12
drwxr-xr-x  3 adminyunohost adminyunohost 4096 Aug  9 21:50 .
drwxrwxr-x+ 3 adminyunohost adminyunohost 4096 Aug 10 08:07 ..
drwx------  3 adminyunohost adminyunohost 4096 Aug  9 21:50 share
root@sphd:~#

Je ne suis pas sûr de comprendre pourquoi il cherche à analyser cet emplacement.
Essai
sudo -u nextcloud php8.2 --define apc.enable_cli=1 occ files:scan -vv --home-only

Please specify the user id to scan, --all to scan for all users or --path=...

Ah oui, il faut ajouter à la fin de la commande le nom d’utilisateur qui est adminyunohost
Sinon t’as vérifié ce qu’il y a dans le dossier /home/adminyunohost/.local/share

sudo ls -la /home/adminyunohost/.local/share
S’il est vide (ou contient un dossier nano), on peut le supprimer

rm -rf /home/adminyunohost/.local/share
et réessayer le scan all

root@sphd:~# sudo ls -la /home/adminyunohost/.local/share
total 12
drwx------ 3 adminyunohost adminyunohost 4096 Aug  9 21:50 .
drwxr-xr-x 3 adminyunohost adminyunohost 4096 Aug  9 21:50 ..
drwx------ 2 adminyunohost adminyunohost 4096 Aug  9 21:50 nano
root@sphd:~#

Je passe la commande suivante ?

rm -rf /home/adminyunohost/.local/share