Nextcloud does not upgrade 29.0 -> 31.0

What app is this about, and its version: Nextcloud (nextcloud) de 29.0.8~ynh1 à 31.0.9~ynh2
What YunoHost version are you running: 12.1.27 (stable)
What type of hardware are you using: VPS bought online

Describe your issue

Issue description in English, but I’m French… N’hésitez pas à répondre en Français si besoin !

I upgraded my server. I knew Nextcloud had issue upgrading because of Breezedark theme. I finally dis-activated it since I thought that this theme plugin looks abandoned.

And now the server is not available, it is telling me:

Votre répertoire des données n’est pas valide.

Assurez-vous que le répertoire de données contient un fichier “.ocdata” à sa racine.

Anyway I tried multiples times, and also upgraded the nextcloud’s plugins and disabled Breezedark theme.

Share relevant logs or error messages

They appears in 2 part (both failed with a :x: each time).

Oldest I still have access to:

Latest:

Hello
Before upgrade, did you check that all your nextcloud addons were compatible with nextcloud v31?
You van verify at https://apps.nextcloud.com/

No I did not. I discovered by doing the upgrade that “Breezedark” is not compatible. So I dis-activated it.

And now Nextcloud does not start (or arrive in a good shape) anymore.

Bonsoir @Zykino

Les logs suivants semblent indiquer que le nextcloud est en mode maintenance avec un nombre de commandes limitées mais le script yunhost s’attends à recevoir la list des applications en cours.

2025-10-08 23:54:38,260: DEBUG - +++ filter_boring_occ_warnings
2025-10-08 23:54:38,260: DEBUG - ++ ynh_exec_as_app php8.2 --define apc.enable_cli=1 occ --no-interaction --no-ansi app:list --output json
2025-10-08 23:54:38,260: DEBUG - +++ sed -E 's@\s*([0-9]+\/[0-9]+\s+\[(-|>|=)+\]\s+[0-9]+%|\s*Starting ...|Nextcloud or one of the apps require upgrade - only a limited number of commands are available|You may use your browser or the occ upgrade command to do the upgrade)@@g'
2025-10-08 23:54:38,261: DEBUG - ++ sudo -u nextcloud env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games COREPACK_ENABLE_DOWNLOAD_PROMPT=0 php8.2 --define apc.enable_cli=1 occ --no-interaction --no-ansi app:list --output json
2025-10-08 23:54:38,873: WARNING - parse error: Invalid numeric literal at line 1, column 5
2025-10-08 23:54:38,891: DEBUG - ++ curl -s https://raw.githubusercontent.com/nextcloud/server/v29.0.8/core/shipped.json

Il faut se connecter en ssh sur l’équipement avec le compte administrateur.

puis

cette commande devrait renvoyer les applications en cours

sudo -u nextcloud php8.2 --define apc.enable_cli=1 /var/www/nextcloud/occ --no-ansi app:list --output json

selon son résultat

on peut tenter desactiver le mode maintenance pour repartir en mode operationnel avec

sudo -u nextcloud php8.2 --define apc.enable_cli=1 /var/www/nextcloud/occ maintenance:mode --off

Bonsoir @artlog,

Ça s’annonce mal :cry:

Could not open input file: occ

Et ce que j’utilise php ou php8.2. J’ai essayé au cas où vue qu’apparemment j’ai déjà utilisé occ pour file:scan ou upgrade il y a longtemps.

En suivant la commande d’Aleks trouvée ici : Impossible d'utiliser la commande occ - #2 by Aleks yunohost app shell nextcloud je peux exécuter les commandes mais l’erreur se transforme.

Est-ce que je tente de touch /home/yunohost.app/nextcloud/data/.ocdata puis je relance tes commandes ? Ou c’est peut-être un autre dossier ? Ou il faut pas faire ça ?

nextcloud@Aiden:~$ php8.2 --define apc.enable_cli=1 occ --no-interaction --no-ansi app:list --output json
Your data directory is invalid.
Ensure there is a file called ".ocdata" in the root of the data directory.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:167
Stack trace:
#0 /var/www/nextcloud/console.php(101): OC\Console\Application->loadCommands()
#1 /var/www/nextcloud/occ(11): require_once('...')
#2 {main}nextcloud@Aiden:~$
nextcloud@Aiden:~$
nextcloud@Aiden:~$ php8.2 --define apc.enable_cli=1 occ maintenance:mode --off
Your data directory is invalid.
Ensure there is a file called ".ocdata" in the root of the data directory.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:167
Stack trace:
#0 /var/www/nextcloud/console.php(101): OC\Console\Application->loadCommands()
#1 /var/www/nextcloud/occ(11): require_once('...')
#2 {main}nextcloud@Aiden:~$

