MOVE 400 Bad Request

Hello,

I have a strange issue. The nextcloud client always gives me a 400 Bad Request error, but only for the WebDav MOVE command. All other commands as well as the web ui work fine.

I have the following setup (using docker/docker-compose)

(web) -> reverse-proxy (nginx, tried to replace this with traefik recently) -> nextcloud_web (nginx:1.17.10) -> nextcloud_app (nextcloud:18.0.4-fpm-alpine)

The web ui works perfectly. However the nextcloud client spits out the following errors:

At first I thought this had to do with the migration to Traefik as reverse proxy, but now I stopped the traefik container again and used my old nginx reverse proxy again, but it still does not work. I have no idea anymore where to look. I think by now I have been looking for more than 8 hours for a solution for this.

I tried both Nextcloud 2.6.2 and 2.6.4 Client for Windows.

When looking at the logs using admin account it looks like this:

[webdav] Fatal: Sabre\DAV\Exception\BadRequest: Chunks on server do not sum up to 8999439 but to 0 bytes at <<closure>>

 0. /var/www/html/apps/dav/lib/Upload/ChunkingPlugin.php line 56
    OCA\DAV\Upload\ChunkingPlugin->verifySize()
 1. <<closure>>
    OCA\DAV\Upload\ChunkingPlugin->beforeMove("uploads/twatzl/1125712125/.file", "files/twatzl/Bi ... G")
 2. /var/www/html/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    call_user_func_array([OCA\DAV\Upload\ ... "], ["uploads/twatzl ... "])
 3. /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 633
    Sabre\Event\EventEmitter->emit("beforeMove", ["uploads/twatzl ... "])
 4. <<closure>>
    Sabre\DAV\CorePlugin->httpMove(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
 5. /var/www/html/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    call_user_func_array([Sabre\DAV\CorePlugin {},"httpMove"], [Sabre\HTTP\Requ ... }])
 6. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    Sabre\Event\EventEmitter->emit("method:MOVE", [Sabre\HTTP\Requ ... }])
 7. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
 8. /var/www/html/apps/dav/lib/Server.php line 319
    Sabre\DAV\Server->exec()
 9. /var/www/html/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
10. /var/www/html/remote.php line 165
    require_once("/var/www/html/a ... p")

MOVE /remote.php/dav/uploads/twatzl/1125712125/.file
from 192.168.80.2 by twatzl at 2020-05-22T12:33:24+00:00

The Overview in the admin ui states the following:

Your web server is not properly set up to resolve "/.well-known/caldav". Further information can be found in the documentation.
Your web server is not properly set up to resolve "/.well-known/carddav". Further information can be found in the documentation.
The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running "occ db:add-missing-indices" those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster.
	Missing index "calendarobject_calid_index" in table "oc_calendarobjects_props".
	Missing index "schedulobj_principuri_index" in table "oc_schedulingobjects".
Some columns in the database are missing a conversion to big int. Due to the fact that changing column types on big tables could take some time they were not changed automatically. By running 'occ db:convert-filecache-bigint' those pending changes could be applied manually. This operation needs to be made while the instance is offline. For further details read the documentation page about this.
	mounts.storage_id
	mounts.root_id
	mounts.mount_id

though I don’t think anything of this is actually a problem, because when I try to access https://myserver.com/.well-known/caldav I get redirected properly. So the checks seem to be somehow flawed.

config for the nextcloud_web nginx

worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    upstream php-handler {
        server app:9000;
    }

    server {
        listen 80;

        # Add headers to serve security related headers
		# Before enabling Strict-Transport-Security headers please read into this
		# topic first.
		# add_header Strict-Transport-Security "max-age=15768000;
		# includeSubDomains; preload;";
		#
		# WARNING: Only add the preload option once you read about
		# the consequences in https://hstspreload.org/. This option
		# will add the domain to a hardcoded list that is shipped
		# in all major browsers and getting removed from this list
		# could take several months.
		add_header X-Content-Type-Options nosniff;
		add_header X-XSS-Protection "1; mode=block";
		add_header X-Robots-Tag none;
		add_header X-Download-Options noopen;
		add_header X-Permitted-Cross-Domain-Policies none;
		add_header Referrer-Policy no-referrer;

		root /var/www/html;

		location = /robots.txt {
			allow all;
			log_not_found off;
			access_log off;
		}

		# The following 2 rules are only needed for the user_webfinger app.
		# Uncomment it if you're planning to use this app.
		#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
		#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
		# last;

		location = /.well-known/carddav {
			return 301 $scheme://$host:$server_port/remote.php/dav;
		}
		location = /.well-known/caldav {
			return 301 $scheme://$host:$server_port/remote.php/dav;
		}

		# set max upload size
		client_max_body_size 10G;
		fastcgi_buffers 64 4K;
		#fastcgi_request_buffering off;

		# Enable gzip but do not remove ETag headers
		gzip on;
		gzip_vary on;
		gzip_comp_level 4;
		gzip_min_length 256;
		gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
		gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;

		# Uncomment if your server is build with the ngx_pagespeed module
		# This module is currently not supported.
		#pagespeed off;

		location / {
			rewrite ^ /index.php;
		}

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

		location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/) {
			fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
			set $path_info $fastcgi_path_info;
			try_files $fastcgi_script_name =404;
			include fastcgi_params;
			fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
			fastcgi_param PATH_INFO $path_info;
			# fastcgi_param HTTPS on;
			#Avoid sending the security headers twice
			fastcgi_param modHeadersAvailable true;
			fastcgi_param front_controller_active true;
			fastcgi_pass php-handler;
			fastcgi_intercept_errors on;
			fastcgi_request_buffering off;
		}

		location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) {
			try_files $uri/ =404;
			index index.php;
		}

		# Adding the cache control header for js, css and map files
		# Make sure it is BELOW the PHP block
		location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
			try_files $uri /index.php$request_uri;
			add_header Cache-Control "public, max-age=15778463";
			# Add headers to serve security related headers (It is intended to
			# have those duplicated to the ones above)
			# Before enabling Strict-Transport-Security headers please read into
			# this topic first.
			#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
			#
			# WARNING: Only add the preload option once you read about
			# the consequences in https://hstspreload.org/. This option
			# will add the domain to a hardcoded list that is shipped
			# in all major browsers and getting removed from this list
			# could take several months.
			add_header Referrer-Policy "no-referrer" always;
			add_header X-Content-Type-Options "nosniff" always;
			add_header X-Download-Options "noopen" always;
			add_header X-Frame-Options "SAMEORIGIN" always;
			add_header X-Permitted-Cross-Domain-Policies "none" always;
			add_header X-Robots-Tag "none" always;
			add_header X-XSS-Protection "1; mode=block" always;

			# Optional: Don't log access to assets
			access_log off;
		}

		location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ {
			try_files $uri /index.php$request_uri;
			# Optional: Don't log access to other assets
			access_log off;
		}
    }

}

