nextcloud / nextcloudpi

📦 Build code for NextcloudPi: Raspberry Pi, Odroid, Rock64, curl installer...
https://nextcloudpi.com
2.53k stars 296 forks source link

Updating fails with: Unit ncp-update-nc.service was already loaded or has a fragment file #1992

Open janvlug opened 1 week ago

janvlug commented 1 week ago

When trying to run nc-update-nextcloud from the web interface, I get:

[ nc-update-nextcloud ] (Thu Oct 10 15:35:20 BST 2024)
Failed to start transient service unit: Unit ncp-update-nc.service was already loaded or has a fragment file.

Image

System information

NextcloudPi diagnostics ``` NextcloudPi version v1.55.2 NextcloudPi image NextCloudPi_RaspberryPi_v1.51.3.img OS Debian GNU/Linux 12. 6.1.21-v8+ (aarch64) automount yes USB devices sda datadir /media/nextcloudpi_data/ncdata/data data in SD no data filesystem btrfs data disk usage 2.7T/5.3T rootfs usage 7.4G/59G swapfile /var/swap dbdir /media/USBdrive/ncdatabase Nextcloud check ok Nextcloud version 29.0.7.1 HTTPD service up PHP service up MariaDB service up Redis service up HPB service up Postfix service up Internet check ok Public IPv4 ***REMOVED SENSITIVE VALUE*** Public IPv6 ***REMOVED SENSITIVE VALUE*** Port 80 open Port 443 open IP ***REMOVED SENSITIVE VALUE*** Gateway ***REMOVED SENSITIVE VALUE*** Interface eth0 Certificates ***REMOVED SENSITIVE VALUE*** NAT loopback no Uptime 31days ```
Nextcloud configuration ``` { "system": { "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": { "0": "localhost", "7": "nextcloudpi", "5": "nextcloudpi.local", "8": "nextcloudpi.lan", "3": "vlug.info", "11": "redacted", "1": "192.168.178.15", "2": "redacted.com", "14": "nextcloudpi" }, "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "29.0.7.1", "overwrite.cli.url": "https:\/\/vlug.info\/", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "instanceid": "***REMOVED SENSITIVE VALUE***", "memcache.local": "\\OC\\Memcache\\Redis", "memcache.locking": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 0, "timeout": 0, "password": "***REMOVED SENSITIVE VALUE***" }, "tempdirectory": "\/media\/nextcloudpi_data\/ncdata\/data\/tmp", "mail_smtpmode": "smtp", "mail_smtpauthtype": "LOGIN", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "preview_max_x": "2048", "preview_max_y": "2048", "jpeg_quality": "60", "overwriteprotocol": "https", "maintenance": false, "logfile": "\/media\/nextcloudpi_data\/ncdata\/data\/nextcloud.log", "trusted_proxies": "***REMOVED SENSITIVE VALUE***", "loglevel": "2", "log_type": "file", "mysql.utf8mb4": true, "theme": "", "data-fingerprint": "1ffbe802b84316f94db84dfd10411753", "mail_sendmailmode": "smtp", "mail_smtpsecure": "ssl", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "465", "mail_smtpauth": 1, "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "maintenance_window_start": 3 } } ```
HTTPd logs ``` [Thu Oct 10 15:32:00.846834 2024] [authz_host:error] [pid 4182203:tid 4182214] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /img/nc-button.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi.local:4443/css/ncp.css [Thu Oct 10 15:32:00.874916 2024] [authz_host:error] [pid 4182203:tid 4182208] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /ncp-output.php failed, reason: unable to get the remote host name [Thu Oct 10 15:32:00.885704 2024] [authz_host:error] [pid 4182203:tid 4182223] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name [Thu Oct 10 15:32:00.887550 2024] [authz_host:error] [pid 4182203:tid 4182226] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /img/settings-white.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi.local:4443/css/ncp.css [Thu Oct 10 15:32:01.329221 2024] [authz_host:error] [pid 4182203:tid 4182215] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /img/favicon.png failed, reason: unable to get the remote host name [Thu Oct 10 15:32:01.518966 2024] [authz_host:error] [pid 4182203:tid 4182215] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /img/favicon.png failed, reason: unable to get the remote host name [Thu Oct 10 15:32:19.196581 2024] [authz_host:error] [pid 4182203:tid 4182206] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name [Thu Oct 10 15:32:19.421464 2024] [authz_host:error] [pid 4182203:tid 4182206] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name [Thu Oct 10 15:32:20.232754 2024] [authz_host:error] [pid 4182203:tid 4182218] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name [Thu Oct 10 15:32:20.237969 2024] [authz_host:error] [pid 4182203:tid 4182224] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /img/download.svg failed, reason: unable to get the remote host name [Thu Oct 10 15:32:20.242142 2024] [authz_host:error] [pid 4182203:tid 4182216] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /img/delete.svg failed, reason: unable to get the remote host name [Thu Oct 10 15:32:20.457154 2024] [authz_host:error] [pid 4182203:tid 4182216] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /img/delete.svg failed, reason: unable to get the remote host name [Thu Oct 10 15:32:20.462392 2024] [authz_host:error] [pid 4182203:tid 4182224] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /img/download.svg failed, reason: unable to get the remote host name [Thu Oct 10 15:32:20.503987 2024] [authz_host:error] [pid 4182203:tid 4182218] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name [Thu Oct 10 15:32:34.718474 2024] [authz_host:error] [pid 4182203:tid 4182222] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /img/info.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi.local:4443/css/ncp.css [Thu Oct 10 15:32:34.896784 2024] [authz_host:error] [pid 4182203:tid 4182222] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /img/info.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi.local:4443/css/ncp.css [Thu Oct 10 15:32:36.491862 2024] [authz_host:error] [pid 4182203:tid 4182220] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name [Thu Oct 10 15:32:36.670225 2024] [authz_host:error] [pid 4182203:tid 4182220] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name [Thu Oct 10 15:35:23.872085 2024] [authz_host:error] [pid 4182203:tid 4182224] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /img/red-circle.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi.local:4443/css/ncp.css [Thu Oct 10 15:35:24.049089 2024] [authz_host:error] [pid 4182203:tid 4182224] [remote 192.168.178.38:50720] AH01753: access check of 'localhost' to /img/red-circle.svg failed, reason: unable to get the remote host name, referer: https://nextcloudpi.local:4443/css/ncp.css ```
Database logs ``` tail: cannot open '/var/log/mysql/*.log' for reading: No such file or directory ```
Nextcloud logs ``` {"reqId":"Zwd7Qr5B2IfMLiXbU9LRWwAAhgU","level":2,"time":"2024-10-10T06:59:25+00:00","remoteAddr":"86.85.119.40","user":"--","app":"core","method":"OPTIONS","url":"/remote.php/webdav","message":"Login failed: 'janjr' (Remote IP: '86.85.119.40')","userAgent":"gnome-online-accounts/3.50.2 libsoup/3.4.4","version":"29.0.7.1","data":{"app":"core"}} {"reqId":"Zwd7pkF004GB1JTmWQEqBQAAAAs","level":3,"time":"2024-10-10T07:00:54+00:00","remoteAddr":"86.85.119.40","user":"janjr","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/user_status/api/v1/user_status?format=json","message":"unlink(/media/nextcloudpi_data/ncdata/data/appdata_ocrrxqnhospw/richdocuments/remoteData/discovery): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#348","userAgent":"Mozilla/5.0 (Linux) mirall/3.13.2git (Nextcloud, fedora-6.10.6-200.fc40.x86_64 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"29.0.7.1","data":{"app":"PHP"}} {"reqId":"Zwd7pjkzU1KAwEmsJrd2mQAAAFY","level":3,"time":"2024-10-10T07:00:54+00:00","remoteAddr":"86.85.119.40","user":"janjr","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications?format=json","message":"unlink(/media/nextcloudpi_data/ncdata/data/appdata_ocrrxqnhospw/richdocuments/remoteData/capabilities): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#348","userAgent":"Mozilla/5.0 (Linux) mirall/3.13.2git (Nextcloud, fedora-6.10.6-200.fc40.x86_64 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"29.0.7.1","data":{"app":"PHP"}} {"reqId":"Zwd74jkzU1KAwEmsJrd2oAAAAFI","level":3,"time":"2024-10-10T07:01:54+00:00","remoteAddr":"86.85.119.40","user":"janjr","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/user_status/api/v1/user_status?format=json","message":"unlink(/media/nextcloudpi_data/ncdata/data/appdata_ocrrxqnhospw/richdocuments/remoteData/discovery): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#348","userAgent":"Mozilla/5.0 (Linux) mirall/3.13.2git (Nextcloud, fedora-6.10.6-200.fc40.x86_64 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"29.0.7.1","data":{"app":"PHP"}} {"reqId":"Zwd74jkzU1KAwEmsJrd2oAAAAFI","level":3,"time":"2024-10-10T07:01:54+00:00","remoteAddr":"86.85.119.40","user":"janjr","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/user_status/api/v1/user_status?format=json","message":"unlink(/media/nextcloudpi_data/ncdata/data/appdata_ocrrxqnhospw/richdocuments/remoteData/capabilities): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#348","userAgent":"Mozilla/5.0 (Linux) mirall/3.13.2git (Nextcloud, fedora-6.10.6-200.fc40.x86_64 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"29.0.7.1","data":{"app":"PHP"}} {"reqId":"Zwe-Abbyv0oLXdIlKJk5WQAAABI","level":3,"time":"2024-10-10T11:44:01+00:00","remoteAddr":"178.79.139.171","user":"--","app":"PHP","method":"GET","url":"/nmaplowercheck1728560641","message":"file_get_contents(/media/nextcloudpi_data/ncdata/data/appdata_ocrrxqnhospw/richdocuments/remoteData/capabilities): Failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#331","userAgent":"curl/7.54.0","version":"29.0.7.1","data":{"app":"PHP"}} {"reqId":"Zwe-Abbyv0oLXdIlKJk5WQAAABI","level":3,"time":"2024-10-10T11:44:01+00:00","remoteAddr":"178.79.139.171","user":"--","app":"index","method":"GET","url":"/nmaplowercheck1728560641","message":"Exception thrown: OCP\\Files\\GenericFileException","userAgent":"curl/7.54.0","version":"29.0.7.1","exception":{"Exception":"OCP\\Files\\GenericFileException","Message":"","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFile.php","line":74,"function":"getContent","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/var/www/nextcloud/apps/richdocuments/lib/Service/CachedRequestService.php","line":47,"function":"getContent","class":"OC\\Files\\SimpleFS\\SimpleFile","type":"->"},{"file":"/var/www/nextcloud/apps/richdocuments/lib/Service/CapabilitiesService.php","line":147,"function":"get","class":"OCA\\Richdocuments\\Service\\CachedRequestService","type":"->"},{"file":"/var/www/nextcloud/apps/richdocuments/lib/Service/CapabilitiesService.php","line":63,"function":"getParsedCapabilities","class":"OCA\\Richdocuments\\Service\\CapabilitiesService","type":"->"},{"file":"/var/www/nextcloud/apps/richdocuments/lib/Service/CapabilitiesService.php","line":91,"function":"getCapabilities","class":"OCA\\Richdocuments\\Service\\CapabilitiesService","type":"->"},{"file":"/var/www/nextcloud/apps/richdocuments/lib/Capabilities.php","line":133,"function":"hasDrawSupport","class":"OCA\\Richdocuments\\Service\\CapabilitiesService","type":"->"},{"file":"/var/www/nextcloud/lib/private/CapabilitiesManager.php","line":74,"function":"getCapabilities","class":"OCA\\Richdocuments\\Capabilities","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/JSConfigHelper.php","line":157,"function":"getCapabilities","class":"OC\\CapabilitiesManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/TemplateLayout.php","line":266,"function":"getConfig","class":"OC\\Template\\JSConfigHelper","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":145,"function":"__construct","class":"OC\\TemplateLayout","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":859,"function":"printPage","class":"OC\\Template\\Base","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":1189,"function":"init","class":"OC","type":"::"},{"file":"/var/www/nextcloud/index.php","line":47,"args":["/var/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Files/Node/File.php","Line":56,"message":"","exception":{},"CustomMessage":"Exception thrown: OCP\\Files\\GenericFileException"}} ```
geoW-n commented 1 week ago

