Thursday, April 14, 2022

[SOLVED] Out of the blue I can't sync with my Nextcloud (snap)

Issue

I am hosting this nextcloud snap more than a year, successfully. No error or bugs. Great!

But yesterday, out of the blue I couldn't sync with my nextcloud anymore. I got this error in my browser: "Dein Datenverzeichnis ist ungültig Stelle sicher, dass eine Datei “.ocdata” im Wurzelverzeichnis des data-Verzeichnisses existiert. Your data directory is not writable Berechtigungen können zumeist korrigiert werden indem dem Web-Server Schreibzugriff auf das Wurzel-Verzeichnis eingeräumt wird. Siehe auch https://docs.nextcloud.com/server/20/go.php?to=admin-dir_permissions 12. "

I checked if the "ocdata" was there. It was. I checked its permissions. All were right. After that I changed the user:group of the data directory (chown without -R) to "root:root", because before that it was "system_user:system_user". Directly after this I saw the login page. After trying sync via the client, the login page was gone und I now have this error: "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."

After that I tried 770 permissions on the whole data folder. Used different cominations of root and the system user with chown on the whole data folder. No changes.

In my logs I can't find a proper hint. I don't know where on my system I have to search for the solution.

My logs

You can see my logs on github

Here are some system informations:

nextcloud 20.0.7snap1 26119 latest/candidate nextcloud✓ -

snap 2.49.1 snapd 2.49.1 series 16 debian 10 kernel 4.19.0-14-amd64


Solution

So, now I can say it is running! I can access the website and the client is syncing. Finally! The solution was this command

sudo snap connect nextcloud:removable-media

and maybe the old permissions of the data folder.

I don't know why nextcloud needed this out of the sudden. I did this the first time. My data folder is not on a removable drive but outside of the snap directory.

(For the full story and all the steps that I took, you can look here)



Answered By - Hirsch
Answer Checked By - Marie Seifert (WPSolving Admin)