logs for the nginx reverse proxy (excerpt):

...
<public server ip> - twatzl [27/May/2020:08:09:11 +0000] "MOVE /remote.php/dav/uploads/twatzl/3202616989/.file HTTP/1.1" 400 262 "-" "Mozilla/5.0 (Windows) mirall/2.6.2stable-Win64 (build 20191224) (Nextcloud)" "-"
<public server ip> - twatzl [27/May/2020:08:09:11 +0000] "PROPFIND /remote.php/dav/uploads/twatzl/3490865017 HTTP/1.1" 207 724 "-" "Mozilla/5.0 (Windows) mirall/2.6.2stable-Win64 (build 20191224) (Nextcloud)" "-"
<public server ip> - twatzl [27/May/2020:08:09:11 +0000] "MOVE /remote.php/dav/uploads/twatzl/3490865017/.file HTTP/1.1" 400 261 "-" "Mozilla/5.0 (Windows) mirall/2.6.2stable-Win64 (build 20191224) (Nextcloud)" "-"
<public server ip> - twatzl [27/May/2020:08:09:11 +0000] "PROPFIND /remote.php/dav/uploads/twatzl/3501395708 HTTP/1.1" 207 724 "-" "Mozilla/5.0 (Windows) mirall/2.6.2stable-Win64 (build 20191224) (Nextcloud)" "-"
<public server ip> - twatzl [27/May/2020:08:09:11 +0000] "MOVE /remote.php/dav/uploads/twatzl/3501395708/.file HTTP/1.1" 400 262 "-" "Mozilla/5.0 (Windows) mirall/2.6.2stable-Win64 (build 20191224) (Nextcloud)" "-"
<public server ip> - - [27/May/2020:08:09:11 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 5208 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0" "-"
<public server ip> - - [27/May/2020:08:09:13 +0000] "POST /apps/text/session/sync HTTP/1.1" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "
<public server ip> - - [27/May/2020:08:09:19 +0000] "POST /apps/text/session/sync HTTP/1.1" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "-"
<public server ip> - twatzl [27/May/2020:08:09:21 +0000] "GET /ocs/v1.php/cloud/user?format=json HTTP/1.1" 200 554 "-" "Mozilla/5.0 (Windows) mirall/2.6.4stable-Win64 (build 20200303) (Nextcloud)" "-"
<public server ip> - twatzl [27/May/2020:08:09:21 +0000] "GET /remote.php/dav/avatars/twatzl/128.png HTTP/1.1" 200 741 "-" "Mozilla/5.0 (Windows) mirall/2.6.4stable-Win64 (build 20200303) (Nextcloud)" "-"
<public server ip> - - [27/May/2020:08:09:25 +0000] "POST /apps/text/session/sync HTTP/1.1" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "-"
<public server ip> - - [27/May/2020:08:09:31 +0000] "POST /apps/text/session/sync HTTP/1.1" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "-"
<public server ip> - - [27/May/2020:08:09:37 +0000] "POST /apps/text/session/sync HTTP/1.1" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "-"
<public server ip> - - [27/May/2020:08:09:41 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 5208 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0" "-"
<public server ip> - - [27/May/2020:08:09:43 +0000] "POST /apps/text/session/sync HTTP/1.1" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "-"
<public server ip> - twatzl [27/May/2020:08:09:45 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications?format=json HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows) mirall/2.6.4stable-Win64 (build 20200303) (Nextcloud)" "-"
<public server ip> - - [27/May/2020:08:09:49 +0000] "POST /apps/text/session/sync HTTP/1.1" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "-"
<public server ip> - twatzl [27/May/2020:08:09:51 +0000] "GET /ocs/v1.php/cloud/user?format=json HTTP/1.1" 200 554 "-" "Mozilla/5.0 (Windows) mirall/2.6.4stable-Win64 (build 20200303) (Nextcloud)" "-"
<public server ip> - twatzl [27/May/2020:08:09:51 +0000] "GET /remote.php/dav/avatars/twatzl/128.png HTTP/1.1" 200 741 "-" "Mozilla/5.0 (Windows) mirall/2.6.4stable-Win64 (build 20200303) (Nextcloud)" "-"
<public server ip> - - [27/May/2020:08:09:55 +0000] "POST /apps/text/session/sync HTTP/1.1" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "-"
<public server ip> - - [27/May/2020:08:10:01 +0000] "POST /apps/text/session/sync HTTP/1.1" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "-"
<public server ip> - - [27/May/2020:08:10:07 +0000] "POST /apps/text/session/sync HTTP/1.1" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "-"
<public server ip> - twatzl [27/May/2020:08:10:08 +0000] "PROPFIND /remote.php/dav/files/twatzl/Bilder HTTP/1.1" 207 386 "-" "Mozilla/5.0 (Windows) mirall/2.6.2stable-Win64 (build 20191224) (Nextcloud)" "-"
<public server ip> - - [27/May/2020:08:10:11 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 5208 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0" "-"
<public server ip> - - [27/May/2020:08:10:13 +0000] "POST /apps/text/session/sync HTTP/1.1" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "-"
<public server ip> - - [27/May/2020:08:10:19 +0000] "POST /apps/text/session/sync HTTP/1.1" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "-"
<public server ip> - twatzl [27/May/2020:08:10:21 +0000] "PROPFIND /remote.php/dav/files/twatzl/ HTTP/1.1" 207 399 "-" "Mozilla/5.0 (Windows) mirall/2.6.2stable-Win64 (build 20191224) (Nextcloud)" "-"
<public server ip> - twatzl [27/May/2020:08:10:21 +0000] "GET /ocs/v1.php/cloud/user?format=json HTTP/1.1" 200 554 "-" "Mozilla/5.0 (Windows) mirall/2.6.4stable-Win64 (build 20200303) (Nextcloud)" "-"
<public server ip> - twatzl [27/May/2020:08:10:22 +0000] "GET /remote.php/dav/avatars/twatzl/128.png HTTP/1.1" 200 741 "-" "Mozilla/5.0 (Windows) mirall/2.6.4stable-Win64 (build 20200303) (Nextcloud)" "-"
<public server ip> - - [27/May/2020:08:10:25 +0000] "POST /apps/text/session/sync HTTP/1.1" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "-"
<public server ip> - - [27/May/2020:08:10:30 +0000] "GET /apps/logreader/get?offset=92&count=8&levels=11111 HTTP/1.1" 200 27372 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "-"
...
<reverse proxy ip> - twatzl [27/May/2020:08:09:11 +0000] "MOVE /remote.php/dav/uploads/twatzl/3490865017/.file HTTP/1.0" 400 250 "-" "Mozilla/5.0 (Windows) mirall/2.6.2stable-Win64 (build 20191224) (Nextcloud)" "<public server ip>"
<reverse proxy ip> - twatzl [27/May/2020:08:09:11 +0000] "PROPFIND /remote.php/dav/uploads/twatzl/3501395708 HTTP/1.0" 207 712 "-" "Mozilla/5.0 (Windows) mirall/2.6.2stable-Win64 (build 20191224) (Nextcloud)" "<public server ip>"
<reverse proxy ip> - twatzl [27/May/2020:08:09:11 +0000] "MOVE /remote.php/dav/uploads/twatzl/3501395708/.file HTTP/1.0" 400 251 "-" "Mozilla/5.0 (Windows) mirall/2.6.2stable-Win64 (build 20191224) (Nextcloud)" "<public server ip>"
<reverse proxy ip> - - [27/May/2020:08:09:11 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.0" 200 5208 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0" "<public server ip>"
<reverse proxy ip> - - [27/May/2020:08:09:13 +0000] "POST /apps/text/session/sync HTTP/1.0" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "<public server ip>"
<reverse proxy ip> - - [27/May/2020:08:09:19 +0000] "POST /apps/text/session/sync HTTP/1.0" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "<public server ip>"
<reverse proxy ip> - twatzl [27/May/2020:08:09:21 +0000] "GET /ocs/v1.php/cloud/user?format=json HTTP/1.0" 200 554 "-" "Mozilla/5.0 (Windows) mirall/2.6.4stable-Win64 (build 20200303) (Nextcloud)" "<public server ip>"
<reverse proxy ip> - twatzl [27/May/2020:08:09:21 +0000] "GET /remote.php/dav/avatars/twatzl/128.png HTTP/1.0" 200 729 "-" "Mozilla/5.0 (Windows) mirall/2.6.4stable-Win64 (build 20200303) (Nextcloud)" "<public server ip>"
<reverse proxy ip> - - [27/May/2020:08:09:25 +0000] "POST /apps/text/session/sync HTTP/1.0" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "<public server ip>"
<reverse proxy ip> - - [27/May/2020:08:09:31 +0000] "POST /apps/text/session/sync HTTP/1.0" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "<public server ip>"
<reverse proxy ip> - - [27/May/2020:08:09:37 +0000] "POST /apps/text/session/sync HTTP/1.0" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "<public server ip>"
<reverse proxy ip> - - [27/May/2020:08:09:41 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.0" 200 5208 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0" "<public server ip>"
<reverse proxy ip> - - [27/May/2020:08:09:43 +0000] "POST /apps/text/session/sync HTTP/1.0" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "<public server ip>"
<reverse proxy ip> - twatzl [27/May/2020:08:09:45 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications?format=json HTTP/1.0" 304 0 "-" "Mozilla/5.0 (Windows) mirall/2.6.4stable-Win64 (build 20200303) (Nextcloud)" "<public server ip>"
<reverse proxy ip> - - [27/May/2020:08:09:49 +0000] "POST /apps/text/session/sync HTTP/1.0" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "<public server ip>"
<reverse proxy ip> - twatzl [27/May/2020:08:09:51 +0000] "GET /ocs/v1.php/cloud/user?format=json HTTP/1.0" 200 554 "-" "Mozilla/5.0 (Windows) mirall/2.6.4stable-Win64 (build 20200303) (Nextcloud)" "<public server ip>"
<reverse proxy ip> - twatzl [27/May/2020:08:09:51 +0000] "GET /remote.php/dav/avatars/twatzl/128.png HTTP/1.0" 200 729 "-" "Mozilla/5.0 (Windows) mirall/2.6.4stable-Win64 (build 20200303) (Nextcloud)" "<public server ip>"
<reverse proxy ip> - - [27/May/2020:08:09:55 +0000] "POST /apps/text/session/sync HTTP/1.0" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "<public server ip>"
<reverse proxy ip> - - [27/May/2020:08:10:01 +0000] "POST /apps/text/session/sync HTTP/1.0" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "<public server ip>"
<reverse proxy ip> - - [27/May/2020:08:10:07 +0000] "POST /apps/text/session/sync HTTP/1.0" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "<public server ip>"
<reverse proxy ip> - twatzl [27/May/2020:08:10:08 +0000] "PROPFIND /remote.php/dav/files/twatzl/Bilder HTTP/1.0" 207 374 "-" "Mozilla/5.0 (Windows) mirall/2.6.2stable-Win64 (build 20191224) (Nextcloud)" "<public server ip>"
<reverse proxy ip> - - [27/May/2020:08:10:11 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.0" 200 5208 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0" "<public server ip>"
<reverse proxy ip> - - [27/May/2020:08:10:13 +0000] "POST /apps/text/session/sync HTTP/1.0" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "<public server ip>"
<reverse proxy ip> - - [27/May/2020:08:10:19 +0000] "POST /apps/text/session/sync HTTP/1.0" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "<public server ip>"
<reverse proxy ip> - twatzl [27/May/2020:08:10:21 +0000] "PROPFIND /remote.php/dav/files/twatzl/ HTTP/1.0" 207 387 "-" "Mozilla/5.0 (Windows) mirall/2.6.2stable-Win64 (build 20191224) (Nextcloud)" "<public server ip>"
<reverse proxy ip> - twatzl [27/May/2020:08:10:21 +0000] "GET /ocs/v1.php/cloud/user?format=json HTTP/1.0" 200 554 "-" "Mozilla/5.0 (Windows) mirall/2.6.4stable-Win64 (build 20200303) (Nextcloud)" "<public server ip>"
<reverse proxy ip> - twatzl [27/May/2020:08:10:22 +0000] "GET /remote.php/dav/avatars/twatzl/128.png HTTP/1.0" 200 729 "-" "Mozilla/5.0 (Windows) mirall/2.6.4stable-Win64 (build 20200303) (Nextcloud)" "<public server ip>"
<reverse proxy ip> - - [27/May/2020:08:10:25 +0000] "POST /apps/text/session/sync HTTP/1.0" 200 328 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "<public server ip>"
<reverse proxy ip> - - [27/May/2020:08:10:30 +0000] "GET /apps/logreader/get?offset=92&count=8&levels=11111 HTTP/1.0" 200 27372 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "<public server ip>"

nextcloud_app logs:

...
<nextcloud_web ip> - twatzl 27/May/2020:08:09:10 +0000 "PROPFIND /remote.php" 207
<nextcloud_web ip> - twatzl 27/May/2020:08:09:11 +0000 "MOVE /remote.php" 400
<nextcloud_web ip> - twatzl 27/May/2020:08:09:11 +0000 "PROPFIND /remote.php" 207
<nextcloud_web ip> - twatzl 27/May/2020:08:09:11 +0000 "MOVE /remote.php" 400
<nextcloud_web ip> - twatzl 27/May/2020:08:09:11 +0000 "PROPFIND /remote.php" 207
<nextcloud_web ip> - twatzl 27/May/2020:08:09:11 +0000 "MOVE /remote.php" 400
<nextcloud_web ip> -  27/May/2020:08:09:11 +0000 "GET /ocs/v2.php" 200
<nextcloud_web ip> -  27/May/2020:08:09:13 +0000 "POST /index.php" 200
<nextcloud_web ip> -  27/May/2020:08:09:19 +0000 "POST /index.php" 200
<nextcloud_web ip> - twatzl 27/May/2020:08:09:21 +0000 "GET /ocs/v1.php" 200
<nextcloud_web ip> - twatzl 27/May/2020:08:09:21 +0000 "GET /remote.php" 200
<nextcloud_web ip> -  27/May/2020:08:09:25 +0000 "POST /index.php" 200
<nextcloud_web ip> -  27/May/2020:08:09:31 +0000 "POST /index.php" 200
<nextcloud_web ip> -  27/May/2020:08:09:37 +0000 "POST /index.php" 200
<nextcloud_web ip> -  27/May/2020:08:09:41 +0000 "GET /ocs/v2.php" 200
<nextcloud_web ip> -  27/May/2020:08:09:43 +0000 "POST /index.php" 200
<nextcloud_web ip> - twatzl 27/May/2020:08:09:45 +0000 "GET /ocs/v2.php" 304
<nextcloud_web ip> -  27/May/2020:08:09:49 +0000 "POST /index.php" 200
<nextcloud_web ip> - twatzl 27/May/2020:08:09:51 +0000 "GET /ocs/v1.php" 200
<nextcloud_web ip> - twatzl 27/May/2020:08:09:51 +0000 "GET /remote.php" 200
<nextcloud_web ip> -  27/May/2020:08:09:55 +0000 "POST /index.php" 200
<nextcloud_web ip> -  27/May/2020:08:10:01 +0000 "POST /index.php" 200
<nextcloud_web ip> -  27/May/2020:08:10:07 +0000 "POST /index.php" 200
<nextcloud_web ip> - twatzl 27/May/2020:08:10:07 +0000 "PROPFIND /remote.php" 207
<nextcloud_web ip> -  27/May/2020:08:10:11 +0000 "GET /ocs/v2.php" 200
<nextcloud_web ip> -  27/May/2020:08:10:13 +0000 "POST /index.php" 200
<nextcloud_web ip> -  27/May/2020:08:10:19 +0000 "POST /index.php" 200
<nextcloud_web ip> - twatzl 27/May/2020:08:10:21 +0000 "PROPFIND /remote.php" 207
<nextcloud_web ip> - twatzl 27/May/2020:08:10:21 +0000 "GET /ocs/v1.php" 200
<nextcloud_web ip> - twatzl 27/May/2020:08:10:22 +0000 "GET /remote.php" 200
<nextcloud_web ip> -  27/May/2020:08:10:25 +0000 "POST /index.php" 200
<nextcloud_web ip> -  27/May/2020:08:10:30 +0000 "GET /index.php" 200

So after some more investigation what I suspect to happen is the following:

The nextcloud client uploads the file to /dav/uploads///.file and afterwards tries to move the files. However for the failing files I cannot find the corresponding folder in the webdav directory.

However strangely enough some of the files seem to synchronize just fine now, while others still fail.

I followed the docs here:

https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html?highlight=nginx#nextcloud-in-the-webroot-of-nginx

I suspect somehting in this process fails:
https://docs.nextcloud.com/server/stable/developer_manual/client_apis/WebDAV/chunking.html

Any help would be apreciated. Right now I run out of ideas where I could look for useful log messages.

Edit: But even saying that, some of the files that were successfully synced were 23MB in size… So what the hell is going on here?

So I finally managed to fix this issue after trobleshooting now well over 8 hours in total.

My nextcloud_web nginx config was missing the following line:

client_body_temp_path /var/nginx_client_bodies;

and in .user.ini I added the following value:

upload_tmp_dir = /var/big_temp_file/

It seems for whatever reason these are required, but it is nowhere mentioned that they are. Might also be the case that only one of them is required, but I have enough for now :smiley:

1 Like

thanks for all the effort you put into here… and then sharing the solution with us here…

1 Like