My nextcloud notes app was not syncing. I figured out the problem on my own now. Still I write it up, for the case anyone else writes notes directly via SSH and might run into the same issue.
I run Nextcloud 26.0.9 under Debian bullseye. I have upgraded Nextcloud and Debian recently. I have also added some new markdown files manually into the folder where I store my notes (via SSH).
Problem: My app won't sync any more.
Steps to reproduce
Upgrade Nextcloud to 26.0.9
apt-get update && apt-get update (main change is that the system now uses php 8.2.13 instead of 8.1)
add some markdown files
sync the android app --> won't work
I can view all of my markdown files in the Nextcloud instance on the web. I can also see them via SSH. My app shows the markdown files but doesn't sync them.
The Niedermann Notes app will show the following error log:
`App Version: 4.1.0
App Version Code: 40010090
App Flavor: play
Files App Version Code: 30260090 (PROD)
OS Version: 4.14.180-perf-g31bfd55(V13.0.4.0.SJUMIXM)
OS API Level: 31
Device: vayu
Manufacturer: Xiaomi
Model (and Product): M2102J20SG (vayu_global)
at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.pushLocalChanges(NotesServerSyncTask.java:145)
at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.run(NotesServerSyncTask.java:94)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
I expected a normal sync, and it did sync okay until recently. I did have problems due to a single, too large notes file, but it synced okay after I had split it up into several smaller files.
Actual behaviour
The error log on Nextcloud server shows the folloging messages:
Controller failed with OCP\\Files\\GenericFileException","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.26.0","version":"26.0.9.1","exception":{"Exception":"OCP\\Files\\GenericFileException","Message":"file_put_contents failed","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/notes/lib/Service/Note.php","line":172,"function":"putContent","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/var/www/nextcloud/apps/notes/lib/Controller/NotesApiController.php","line":172,"function":"setContent","class":"OCA\\Notes\\Service\\Note","type":"->"},{"file":"/var/www/nextcloud/apps/notes/lib/Service/Util.php","line":26,"function":"OCA\\Notes\\Controller\\{closure}","class":"OCA\\Notes\\Controller\\NotesApiController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/notes/lib/Controller/Helper.php","line":140,"function":"retryIfLocked","class":"OCA\\Notes\\Service\\Util","type":"::"},{"file":"/var/www/nextcloud/apps/notes/lib/Controller/NotesApiController.php","line":162,"function":"handleErrorResponse","class":"OCA\\Notes\\Controller\\Helper","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"update","class":"OCA\\Notes\\Controller\\NotesApiController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1062,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Files/Node/File.php","Line":72,"message":"Controller failed with OCP\\Files\\GenericFileException","exception":{},"CustomMessage":"Controller failed with OCP\\Files\\GenericFileException"}}
{"reqId":"C33dDF4xOyDZIPlTOZzr","level":3,"time":"2023-12-14T00:15:55+01:00","remoteAddr":"185.46.130.82","user":"Bernd","app":"PHP","method":"PUT","url":"/index.php/apps/notes/api/v1/notes/46332?","message":"chmod(): Operation not permitted at /var/www/nextcloud/lib/private/Log/File.php#86","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.26.0","version":"26.0.9.1","data":{"app":"PHP"}}
Reason
I wrote some markdown files as the normal user, and obviously the ownership was automatically of that user and his group.
I had to change the group to www-data:
chown user:www-data *
of all markdown files, then changed the permissions to
chmod u+rw,g+rw,o-rwx *
My nextcloud notes app was not syncing. I figured out the problem on my own now. Still I write it up, for the case anyone else writes notes directly via SSH and might run into the same issue.
I run Nextcloud 26.0.9 under Debian bullseye. I have upgraded Nextcloud and Debian recently. I have also added some new markdown files manually into the folder where I store my notes (via SSH).
Problem: My app won't sync any more.
Steps to reproduce
I can view all of my markdown files in the Nextcloud instance on the web. I can also see them via SSH. My app shows the markdown files but doesn't sync them.
The Niedermann Notes app will show the following error log:
`App Version: 4.1.0 App Version Code: 40010090 App Flavor: play
Files App Version Code: 30260090 (PROD)
OS Version: 4.14.180-perf-g31bfd55(V13.0.4.0.SJUMIXM) OS API Level: 31 Device: vayu Manufacturer: Xiaomi Model (and Product): M2102J20SG (vayu_global)
java.lang.Exception: {"errorType":"OCP\Files\GenericFileException"}
`
My Smartphone
Notes App on Nexcloud
Nexcloud Notes-Version (nextcloud web): 4.9.0
Expected behaviour
I expected a normal sync, and it did sync okay until recently. I did have problems due to a single, too large notes file, but it synced okay after I had split it up into several smaller files.
Actual behaviour
The error log on Nextcloud server shows the folloging messages:
Reason
I wrote some markdown files as the normal user, and obviously the ownership was automatically of that user and his group. I had to change the group to www-data:
chown user:www-data *
of all markdown files, then changed the permissions tochmod u+rw,g+rw,o-rwx *
Now the app will sync again.