Erreur nginx suite à mise à jour Nextcloud

Bonjour,

J’ai voulu mettre à jour Nextcloud sur mon serveur Yunohost ce matin (bravo à l’équipe en passant, ça marche super depuis 7 ans !) et j’ai rencontré un problème : nginx refuse de démarrer avec l’erreur nginx: [emerg] duplicate location "/.well-known" in /etc/nginx/conf.d/monsite.d/nextcloud.conf:1

Mon serveur YunoHost

Matériel: VPS OVH
Version de YunoHost: 4.3.6.3
J’ai accès à mon serveur : En SSH et par la webadmin
Êtes-vous dans un contexte particulier ou avez-vous effectué des modificiations particulières sur votre instance ? : non
Si oui, expliquer:

Description du problème

Lors de la mise à jour de l’application Nextcloud par la moulinette, une erreur s’est produite. Voici les logs :

$ sudo yunohost app upgrade nextcloud
*Info : Mise à jour de nextcloud...
Info : [....................] > Loading installation settings...
Info : [+...................] > Ensuring downward compatibility...
Info : [#+++++++++..........] > Backing up the app before upgrading (may take a while)...
Info : [##########++........] > Upgrading dependencies...
Info : [############........] > Making sure dedicated system user exists...
Info : [############........] > Upgrading PHP-FPM configuration...
Info : [############+.......] > Upgrading NGINX web server configuration...
Info : The service nginx has correctly executed the action reload-or-restart.
Attention : Job for nginx.service failed.
Attention : See "systemctl status nginx.service" and "journalctl -xe" for details.
Attention : [Error] juil. 24 10:51:23 systemd[1]: Reloading A high performance web server and a reverse proxy server.
Attention : juil. 24 10:51:23 systemd[1]: Reloaded A high performance web server and a reverse proxy server.
Attention : juil. 24 10:51:24 systemd[1]: Reloading A high performance web server and a reverse proxy server.
Attention : juil. 24 10:51:24 systemd[1]: Reloaded A high performance web server and a reverse proxy server.
Attention : juil. 24 10:51:26 systemd[1]: Reloading A high performance web server and a reverse proxy server.
Attention : juil. 24 10:51:26 nginx[18876]: nginx: [emerg] duplicate location "/.well-known" in /etc/nginx/conf.d/monsite.d/nextcloud.conf:1
Attention : juil. 24 10:51:26 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Attention : juil. 24 10:51:26 systemd[1]: Reload failed for A high performance web server and a reverse proxy server.
Attention : [Error] Upgrade failed.
Attention : 29561 Load smb config files from /etc/samba/smb.conf
Attention : 29562 Loaded services file OK.
Attention : 29563 Server role: ROLE_STANDALONE
Attention : The app was restored to the way it was before the failed upgrade.
Erreur : Impossible de mettre à jour nextcloud : Une erreur s'est produite durant l'exécution du script de mise à niveau de l'application
Info : L'opération 'Mettre à jour l'application 'nextcloud'' a échoué ! Pour obtenir de l'aide, merci de partager le journal de l'opération en utilisant la commande 'yunohost log share 20220724-085052-app_upgrade-nextcloud'
Attention : Here's an extract of the logs before the crash. It might help debugging the error:
Info : DEBUG - juil. 24 10:51:24 systemd[1]: Reloading A high performance web server and a reverse proxy server.
Info : DEBUG - juil. 24 10:51:24 systemd[1]: Reloaded A high performance web server and a reverse proxy server.
Info : DEBUG - juil. 24 10:51:26 systemd[1]: Reloading A high performance web server and a reverse proxy server.
Info : DEBUG - juil. 24 10:51:26 nginx[18876]: nginx: [emerg] duplicate location "/.well-known" in /etc/nginx/conf.d/monsite.d/nextcloud.conf:1
Info : DEBUG - juil. 24 10:51:26 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Info : DEBUG - juil. 24 10:51:26 systemd[1]: Reload failed for A high performance web server and a reverse proxy server.'
Info : DEBUG - + echo -e '[Error] juil. 24 10:51:23 systemd[1]: Reloading A high performance web server and a reverse proxy server.
Info : DEBUG - juil. 24 10:51:23 systemd[1]: Reloaded A high performance web server and a reverse proxy server.
Info : DEBUG - juil. 24 10:51:24 systemd[1]: Reloading A high performance web server and a reverse proxy server.
Info : DEBUG - juil. 24 10:51:24 systemd[1]: Reloaded A high performance web server and a reverse proxy server.
Info : DEBUG - juil. 24 10:51:26 systemd[1]: Reloading A high performance web server and a reverse proxy server.
Info : DEBUG - juil. 24 10:51:26 nginx[18876]: nginx: [emerg] duplicate location "/.well-known" in /etc/nginx/conf.d/ld77.eu.d/nextcloud.conf:1
Info : DEBUG - juil. 24 10:51:26 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Info : DEBUG - juil. 24 10:51:26 systemd[1]: Reload failed for A high performance web server and a reverse proxy server.'
Info : DEBUG - + '[' -e /var/log/nginx/nginx.log ']'
Info : DEBUG - + ynh_clean_check_starting
Info : DEBUG - + '[' -n '' ']'
Info : DEBUG - + '[' -n '' ']'
Info : DEBUG - + return 1
Info : DEBUG - + ynh_exit_properly
Erreur : L'opération 'Mettre à jour l'application 'nextcloud'' a échoué !

Effectivement, dans le fichier /etc/nginx/conf.d/monsite.d/nextcloud.conf, j’ai 2 lignes avec .well-known :

  • location = /.well-known/carddav
  • location = /.well-known/caldav

.well-known est aussi déclaré dans les fichiers suivants :

  • /etc/nginx/conf.d/ld77.eu.d/letsencrypt.conf (location '.well-known')
  • /etc/nginx/conf.d/acme-challenge.conf.inc (location ^~ '/.well-known/acme-challenge/')
  • /etc/nginx/conf.d/monsite.conf (location ^~ '/.well-known/ynh-diagnosis/', location ^~ '/.well-known/autoconfig/mail/', location ^~ '/.well-known/autoconfig/mail/')

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.