Error uploading nested folders using desktop client

I have Nextcloud 28 installed on the server where the code is run on a local nvme drive whereas data folder is an nfs mounted cached root squashed drive.

The desktop client has been a real pain. Files and folders are usually uploaded fine as long as they don’t go deeper than 2 or 3 levels of nesting.

It first starts by saying on Nextcloud Settings Dialog:

"folder/subfolder/sub-subfolder1: access is denied". 

When I click on nextcloud systemtray icon it shows a plethora of error messages started with “Some files couldn’t be synced!” then repetitions of

"a/b/c1: access is denied"
"a/b/c2: access is denied"

When I click on open file details it shows the following error msg:

Error Transferring Server replied not found

When I copy or move b/c1 to directory level of “a” sometimes the files/folders will start uploading. However if similarly i move something that much deeper nested folders e.g. b/c/d/e/f to the level of “a” the error is still there .

At first I thought maybe I am getting these messages because I am sharing the Desktop folder. So, I moved all the files inside a newly created nextcloud folder in the c:\ directory. Lo & behold the same error kept on repeating again regardless of making a new sync connection with a new local and remote folder.

I have been banging my head against the wall for over a fortnight now trying to make it work without success. There are some old threads from 2019-2022 highlighting a similar issue but one wud think that the issue wud be resolved by 2024. After making all these iterative changes to see if the desktop client wud start working with these nested folders I keep going back to see if there is an issue on the server side but there is nothing in the logs, both apache error & access as well as nextcloud.log in data folder.

I have restarted apache server multiple times as well as desktop client on windows to no avail.

Can anyone plz guide or at least give me a hint towards wt going on? I have tried to look at desktop clients logs in APPDATA but I can’t make head or tails of whats going on in those huge logs.
These are excepts from the the logs:

2024-01-06 06:52:08:128 [ warning nextcloud.sync.propagator.bulkupload C:\Users\User\AppData\Local\Temp\windows-19197\client-building\desktop\src\libsync\bulkpropagatorjob.cpp:212 ]:	Could not prepare upload device:  "Access is denied."
2024-01-06 06:52:08:129 [ info nextcloud.sync.propagator.bulkupload C:\Users\User\AppData\Local\Temp\windows-19197\client-building\desktop\src\libsync\bulkpropagatorjob.cpp:541 ]:	Item completed "folderA/folderB/edited" OCC::SyncFileItem::NormalError CSyncEnums::CSYNC_INSTRUCTION_NEW "Access is denied."
2024-01-06 06:52:08:129 [ warning nextcloud.sync.propagator C:\Users\User\AppData\Local\Temp\windows-19197\client-building\desktop\src\libsync\bulkpropagatorjob.cpp:723 ]:	Could not complete propagation of "folderA/folderB/edited" by OCC::BulkPropagatorJob(0x20a9dc83fa0) with status OCC::SyncFileItem::NormalError and error: "Access is denied."
2024-01-06 06:52:08:129 [ info nextcloud.sync.propagator.bulkupload C:\Users\User\AppData\Local\Temp\windows-19197\client-building\desktop\src\libsync\bulkpropagatorjob.cpp:753 ]:	modify final status NormalError OCC::SyncFileItem::NormalError OCC::SyncFileItem::NormalError
2024-01-06 06:52:08:130 [ warning nextcloud.gui.activity C:\Users\User\AppData\Local\Temp\windows-19197\client-building\desktop\src\gui\tray\usermodel.cpp:878 ]:	Item  "folderA/folderB/edited"  retrieved resulted in  "Access is denied."
2024-01-06 06:52:08:130 [ warning nextcloud.gui.activity C:\Users\User\AppData\Local\Temp\windows-19197\client-building\desktop\src\gui\tray\usermodel.cpp:840 ]:	Item  "folderA/folderB/edited"  retrieved resulted in error  "Access is denied."
2024-01-06 06:52:08:130 [ info C:\Users\User\AppData\Local\Temp\windows-19197\client-building\desktop\src\libsync\owncloudpropagator.cpp:1525 ]:	OCC::SyncFileItem::NormalError slotSubJobsFinished OCC::PropagatorJob::Running pending uploads 0 subjobs state OCC::PropagatorJob::Finished
2024-01-06 06:52:08:130 [ info nextcloud.sync.propagator C:\Users\User\AppData\Local\Temp\windows-19197\client-building\desktop\src\libsync\owncloudpropagator.cpp:1541 ]:	PropagateRootDirectory::slotSubJobsFinished emit finished OCC::SyncFileItem::NormalError
2024-01-06 06:52:08:131 [ info nextcloud.sync.engine C:\Users\User\AppData\Local\Temp\windows-19197\client-building\desktop\src\libsync\syncengine.cpp:983 ]:	Sync run took  6511 ms
2024-01-06 06:52:08:145 [ info nextcloud.gui.folder C:\Users\User\AppData\Local\Temp\windows-19197\client-building\desktop\src\gui\folder.cpp:1159 ]:	Client version 3.11.0stable-Win64 (build 20231211)  Qt 5.15.10  SSL  OpenSSL 3.1.3 19 Sep 2023
2024-01-06 06:52:08:145 [ warning nextcloud.gui.folder C:\Users\User\AppData\Local\Temp\windows-19197\client-building\desktop\src\gui\folder.cpp:1166 ]:	SyncEngine finished with ERROR
2024-01-06 06:52:08:145 [ debug com.nextcloud.owncloudgui C:\Users\User\AppData\Local\Temp\windows-19197\client-building\desktop\src\gui\owncloudgui.cpp:410 ]	[ OCC::ownCloudGui::slotShowTrayMessage ]:	Going to show notification with title: ' "Sync Activity" ' and message: ' "folderA\\folderB\\edited could not be synced due to an error. See the log for details." '
2024-01-06 06:52:08:185 [ info nextcloud.gui.folder C:\Users\User\AppData\Local\Temp\windows-19197\client-building\desktop\src\gui\folder.cpp:412 ]:	Folder "" sync result:  OCC::SyncResult::SyncRunning
2024-01-06 06:52:08:185 [ info nextcloud.gui.folder C:\Users\User\AppData\Local\Temp\windows-19197\client-building\desktop\src\gui\folder.cpp:1195 ]:	the last 1 syncs failed
2024-01-06 06:52:08:190 [ info nextcloud.gui.application C:\Users\User\AppData\Local\Temp\windows-19197\client-building\desktop\src\gui\owncloudgui.cpp:233 ]:	Sync state changed for folder  "" :  "Error"

I have also tried disabling avast’s all shields. The pc is running windows 10, server debian 12.

To the future wayward finder bent upon making nextcloud work:

I solved this by doing 2 things. First I gave all permissions to the nextcloud app known to man in Properties > Security. Despite that the errors were still present.

Secondly I moved the shared directory out of c:\users\theloggedinuser\theshareddirectory to first d:\theshareddirectory . Lo & behold everything started working. Then I took a gamble and moved theshareddirectory to c:\theshareddirectory as well as making it Desktop. Everything continued to work! it still is. if it stops working i will update this. I thought at first that maybe this is working because the nth level depth of last folders has decremented, to test that I created a chain of recursive sub folders to 15 levels followed by a file, nextcloud still kept working at this level.

The thing that convinced me to keep on trying was when I tried the owncloud desktop client, it started giving me the same error. That’s when I thought that maybe this isn’t a nextcloud or owncloud thing rather a windows thing.