You can fix it on cli:

janvlug commented 1 week ago

Thanks. The instructions above worked.

For interested people, first I did this on the command line:

``` jan@nextcloudpi:~ $ sudo systemctl status ncp-update-nc.service [sudo] password for jan: × ncp-update-nc.service - /usr/bin/bash -c set -o pipefail; DBG='' /usr/local/bin/ncp-update-nc.d/update-nc.sh '0' |& tee /var/log/ncp-update-nc.log Loaded: loaded (/run/systemd/transient/ncp-update-nc.service; transient) Transient: yes Active: failed (Result: exit-code) since Sun 2024-10-06 20:20:30 BST; 5 days ago Duration: 4.703s Main PID: 2661529 (code=exited, status=1/FAILURE) CPU: 4.453s Oct 06 20:20:29 nextcloudpi bash[2661531]: Dload Upload Total Spent Left Speed Oct 06 20:20:30 nextcloudpi bash[2661531]: [237B blob data] Oct 06 20:20:30 nextcloudpi bash[2661531]: Nextcloud version 29.0.7 is already installed. Nothing to do. Oct 06 20:20:30 nextcloudpi systemd[1]: ncp-update-nc.service: Main process exited, code=exited, status=1/FAILURE Oct 06 20:20:30 nextcloudpi systemd[1]: ncp-update-nc.service: Failed with result 'exit-code'. Oct 06 20:20:30 nextcloudpi systemd[1]: ncp-update-nc.service: Consumed 4.453s CPU time. Oct 09 06:18:11 nextcloudpi systemd[1]: /run/systemd/transient/ncp-update-nc.service:7: Ignoring unknown escape sequences: "set -o pipefail\; DBG='' /usr/local/bin/ncp-update-nc.d/update-nc.sh '0' |& tee /var/log/ncp-update-nc.log" Oct 09 06:18:13 nextcloudpi systemd[1]: /run/systemd/transient/ncp-update-nc.service:7: Ignoring unknown escape sequences: "set -o pipefail\; DBG='' /usr/local/bin/ncp-update-nc.d/update-nc.sh '0' |& tee /var/log/ncp-update-nc.log" Oct 09 06:18:15 nextcloudpi systemd[1]: /run/systemd/transient/ncp-update-nc.service:7: Ignoring unknown escape sequences: "set -o pipefail\; DBG='' /usr/local/bin/ncp-update-nc.d/update-nc.sh '0' |& tee /var/log/ncp-update-nc.log" Oct 09 06:18:18 nextcloudpi systemd[1]: /run/systemd/transient/ncp-update-nc.service:7: Ignoring unknown escape sequences: "set -o pipefail\; DBG='' /usr/local/bin/ncp-update-nc.d/update-nc.sh '0' |& tee /var/log/ncp-update-nc.log" jan@nextcloudpi:~ $ sudo systemctl restart ncp-update-nc.service jan@nextcloudpi:~ $ sudo systemctl status ncp-update-nc.service Unit ncp-update-nc.service could not be found. ```

