Files not uploading on NC 12 / Server replied: Forbidden


#1

Updated to NC 12 today.
The error log on the Windows client (Version 2.3.1 (build8) has several entries like

22.05.2017 13:15:47, Mailstore/Data/MailStoreFileGroup.fdb, F:\NC,Das Element ist aufgrund vorheriger Fehler nicht synchronisiert: Error transferring https://www.domain.tld:555/remote.php/dav/uploads/kdj/1804273858/.file - server replied: Forbidden

The file in question is 322 MB in size.

I have already tried “Force sync now” but the situation does not change. I’m running Nextcloud on my own server, Ubuntu 17.10, php 7, nginx, PostgreSQL. My php.ini and www.conf is setup as described here: https://www.c-rieger.de/nextcloud-installation-guide/#c02


#2

I did a fresh install of Nextcloud 12 now - I cannot upload any file larger than roughly 10 MB.
I always get the response: server replied:forbidden.

I have tons of errors like this:

{“reqId”:“tN1dBrOxks8ocGrzte6z”,“level”:3,“time”:“2017-05-23T22:20:24+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/736634479/00000004",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“Yo8Kepkgr3BAOwMLgJ2n”,“level”:3,“time”:“2017-05-23T22:20:26+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/736634479/00000005",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“J1aV7aoZbWvUG4YW9MUO”,“level”:3,“time”:“2017-05-23T22:20:27+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/736634479/00000006",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“SyyLfGmh8Bn0nfsWgz8E”,“level”:3,“time”:“2017-05-23T22:20:29+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/736634479/00000007",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“QwUAVLQb7hbOAjOHl8TL”,“level”:3,“time”:“2017-05-23T22:20:31+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/736634479/00000008",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“rYLj51ZgDSrjC8Wj8JtE”,“level”:3,“time”:“2017-05-23T22:20:33+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/736634479/00000009",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“01JAteZZwv9Mhs61nrrF”,“level”:3,“time”:“2017-05-23T22:20:34+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/736634479/00000010",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“aYfGfMC50aYE4bwIZc8C”,“level”:3,“time”:“2017-05-23T22:20:36+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/736634479/00000011",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“1jpoJo3jWgZeMZSUWEt4”,“level”:3,“time”:“2017-05-23T22:20:38+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/736634479/00000012",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“QgIsNMMcpZNvtSxAYRyv”,“level”:3,“time”:“2017-05-23T22:20:41+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/736634479/00000013",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“RMkPeJvldtxFYjjcRcbH”,“level”:3,“time”:“2017-05-23T22:20:43+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/736634479/00000014",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“jBW7IXPzQcSdABC51rCt”,“level”:3,“time”:“2017-05-23T22:20:45+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/736634479/00000015",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“L7iouQTN0yOefKE3IfMV”,“level”:3,“time”:“2017-05-23T22:20:46+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/736634479/00000016",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“a2s31raIE0kc6c6NIodw”,“level”:3,“time”:“2017-05-23T22:20:48+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/736634479/00000017",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“wlL6L857YbWb3ihBs8jZ”,“level”:3,“time”:“2017-05-23T22:20:49+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/736634479/00000018",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“Et7HrnlkuPMfE9qq1ejg”,“level”:3,“time”:“2017-05-23T22:20:52+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/736634479/00000019",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“mTpcfjFrg9h8UfReYrfl”,“level”:3,“time”:“2017-05-23T22:20:53+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/736634479/00000020",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“jFcmcpjNYiEm32BfmxUA”,“level”:3,“time”:“2017-05-23T22:20:55+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/522932008/00000000",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“Fx611tCcua3cQlJgZr3x”,“level”:3,“time”:“2017-05-23T22:20:57+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/1430066462/00000000",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“IY0qxTVGxN9IECetrc5a”,“level”:3,“time”:“2017-05-23T22:20:57+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/522932008/00000001",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“0JCMnFGRKobVgUOwYGhR”,“level”:3,“time”:“2017-05-23T22:20:59+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/1430066462/00000001",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“nfL0EzCSyhbzwkMNRZIs”,“level”:3,“time”:“2017-05-23T22:20:59+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/522932008/00000002",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“d30ch71nmRQfiqIrf7gx”,“level”:3,“time”:“2017-05-23T22:21:01+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/1430066462/00000002",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“m2F3JhTPRcESgajj48ux”,“level”:3,“time”:“2017-05-23T22:21:02+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/1430066462/00000003",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“WWtyW7og2GaaOfwHyqsp”,“level”:3,“time”:“2017-05-23T22:21:05+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/1442753903/00000000",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“zVY6HbpTE509AxPszNmX”,“level”:3,“time”:“2017-05-23T22:21:07+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/1442753903/00000001",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“yfuiD4NETOsbK7TjH4zK”,“level”:3,“time”:“2017-05-23T22:21:08+00:00”,“remoteAddr”:“95.123.45.200”,“user”:“John”,“app”:“PHP”,“method”:“PUT”,“url”:"/remote.php/dav/uploads/John/1442753903/00000002",“message”:“Undefined offset: 3 at /var/www/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Macintosh) mirall/2.3.2 (build 4250)”,“version”:“12.0.0.29”}
{“reqId”:“EUEAjjAptCdnMG6mm9UW”,“level”:3,“time”:“2017-05-23T23:30:07+00:00”,“remoteAddr”:"",“user”:"–",“app”:“PHP”,“method”:"–",“url”:"–",“message”:“Undefined index: federationId at /var/www/nextcloud/settings/BackgroundJobs/VerifyUserData.php#234”,“userAgent”:"–",“version”:“12.0.0.29”}
{“reqId”:“fOzmhHgiJJ1h31R5Yg1u”,“level”:3,“time”:“2017-05-24T00:45:09+00:00”,“remoteAddr”:"",“user”:"–",“app”:“PHP”,“method”:"–",“url”:"–",“message”:“Undefined index: federationId at /var/www/nextcloud/settings/BackgroundJobs/VerifyUserData.php#234”,“userAgent”:"–",“version”:“12.0.0.29”}
{“reqId”:“kfJ6jwWfknLMdZVVgKIm”,“level”:3,“time”:“2017-05-24T03:15:10+00:00”,“remoteAddr”:"",“user”:"–",“app”:“PHP”,“method”:"–",“url”:"–",“message”:“Undefined index: federationId at /var/www/nextcloud/settings/BackgroundJobs/VerifyUserData.php#234”,“userAgent”:"–",“version”:“12.0.0.29”}


#3

it seems that all my missing files are “stuck” in the uploads folder!


#4

I have the same problem, cannot sync all files bigger than 10MB.
Please anyone knows how to fix this problem?


#5

I have exactly the same problem. For me, Nextcloud 12, PHP 5.6 and NGINX 1.6 are running. Would be very grateful for a solution.


#6

For this error, there is a fix that you can easily apply manually:


#7

Hi @necrevistonnezr,
I was having the same trouble running on debian with nginx and ispconfig. The problem was that ispconfig inserts this code by default:

location ~ /\. {
        deny all;
}

I fixed this by adjusting the config:

location ~ /\.file {
        allow all;
}

location ~ /\.[\d\w]* {
        deny all;
}

in ispconfig you need to add this to remove the default block:

location ~ /\. {
##delete##
}

EDIT

Saddly I was a little bit too hasty. This still allows access to .htacess because the empty location block for /. still exists. Additionally the actual error still occurs eventhough the access to .file files is now allowed.

Sorry


#8

Okay I solved it. @Jan_Harms has brought me to the solution. Some hosting tools such as ISPCONFIG have set:

    location ~ /\. {
		deny all;

it can not be solved with a web snippet. Change the nginx domain config (etc / nginx / sites available / domain.vhost) from:

    location ~ /\. {
		deny all;

to

location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
    deny all;
}
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
    deny all;
}

Then restart nginx. After every change in ispconfig you have to adjust it again so you can help yourself with a bash script.

regards Core2k