@Zykino

Il faut comprendre où nextcloud que son répertoire de données est parce le .ocdata manquant cela fait penser que ce n’est pas le bon répertoire.

(edit install_dir de nextcloud n’est pas ce que je crois :wink: )

yunohost app shell nextcloud

Que contient config/config.php ? ( si copie/paste attention aux mots de passes divers ).

Qu’y a t’il sous /home/yunohost.app/nextcloud/data/. actuellement ?

Je… vais pas risquer de mettre tout config/config.php. mais je pense que c’est cette ligne qui est intéressante ?

‘datadirectory’ => ‘/home/yunohost.app/nextcloud/data’,

ls /home/yunohost.app/nextcloud/data/
appdata_ocb2vqnqshr3  files_external  gpxpod  index.html  news  rainloop-storage  svc_wikijs_ldap [user’s folders]

Did you try to create it? touch /home/yunohost.app/nextcloud/data/.ocdata from the nextcloud shell

$ touch /home/yunohost.app/nextcloud/data/.ocdata

$ php --define apc.enable_cli=1 /var/www/nextcloud/occ --no-ansi app:list --output json
{"enabled":{"activity":"2.21.1","calendar":"4.7.19","circles":"29.0.0-dev","cloud_federation_api":"1.12.0","comments":"1.19.0","contacts":"6.0.6","contactsinteraction":"1.10.0","cookbook":"0.11.4","dashboard":"7.9.0","dav":"1.30.1","deck":"1.13.6","drawio":"3.0.9","federatedfilesharing":"1.19.0","federation":"1.19.0","files":"2.1.1","files_downloadlimit":"2.0.0","files_external":"1.21.0","files_pdfviewer":"2.10.0","files_reminders":"1.2.0","files_sharing":"1.21.0","files_trashbin":"1.19.0","files_versions":"1.22.0","firstrunwizard":"2.18.0","flow_notifications":"1.9.0","logreader":"2.14.0","lookup_server_connector":"1.17.0","mail":"3.7.24","metadata":"0.22.0","music":"2.4.0","nextcloud_announcements":"1.18.0","notes":"4.12.3","notifications":"2.17.0","notify_push":"1.2.0","oauth2":"1.17.1","password_policy":"1.19.0","photos":"2.5.0","privacy":"1.13.0","provisioning_api":"1.19.0","recommendations":"2.1.0","related_resources":"1.4.0","serverinfo":"1.19.0","settings":"1.12.0","sharebymail":"1.19.0","support":"1.12.0","survey_client":"1.17.0","systemtags":"1.19.0","tasks":"0.16.1","text":"3.10.1","theming":"2.4.0","twofactor_backupcodes":"1.18.0","user_ldap":"1.20.0","user_status":"1.9.0","viewer":"2.3.0","weather_status":"1.9.0","workflow_script":"1.14.1","workflowengine":"2.11.0"},"disabled":{"accessibility":"1.10.0","admin_audit":"1.19.0","breezedark":"29.0.0 (installed 29.0.0)","bruteforcesettings":"2.9.0","encryption":"2.17.0 (installed 2.17.0)","files_rightclick":"1.6.0 (installed 1.6.0)","files_videoplayer":"1.13.0","news":"25.3.1 (installed 25.3.1)","spreed":"19.0.15 (installed 19.0.15)","suspicious_login":"7.0.0","talk_matterbridge":"1.31.1026000 (installed 1.31.1026000)","twofactor_totp":"11.0.0-dev","updatenotification":"1.19.1 (installed 1.14.0)"}}

Nextcloud homepage becomes :

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

Tried to do an update and got : https://paste.yunohost.org/raw/gihepeqova
(And back to square 1 for nextcloud in maintenance mode.)

So I suppose that being able to de-activate the mail app and try again, maybe this will work?

yes

app shell nextcloud

php --define apc.enable_cli=1 /var/www/nextcloud/occ app:remove mail

oui remove, pas disable, qui ne sera peut être pas suffisant.

Did you try to update apps php occ app:update

No I did not tried that… even if I had used the commands years ago. I forgot this evening.

It is not a problem for me I barely used the mail app (even most apps to be honest…), I prefer to check yunohost’s mail from thunderbird.

This works !

If only the image was true… or maybe it is but only for some apps and not the 2 offending ones?

Anyway I’m cleaning the installed apps right now. I suspect I can only disable but not remove Nextcloud base/“En Vedette” apps right?