Code 500 errors with webdav (Nextcloud)


#1

I hope this is not a bug with rclone but a problem with my setup. I get these errors messages whenever I try to sync files to my server:

2019-01-22 18:13:42 ERROR : file.txt: Failed to copy: Error while copying file to target location (copied bytes: 0, expected filesize: 0 ): Sabre\DAV\Exception: 500 Internal Server Error
2019-01-22 18:13:45 ERROR : otherfile.txt: Failed to copy: Error while copying file to target location (copied bytes: 0, expected filesize: 0 ): Sabre\DAV\Exception: 500 Internal Server Error
2019-01-22 18:13:45 ERROR : anotherfile.txt: Failed to copy: Error while copying file to target location (copied bytes: 0, expected filesize: 0 ): Sabre\DAV\Exception: 500 Internal Server Error

These files are empty so I kind of understand the error message but I’m not sure why it makes rclone fail.

Help will be appreciated, thanks.


#2

Can you sync non-zero sized files?

Which server are you using?

Can you upload a single 0 byte file and paste the log with -vv --dump bodies --retries 1?

You can skip zero sized files with --min-size 1b


#3

I’m using Nginx and I can sync non-zero sized files. --min-size 1b is a good workaround, didn’t find it easily in the docs. I’ve created an empty.txt file and I tried to sync only it with rclone empty.txt nextcloud:/empty.txt but I got:

2019/01/23 09:24:18 Can't limit to single files when using filters: /home/doron/documents/empty.txt

So I created a directory with only this file in it called rclone-test and ran rclone rclone-test nextcloud:/rclone-test and I got a lot of debug messages available in this gist.


#4

I see the problem I think…

Try this

https://beta.rclone.org/branch/v1.45-101-g4c8a7bd3-fix-rest-zero-length-beta/ (uploaded in 15-30 mins)


#5

Sorry for the delay but here’s the gist.

EDIT: Updated link.


#6

I can see from the log that it now has the Content-Length header now which is good.

That didn’t fix the problem though…

I can only think it is a bug in the server. Which server is it?


#7

Nginx running on Arch Linux on a VPS.


#8

I think your suspicion is correct: https://github.com/nextcloud/server/issues/13276 .


#9

I merged the fix above since I think it is a good one anyway…

Ah! Looks like this has been fixed and will be in nextcloud 16


#10

Correct, thanks for your help!