Nextcloud installation on RPI5

What type of hardware are you using: Raspberry Pi 3, 4+
What YunoHost version are you running: 12.1.17.1
What app is this about: Nextcloud

Describe your issue

Dear YunoHost Community,
I am writing to you today to seek help with a severely frustrating and persistent issue on my Nextcloud installation. Despite numerous attempts at troubleshooting, I find myself in a constant loop of failures, and I’m hoping someone can provide a definitive solution.
The problem began during an app upgrade, which failed with the error “Failed to upgrade nextcloud: An error occurred inside the app upgrade script”. The logs pointed to a permissions issue: “Permission denied at /var/www/nextcloud/lib/private/Config.php#190”.
This initial failure started a complex and frustrating cycle of manual troubleshooting. My attempts to fix permissions on the config.php file using chown commands initially seemed to work, but subsequent efforts to repair the installation with sudo -u www-data php /var/www/nextcloud/occ maintenance:repair failed with a new set of errors: “Your data directory is invalid,” “Cannot write into ‘apps’ directory,” and “Cannot create ‘data’ directory”.
I also tried to fix core permissions with commands like chown -R yunohost.app:yunohost.app /home/yunohost.app and chown -R nextcloud:nextcloud /var/www/nextcloud, but these commands failed.
After deleting all my Nextcloud backups from the web interface to ensure a clean slate, I was still unable to resolve the issue. Reinstalling the app would lead me to a new set of problems. The server would present an “Internal Server Error” and send me to a “Hello” welcome page on every command. My logs showed a new Permission denied error on the PHP sessions directory (/var/lib/php/sessions), confirming that a core system permission was still broken.
Even when I was briefly able to access the admin panel, I saw critical warnings about job execution running 55 years ago and multiple errors in the logs dating back to September 1, 2025. This was particularly confusing, as I had performed a complete uninstall on September 8th. It seems the system keeps restoring an old, corrupted state from somewhere, even after all Nextcloud-specific backups were deleted.
The core issue appears to be a deep-rooted corruption of file and folder permissions that is preventing Nextcloud from performing even basic operations, including running its own occ commands. At one point, even the occ file itself seemed inaccessible or missing.
I am at a complete loss and feel like I am going in circles. The cycle of failed repairs, incomplete reinstalls, and persistent permission errors has made Nextcloud completely unusable. I am hoping someone can provide guidance on how to completely purge all Nextcloud files and configurations to allow for a truly fresh start.

Thank you for your time and assistance.

Best regards,

Share relevant logs or error messages

