# Code 500 errors with webdav (Nextcloud)

**URL:** <https://forum.rclone.org/t/code-500-errors-with-webdav-nextcloud/8440>\
**Category:** Suspected Bug\
**Created:** [January 22, 2019, 4:21pm UTC](https://forum.rclone.org/t/code-500-errors-with-webdav-nextcloud/8440 "2019-01-22T16:21:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![doronbehar](https://forum.rclone.org/user_avatar/forum.rclone.org/doronbehar/32/15308_2.png) [@doronbehar](https://forum.rclone.org/u/doronbehar)\
**Post date:** [January 22, 2019, 4:21pm UTC](https://forum.rclone.org/t/code-500-errors-with-webdav-nextcloud/8440/1 "2019-01-22T16:21:11Z")

</div>

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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [January 22, 2019, 8:06pm UTC](https://forum.rclone.org/t/code-500-errors-with-webdav-nextcloud/8440/2 "2019-01-22T20:06:05Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![doronbehar](https://forum.rclone.org/user_avatar/forum.rclone.org/doronbehar/32/15308_2.png) [@doronbehar](https://forum.rclone.org/u/doronbehar)\
**Post date:** [January 23, 2019, 8:12am UTC](https://forum.rclone.org/t/code-500-errors-with-webdav-nextcloud/8440/3 "2019-01-23T08:12:36Z")

</div>

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:

```auto
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](https://gist.github.com/6aeec4a926c7fffac36b433828ce19f0).

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [January 23, 2019, 11:02am UTC](https://forum.rclone.org/t/code-500-errors-with-webdav-nextcloud/8440/4 "2019-01-23T11:02:41Z")

</div>

I see the problem I think…

Try this

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

---

<div class="post-metadata">

**Author:** ![doronbehar](https://forum.rclone.org/user_avatar/forum.rclone.org/doronbehar/32/15308_2.png) [@doronbehar](https://forum.rclone.org/u/doronbehar)\
**Post date:** [January 23, 2019, 7:53pm UTC](https://forum.rclone.org/t/code-500-errors-with-webdav-nextcloud/8440/5 "2019-01-23T19:53:22Z")

</div>

Sorry for the delay but here’s the [gist](https://gist.github.com/doronbehar/37c46eb11876cf79d6b9ff12607511eb).

EDIT: Updated link.

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [January 23, 2019, 8:41pm UTC](https://forum.rclone.org/t/code-500-errors-with-webdav-nextcloud/8440/6 "2019-01-23T20:41:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![doronbehar](https://forum.rclone.org/user_avatar/forum.rclone.org/doronbehar/32/15308_2.png) [@doronbehar](https://forum.rclone.org/u/doronbehar)\
**Post date:** [January 24, 2019, 5:05am UTC](https://forum.rclone.org/t/code-500-errors-with-webdav-nextcloud/8440/7 "2019-01-24T05:05:01Z")

</div>

Nginx running on Arch Linux on a VPS.

---

<div class="post-metadata">

**Author:** ![doronbehar](https://forum.rclone.org/user_avatar/forum.rclone.org/doronbehar/32/15308_2.png) [@doronbehar](https://forum.rclone.org/u/doronbehar)\
**Post date:** [January 24, 2019, 7:57am UTC](https://forum.rclone.org/t/code-500-errors-with-webdav-nextcloud/8440/8 "2019-01-24T07:57:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [January 24, 2019, 11:39am UTC](https://forum.rclone.org/t/code-500-errors-with-webdav-nextcloud/8440/9 "2019-01-24T11:39:15Z")

</div>

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

> [@doronbehar](#):
>
> I think your suspicion is correct: [Can't upload empty file when encryption app is enabled · Issue #13276 · nextcloud/server · GitHub](https://github.com/nextcloud/server/issues/13276) .

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

---

<div class="post-metadata">

**Author:** ![doronbehar](https://forum.rclone.org/user_avatar/forum.rclone.org/doronbehar/32/15308_2.png) [@doronbehar](https://forum.rclone.org/u/doronbehar)\
**Post date:** [January 24, 2019, 6:32pm UTC](https://forum.rclone.org/t/code-500-errors-with-webdav-nextcloud/8440/10 "2019-01-24T18:32:54Z")

</div>

Correct, thanks for your help!

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [March 4, 2020, 12:51am UTC](https://forum.rclone.org/t/code-500-errors-with-webdav-nextcloud/8440/11 "2020-03-04T00:51:22Z")

</div>

Closed on March 4, 2020, 12:51am UTC