After that, I ran ncp_update_nextcloud in the web interface, and got this:

``` [ nc-update-nextcloud ] (Sat Oct 12 16:43:39 BST 2024) Running as unit: ncp-update-nc.service % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed Current Nextcloud version 29.0.7 Requested Nextcloud version latest Selected Nextcloud version 29.0.8 INFO: You have requested an update to 'latest', but a direct update to 'latest' cannot be performed, so the latest available version that can be updated to (29.0.8) has been selected automatically. Download Nextcloud 29.0.8... Back up current instance... check free space... Maintenance mode enabled backup database... backup files... backup /var/www/nextcloud-bkp_20241012_1728747864.tar.gz generated Maintenance mode disabled Storing backup at '/var/www/nextcloud-bkp_20241012_1728747864-29.0.7.tar.gz'... Install Nextcloud 29.0.8... Fix permissions... Upgrade... 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 Setting log level to debug Turned on maintenance mode Updating database schema Updated database Disabled incompatible app: announcementcenter Disabled incompatible app: calendar Disabled incompatible app: contacts Disabled incompatible app: deck Disabled incompatible app: mail Disabled incompatible app: maps Disabled incompatible app: notes Disabled incompatible app: notify_push Disabled incompatible app: richdocuments Disabled incompatible app: richdocumentscode_arm64 Disabled incompatible app: spreed Disabled incompatible app: tasks Add read permissions for existing announcements Starting ... 0/0 [>---------------------------] 0% Add read permissions for existing announcements Clean up... Nextcloud update finished successfully. ```

I'm not sure if there is still something that has to be fixed, or if this issue will not appear for others and can be closed. So I leave the issue open for now.

sebeweiss commented 19 hours ago

You can also reboot your server. I faced the same problem.