cat /var/log/nextcloud/nextcloud.log
{“reqId”:“d0AzaD71dK2u8VqQIVmM”,“level”:2,“time”:“2025-09-08T09:22:03+00:00”,“remoteAddr”:“MY IP”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/nextcloud/apps/dashboard/”,“message”:“session_start(): open(/var/lib/php/sessions/sess_4a3jdm2va1urcgsb7pthjgeus3, O_RDWR) failed: Permission denied (13) at /var/www/nextcloud/lib/private/Session/Internal.php#198”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0”,“version”:“31.0.8.1”,“data”:{“app”:“PHP”}}
{“reqId”:“d0AzaD71dK2u8VqQIVmM”,“level”:2,“time”:“2025-09-08T09:22:03+00:00”,“remoteAddr”:“MY IP”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/nextcloud/apps/dashboard/”,“message”:“session_start(): Failed to read session data: files (path: /var/lib/php/sessions) at /var/www/nextcloud/lib/private/Session/Internal.php#198”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0”,“version”:“31.0.8.1”,“data”:{“app”:“PHP”}}
{“reqId”:“d0AzaD71dK2u8VqQIVmM”,“level”:2,“time”:“2025-09-08T09:22:03+00:00”,“remoteAddr”:“MY IP”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/nextcloud/apps/dashboard/”,“message”:“session_start(): open(/var/lib/php/sessions/sess_rrfcnr6tsd64a1nhbfcuhj3umu, O_RDWR) failed: Permission denied (13) at /var/www/nextcloud/lib/private/Session/Internal.php#198”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0”,“version”:“31.0.8.1”,“data”:{“app”:“PHP”}}
{“reqId”:“d0AzaD71dK2u8VqQIVmM”,“level”:2,“time”:“2025-09-08T09:22:03+00:00”,“remoteAddr”:“MY IP”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/nextcloud/apps/dashboard/”,“message”:“session_start(): Failed to read session data: files (path: /var/lib/php/sessions) at /var/www/nextcloud/lib/private/Session/Internal.php#198”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0”,“version”:“31.0.8.1”,“data”:{“app”:“PHP”}}
{“reqId”:“U9dFqsvi1lBpat3hKocB”,“level”:2,“time”:“2025-09-08T09:22:04+00:00”,“remoteAddr”:“MY IP”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/nextcloud/index.php/apps/files/preview-service-worker.js”,“message”:“session_start(): open(/var/lib/php/sessions/sess_p31graakm91h3n0454kt0oen8t, O_RDWR) failed: Permission denied (13) at /var/www/nextcloud/lib/private/Session/Internal.php#198”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0”,“version”:“31.0.8.1”,“data”:{“app”:“PHP”}}
{“reqId”:“U9dFqsvi1lBpat3hKocB”,“level”:2,“time”:“2025-09-08T09:22:04+00:00”,“remoteAddr”:“MY IP”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/nextcloud/index.php/apps/files/preview-service-worker.js”,“message”:“session_start(): Failed to read session data: files (path: /var/lib/php/sessions) at /var/www/nextcloud/lib/private/Session/Internal.php#198”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0”,“version”:“31.0.8.1”,“data”:{“app”:“PHP”}}
{“reqId”:“U9dFqsvi1lBpat3hKocB”,“level”:2,“time”:“2025-09-08T09:22:04+00:00”,“remoteAddr”:“MY IP”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/nextcloud/index.php/apps/files/preview-service-worker.js”,“message”:“session_start(): open(/var/lib/php/sessions/sess_6ctqvibs2jn8rrb0gqhcfnvcjl, O_RDWR) failed: Permission denied (13) at /var/www/nextcloud/lib/private/Session/Internal.php#198”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0”,“version”:“31.0.8.1”,“data”:{“app”:“PHP”}}
{“reqId”:“U9dFqsvi1lBpat3hKocB”,“level”:2,“time”:“2025-09-08T09:22:04+00:00”,“remoteAddr”:“MY IP”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/nextcloud/index.php/apps/files/preview-service-worker.js”,“message”:“session_start(): Failed to read session data: files (path: /var/lib/php/sessions) at /var/www/nextcloud/lib/private/Session/Internal.php#198”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0”,“version”:“31.0.8.1”,“data”:{“app”:“PHP”}}
{“reqId”:“U9dFqsvi1lBpat3hKocB”,“level”:2,“time”:“2025-09-08T09:22:04+00:00”,“remoteAddr”:“MY IP”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/nextcloud/index.php/apps/files/preview-service-worker.js”,“message”:“session_start(): open(/var/lib/php/sessions/sess_anile6j20d16q6vb1l6ol86716, O_RDWR) failed: Permission denied (13) at /var/www/nextcloud/lib/private/Session/Internal.php#198”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0”,“version”:“31.0.8.1”,“data”:{“app”:“PHP”}}
{“reqId”:“U9dFqsvi1lBpat3hKocB”,“level”:2,“time”:“2025-09-08T09:22:04+00:00”,“remoteAddr”:“MY IP”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/nextcloud/index.php/apps/files/preview-service-worker.js”,“message”:“session_start(): Failed to read session data: files (path: /var/lib/php/sessions) at /var/www/nextcloud/lib/private/Session/Internal.php#198”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0”,“version”:“31.0.8.1”,“data”:{“app”:“PHP”}}
{“reqId”:“d0AzaD71dK2u8VqQIVmM”,“level”:2,“time”:“2025-09-08T09:22:05+00:00”,“remoteAddr”:“MY IP”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/nextcloud/apps/dashboard/”,“message”:“session_start(): open(/var/lib/php/sessions/sess_rgrh8gghm5kpcjr2f3fl7j9nih, O_RDWR) failed: Permission denied (13) at /var/www/nextcloud/lib/private/Session/Internal.php#198”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0”,“version”:“31.0.8.1”,“data”:{“app”:“PHP”}}
{“reqId”:“d0AzaD71dK2u8VqQIVmM”,“level”:2,“time”:“2025-09-08T09:22:05+00:00”,“remoteAddr”:“MY IP”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/nextcloud/apps/dashboard/”,“message”:“session_start(): Failed to read session data: files (path: /var/lib/php/sessions) at /var/www/nextcloud/lib/private/Session/Internal.php#198”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0”,“version”:“31.0.8.1”,“data”:{“app”:“PHP”}}
{“reqId”:“d0AzaD71dK2u8VqQIVmM”,“level”:3,“time”:“2025-09-08T09:22:05+00:00”,“remoteAddr”:“MY IP”,“user”:“user”,“app”:“index”,“method”:“GET”,“url”:“/nextcloud/apps/dashboard/”,“message”:“"/user/files/Photos" is locked, existing lock on file: 2 shared locks”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0”,“version”:“31.0.8.1”,“exception”:{“Exception”:“OCP\Lock\LockedException”,“Message”:“"/user/files/Photos" is locked, existing lock on file: 2 shared locks”,“Code”:0,“Trace”:[{“file”:“/var/www/nextcloud/lib/private/Files/View.php”,“line”:1200,“function”:“changeLock”,“class”:“OC\Files\View”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/Files/View.php”,“line”:212,“function”:“basicOperation”,“class”:“OC\Files\View”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/Files/Node/Folder.php”,“line”:129,“function”:“mkdir”,“class”:“OC\Files\View”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/legacy/OC_Util.php”,“line”:191,“function”:“newFolder”,“class”:“OC\Files\Node\Folder”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/legacy/OC_Util.php”,“line”:160,“function”:“copyr”,“class”:“OC_Util”,“type”:“::”},{“file”:“/var/www/nextcloud/lib/private/User/Session.php”,“line”:521,“function”:“copySkeleton”,“class”:“OC_Util”,“type”:“::”},{“file”:“/var/www/nextcloud/lib/private/User/Session.php”,“line”:357,“function”:“prepareUserLogin”,“class”:“OC\User\Session”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/User/Session.php”,“line”:585,“function”:“completeLogin”,“class”:“OC\User\Session”,“type”:“->”,“args”:[“*** sensitive parameters replaced “]},{“file”:”/var/www/nextcloud/lib/private/User/Session.php",“line”:307,“function”:“loginWithPassword”,“class”:“OC\User\Session”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/nextcloud/lib/private/User/Session.php",“line”:405,“function”:“login”,“class”:“OC\User\Session”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/nextcloud/lib/private/User/Session.php",“line”:544,“function”:“logClientIn”,“class”:“OC\User\Session”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/nextcloud/lib/base.php",“line”:1146,“function”:“tryBasicAuthLogin”,“class”:“OC\User\Session”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/base.php”,“line”:1031,“function”:“handleLogin”,“class”:“OC”,“type”:“::”},{“file”:“/var/www/nextcloud/index.php”,“line”:24,“function”:“handleRequest”,“class”:“OC”,“type”:“::”}],“File”:“/var/www/nextcloud/lib/private/Files/View.php”,“Line”:2115,“Previous”:{“Exception”:“OCP\Lock\LockedException”,“Message”:“"files/5877b14a45a24dff3c0fd6ac754edb40"("files/Photos") is locked, existing lock on file: 2 shared locks”,“Code”:0,“Trace”:[{“file”:“/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php”,“line”:310,“function”:“changeLock”,“class”:“OC\Files\Storage\Common”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php”,“line”:310,“function”:“changeLock”,“class”:“OC\Files\Storage\Wrapper\Wrapper”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/Files/View.php”,“line”:2107,“function”:“changeLock”,“class”:“OC\Files\Storage\Wrapper\Wrapper”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/Files/View.php”,“line”:1200,“function”:“changeLock”,“class”:“OC\Files\View”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/Files/View.php”,“line”:212,“function”:“basicOperation”,“class”:“OC\Files\View”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/Files/Node/Folder.php”,“line”:129,“function”:“mkdir”,“class”:“OC\Files\View”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/legacy/OC_Util.php”,“line”:191,“function”:“newFolder”,“class”:“OC\Files\Node\Folder”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/legacy/OC_Util.php”,“line”:160,“function”:“copyr”,“class”:“OC_Util”,“type”:“::”},{“file”:“/var/www/nextcloud/lib/private/User/Session.php”,“line”:521,“function”:“copySkeleton”,“class”:“OC_Util”,“type”:“::”},{“file”:“/var/www/nextcloud/lib/private/User/Session.php”,“line”:357,“function”:“prepareUserLogin”,“class”:“OC\User\Session”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/User/Session.php”,“line”:585,“function”:“completeLogin”,“class”:“OC\User\Session”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/nextcloud/lib/private/User/Session.php",“line”:307,“function”:“loginWithPassword”,“class”:“OC\User\Session”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/nextcloud/lib/private/User/Session.php",“line”:405,“function”:“login”,“class”:“OC\User\Session”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/nextcloud/lib/private/User/Session.php",“line”:544,“function”:“logClientIn”,“class”:“OC\User\Session”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/nextcloud/lib/base.php",“line”:1146,“function”:“tryBasicAuthLogin”,“class”:“OC\User\Session”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/base.php”,“line”:1031,“function”:“handleLogin”,“class”:“OC”,“type”:“::”},{“file”:“/var/www/nextcloud/index.php”,“line”:24,“function”:“handleRequest”,“class”:“OC”,“type”:“::”}],“File”:“/var/www/nextcloud/lib/private/Files/Storage/Common.php”,“Line”:696,“Previous”:{“Exception”:“OCP\Lock\LockedException”,“Message”:“"files/5877b14a45a24dff3c0fd6ac754edb40" is locked, existing lock on file: 2 shared locks”,“Code”:0,“Trace”:[{“file”:“/var/www/nextcloud/lib/private/Files/Storage/Common.php”,“line”:694,“function”:“changeLock”,“class”:“OC\Lock\MemcacheLockingProvider”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php”,“line”:310,“function”:“changeLock”,“class”:“OC\Files\Storage\Common”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php”,“line”:310,“function”:“changeLock”,“class”:“OC\Files\Storage\Wrapper\Wrapper”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/Files/View.php”,“line”:2107,“function”:“changeLock”,“class”:“OC\Files\Storage\Wrapper\Wrapper”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/Files/View.php”,“line”:1200,“function”:“changeLock”,“class”:“OC\Files\View”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/Files/View.php”,“line”:212,“function”:“basicOperation”,“class”:“OC\Files\View”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/Files/Node/Folder.php”,“line”:129,“function”:“mkdir”,“class”:“OC\Files\View”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/legacy/OC_Util.php”,“line”:191,“function”:“newFolder”,“class”:“OC\Files\Node\Folder”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/legacy/OC_Util.php”,“line”:160,“function”:“copyr”,“class”:“OC_Util”,“type”:“::”},{“file”:“/var/www/nextcloud/lib/private/User/Session.php”,“line”:521,“function”:“copySkeleton”,“class”:“OC_Util”,“type”:“::”},{“file”:“/var/www/nextcloud/lib/private/User/Session.php”,“line”:357,“function”:“prepareUserLogin”,“class”:“OC\User\Session”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/User/Session.php”,“line”:585,“function”:“completeLogin”,“class”:“OC\User\Session”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/nextcloud/lib/private/User/Session.php",“line”:307,“function”:“loginWithPassword”,“class”:“OC\User\Session”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/nextcloud/lib/private/User/Session.php",“line”:405,“function”:“login”,“class”:“OC\User\Session”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/nextcloud/lib/private/User/Session.php",“line”:544,“function”:“logClientIn”,“class”:“OC\User\Session”,“type”:“->”,“args”:[" sensitive parameters replaced ***”]},{“file”:“/var/www/nextcloud/lib/base.php”,“line”:1146,“function”:“tryBasicAuthLogin”,“class”:“OC\User\Session”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/base.php”,“line”:1031,“function”:“handleLogin”,“class”:“OC”,“type”:“::”},{“file”:“/var/www/nextcloud/index.php”,“line”:24,“function”:“handleRequest”,“class”:“OC”,“type”:“::”}],“File”:“/var/www/nextcloud/lib/private/Lock/MemcacheLockingProvider.php”,“Line”:126}},“message”:“"/user/files/Photos" is locked, existing lock on file: 2 shared locks”,“exception”:{},“CustomMessage”:“"/user/files/Photos" is locked, existing lock on file: 2 shared locks”}}

sudo yunohost app remove nextcloud

Thank you, but didn’t resolve the problem. Reinstalling it with yunohost app install nextcloud --force still i have the welcoming screen to every move i make in the GUI. Plus, it occupies all the resources of my RPI5.

Hi, shouldn’t be owned by www-data:www-data ?
Moreover, could you give a link to the install or uninstall log files?
Yunohost should gives you a pastebin link

Hi Marc. Thank you for reply, but changing to www-data didn’t solve the problem …again. I have prepared the logs of the last uninstalling and reinstalling of the app, but unfortunately i can’t find anywhere a repository on the forum to copy them there. Did i mentioned that i’m a newbie in using forums or other social media tools? :grin:

Until i find a solution to myself, i installed Syncthing and Piwigo. These makes Nextcloud a … how could i say… eine pischwasser!

1 Like

Hi, the following page explains how to share logs

Just copy-paste these links in this discussion. People like me will then click on the lièks and study their content

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