All web & mobile uploads fail

Nextcloud version: 13.0.4
Operating system and version: Linux x86_64 - Shared hosting - I believe CloudLinux (3.10.0-714.10.2.lve1.5.15.el7.x86_64)
Apache or nginx version: 2.4.33
PHP version: 7.1.17
MySQL Version: 5.6.39

The issue you are facing:

Recently installed NextCloud on shared host, install went without issue however Android devices do not upload automatically or manually. I’ve tried two devices on 4G and WiFi, restarted devices etc. to no avail.

I am able to upload files via browser and Mac app without issue.

Setup on the devices works fine and I can view files but cannot upload anything.

Note: Autoupload created directory structure when I took a new photo on the device but the image failed to upload.

The error on both devices is: You are not permitted to upload to this folder

Is this the first time you’ve seen this error? Y

Steps to replicate it:

  1. Install Android NextCloud app
  2. Try to manual or auto upload
  3. Error occurs

The output of your Nextcloud log in Admin > Logging:

EMPTY!

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'oc06avspiavd',
  'passwordsalt' => 'SALT',
  'secret' => 'SECRET',
  'trusted_domains' => 
  array (
    0 => 'DOMAIN',
  ),
  'datadirectory' => '/path/to/nextclouddata',
  'overwrite.cli.url' => 'https://DOMAIN.com/nextcloud',
  'dbtype' => 'mysql',
  'version' => '13.0.4.0',
  'dbname' => 'foundint_nextc88',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'USERNAME',
  'dbpassword' => 'PASSWORD',
  'installed' => true,
);

The output of your Apache/nginx/system log in /var/log/____:

Here is an example of logs from a small .pdf I tried to upload:

[15/Jun/2018:20:44:16 +0100] "HEAD /nextcloud/remote.php/webdav/Documents/813_431_RedeMedica_Santander_Safe_Care-2014-08-07.pdf HTTP/1.1" 404 - "-" "Mozilla/5.0 (Android) ownCloud-android/3.2.0"
[15/Jun/2018:20:44:19 +0100] "PROPFIND /nextcloud/remote.php/webdav/Documents/ HTTP/1.1" 207 2284 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.2.0"
[15/Jun/2018:20:44:20 +0100] "PUT /nextcloud/remote.php/webdav/Documents/813_431_RedeMedica_Santander_Safe_Care-2014-08-07.pdf HTTP/1.1" 302 - "-" "Mozilla/5.0 (Android) ownCloud-android/3.2.0"
[15/Jun/2018:20:44:22 +0100] "GET /nextcloud/ocs/v2.php/apps/files_sharing/api/v1/shares?path=%2FDocuments%2F&reshares=true&subfiles=true HTTP/1.1" 200 138 "-" "Mozilla/5.0 (Android) ownCloud-android/3.2.0"
[15/Jun/2018:20:44:23 +0100] "PUT /nextcloud/index.php/apps/files/ HTTP/1.1" 403 32063 "-" "Mozilla/5.0 (Android) ownCloud-android/3.2.0"

Are you able to check file permissions on the data folder?

Hey Jason, thanks for your reply!

In desperation I checked file permissions on server already, and made them more open than is secure just to see if it was something related to that, they are as follows (I only have the one default account at this time on this setup):

nextclouddata 775
admin 775
Files 755
Documents / Photos / .ContactsBackup 775

I’m not sure why the web/desktop would work but x2 Android devices would not? Perhaps I should open as a bug on Github for the Android guys?

Many thanks!

personally, i dont rely anymore for support outside of github.

Better check there:

Thanks @stratege1401 but it’s both manual AND auto sync that does not work for x2 devices which is why I didn’t immediately open a bug on Android as I assumed it might be something related to my new install.

Do you know if there is anything different for the handling of uploads for mobile devices compared to desktop/web that I could check?

no, i dont see any.

But the cut/past seem to work. give it a try.

Also, the autosync is way longer ( triple time for me )to start since 3.2.0

I’ve checked and actually browser upload fails as well, so only Mac desktop client works it seems. So I’m pretty sure it’s something like permissions but not sure how to fix it.

Tried putting recursive chmod 775 for all the /nextclouddata directory and it’s the same.

Not sure how the desktop client differs and if that’s any clue what the root cause is.

Any help greatly appreciated!

If it’s not limited to the phone then certainly sounds server-side.

You’ll need to get webserver (Apache/nginx) logs.

You can equally test on my demo server as to whether your phone handles autoupload properly or not:

https://j.son.bz/nextcloud13

Hey again @JasonBayton yeah it seems that way :confused: but not sure why desktop app works fine

Here is a more recent log from server, not sure if it’s of any help:

