Target folder does not exist anymore

Can anybody help me understand why I’m unable to upload files to my installation of Nextcloud.

A similar issue was described in November 2023, for this person it only related to files less than 8KB.

I’ve been seeing it with files of 200KB, 800KB and 4MB

I have just installed Nextcloud 29.0.5 using cPanel’s Installatron.

My default installation is responding OK, I can see the 9 pre-loaded photos but so far I have been unable to upload any of my own photos.

I have tried 5 different methods:

  1. drag and drop from Linux “Files” app to “Photos” area in Nextcloud
  2. drag and drop from Linux “Files” app to “Files” All files > Photos > my_test_directory in Nextcloud
  3. Point browser at a new and empty photo album, click Add->New select a smallish locally held photo, click Open
  4. In Nextcloud Android app, click Photos (see the 9 pre-loaded photos), click +, click Upload from Camera
  5. In Nextcloud Android app, click Photos (see the 9 pre-loaded photos), click +, Upload files, select a photo

Of these 5 only the drag and drop methods give any sort of error message, they both say: “target folder does not exist anymore”

I searched Internet for “nextcloud target folder does not exist anymore” and found someone asking a similar question:

Someone suggested the first step would be to determine if the target folder exists or not, a reasonable question to which I don’t know the answer. All the above methods involve a GUI and thus the actual target directory is guesswork on my part.

“Files” tells me I have a directory which it identifies as:
All files > Photos > test_photo_drag
so I guess that exists.

I also have two empty albums which I’ve tried to use as a target but I’ve no idea what their directory names are or if they even have their own directories.

My phone runs Android 10
My computer runs Ubuntu 22.04

My web hosting company appear to have resolved the problem I was having.

I contacted them, NOT about NextCloud but because my email access was repeatedly failing with a firewall issue of some sort.

They responded to me with the following:

/////////////////
Looking through the logs I see that this [firewall blocking] was the cause of your issue. NextCloud doesn’t work well with mod_security - this is a ‘Web Application Firewall’ which helps to keep any PHP-based application secure, but due to it having to try and work with a lot of different applications doesn’t work with everything. This is quite well documented within the NextCloud community.

Some actions on NextCloud trigger an alert, and when this happens a specific number of times in a short period it triggers a firewall block to protect your account.

Due to the incompatibility, I’ve disabled this on your account and I don’t think you’ll have any further issues.
/////////////////

So as I understand it NextCloud doesn’t play well with ModSecurity, between them they manage to cause grief all round.

The solution my web hosting company found was to remove a layer of security. This resolved the issue but it’s not difficult to imagine the downside.