[16/Jun/2018:19:29:36 +0100] "PROPFIND /nextcloud/remote.php/dav/files/admin/ HTTP/1.1" 207 376 "-" "Mozilla/5.0 (Macintosh) mirall/2.3.3 (build 84) (Nextcloud)"
[16/Jun/2018:19:29:39 +0100] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 74 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"
[16/Jun/2018:19:29:53 +0100] "PROPFIND /nextcloud/remote.php/webdav/untitled%20folder HTTP/1.1" 207 2736 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"
[16/Jun/2018:19:29:54 +0100] "GET /nextcloud/index.php/apps/files/ajax/getstoragestats.php?dir=%2Funtitled%20folder HTTP/1.1" 200 222 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"
[16/Jun/2018:19:30:01 +0100] "PUT /nextcloud/remote.php/webdav/untitled%20folder/nextcloud.sh HTTP/1.1" 302 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"
[16/Jun/2018:19:30:03 +0100] "PUT /nextcloud/index.php/apps/files/ HTTP/1.1" 403 35638 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"
[16/Jun/2018:19:30:05 +0100] "GET /nextcloud/index.php/apps/files/ajax/getstoragestats.php?dir=%2Funtitled%20folder HTTP/1.1" 200 222 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"
[16/Jun/2018:19:30:06 +0100] "PROPFIND /nextcloud/remote.php/dav/files/admin/ HTTP/1.1" 207 376 "-" "Mozilla/5.0 (Macintosh) mirall/2.3.3 (build 84) (Nextcloud)"
[16/Jun/2018:19:30:09 +0100] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 74 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"
[16/Jun/2018:19:30:23 +0100] "GET / HTTP/1.1" 200 3395 "-" "Mozilla/5.0 zgrab/0.x (compatible; Researchscan/t12ca; +http://researchscan.comsys.rwth-aachen.de)"
[16/Jun/2018:19:30:36 +0100] "PROPFIND /nextcloud/remote.php/dav/files/admin/ HTTP/1.1" 207 376 "-" "Mozilla/5.0 (Macintosh) mirall/2.3.3 (build 84) (Nextcloud)"
[16/Jun/2018:19:30:40 +0100] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 74 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"
[16/Jun/2018:19:31:06 +0100] "PROPFIND /nextcloud/remote.php/dav/files/admin/ HTTP/1.1" 207 376 "-" "Mozilla/5.0 (Macintosh) mirall/2.3.3 (build 84) (Nextcloud)"
[16/Jun/2018:19:31:10 +0100] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 74 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"
[16/Jun/2018:19:31:36 +0100] "PROPFIND /nextcloud/remote.php/dav/files/admin/ HTTP/1.1" 207 376 "-" "Mozilla/5.0 (Macintosh) mirall/2.3.3 (build 84) (Nextcloud)"
[16/Jun/2018:19:31:40 +0100] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 74 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"
[16/Jun/2018:19:32:06 +0100] "PROPFIND /nextcloud/remote.php/dav/files/admin/ HTTP/1.1" 207 376 "-" "Mozilla/5.0 (Macintosh) mirall/2.3.3 (build 84) (Nextcloud)"
[16/Jun/2018:19:32:10 +0100] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 74 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"
[16/Jun/2018:19:32:37 +0100] "PROPFIND /nextcloud/remote.php/dav/files/admin/ HTTP/1.1" 207 376 "-" "Mozilla/5.0 (Macintosh) mirall/2.3.3 (build 84) (Nextcloud)"
[16/Jun/2018:19:32:40 +0100] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 74 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"
[16/Jun/2018:19:33:06 +0100] "PROPFIND /nextcloud/remote.php/dav/files/admin/ HTTP/1.1" 207 376 "-" "Mozilla/5.0 (Macintosh) mirall/2.3.3 (build 84) (Nextcloud)"
[16/Jun/2018:19:33:09 +0100] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 74 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"

I was thinking of trying to run the script from here to see if it resolves permissions issues: https://docs.nextcloud.com/server/9/admin_manual/installation/installation_wizard.html

That’s an access log chap, could you get / request the error log please? If you can time it with a few upload attempts also that’d be great.

I tried a clean install and facing same issue, grabbing the logs from the provider now and will upload here soon. Thanks @JasonBayton :slight_smile:

Many apologies, i’ve discussed with hosting provider and they say i’m triggering mod_security so seems like its a provider issue :man_facepalming:

Seeing if I can work on it with them, otherwise i’ll be cancelling the subscription and moving elsewhere. So if anyone has recommendations for a good cheap hosting provider i’d be grateful for advice!

1 Like

My hosting provider manually disabled the modsecurity rules for my domain, I believe they are: 920420 & 949110. In case anyone faces a similar issue with shared hosting.

If your host uses modsecurity and enables the option to do so, you might be able to try disable via .htaccess here are some examples I found: https://stackoverflow.com/questions/12928360/how-can-i-disable-mod-security-in-htaccess-file

@JasonBayton and @stratege1401 thanks for trying to help guys and sorry for wasting your time!!

1 Like

Glad it’s sorted :slight_smile: provider based NC is often a bit of a mine field