WebDAV upload does not work with Nextcloud

UpdraftPlus Home Forums Paid support forum – UpdraftPlus backup plugin WebDAV upload does not work with Nextcloud

  • This topic has 4 replies, 2 voices, and was last updated 1 week ago by Vanessa.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2318277
    Thomas Low
    Participant

    Hi UpdraftPlus-Team,

    I manage a WordPress instance that uses UpdraftPlus to upload its backup to a managed Nextcloud (Hetzner).

    Since about two weeks ago, the upload fails with the following error message:

    0040.334 (0) WebDAV: Enable chunked upload: yes
    0040.335 (0) WebDAV: Upload chunk size: successfully changed to 2097152 bytes
    0040.889 (0) WebDAV: Unexpected HTTP response code (400): 400 (Bad Request. The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, size too large, invalid request message framing, or deceptive request routing).)
    0040.889 (0) WebDAV: Chunk 1: A write error occurred
    0040.890 (0) WebDAV: ERROR: WebDAV: Failed to upload file: ...

    You can replicate the problem with the official Docker Nextcloud images 29 and 28. In Nextcloud 28 the upload works, in 29 the upload fails. There is no error message in Nextcloud. Other WebDAV clients work without any issues.

    UpdraftPlus: 2.24.11.1
    WordPress: 6.7.1

    Best regards,
    Thomas

    #2318278
    Thomas Low
    Participant
    This reply has been marked as moderator-only.
    #2318579
    Vanessa
    Moderator

    Can you try reducing your archive split to 50 MB in settings >> show expert settings >> split archives every
    Can you then run a backup and post the log using a tools such as pastebin.com?

    #2318717
    Thomas Low
    Participant

    Hello UpdraftPlus-Team,

    I traced the problem to the following error message from sabre dav in Nextcloud, which is only visible when debug logging is enabled in Nextcloud:

    BadRequest Content-Range on PUT requests are forbidden.

    In the UpdraftPlus “webdav.php”, this Content-Range HTTP header is only set if the option “Split uploads into chunks” is enabled.

    I disabled this option, and now the upload works again.

    As far as I know, we always had this option enabled without any apparent issues. However, in previous UpdraftPlus log files, I could find messages reporting that a failed “chunked” upload was tried again automatically and succeeded:

    0059.329 (0) WebDAV: Enable chunked upload: yes
    0059.329 (0) WebDAV: Upload chunk size: successfully changed to 2097152 bytes
    0059.812 (0) WebDAV: WebDAV server returned 400 due to Content-Range issue; will try all-at-once method
    0061.716 (0) WebDAV: WebDAV: All-in-one write succeeded

    I guess something changed such that your plugin doesn’t detect the Content-Range issue any more. Because of that, the upload fails.

    Anyway, my problem is solved now.

    Best regards
    Thomas

    #2319407
    Vanessa
    Moderator

    Hi,

    Thank you for the update
    In this guide: https://updraftplus.com/hacking-updraftplus/
    You can also use “UPDRAFTPLUS_WEBDAV_NEVER_CHUNK” in the wp-config to stop the files being sent in chunks;

    “UPDRAFTPLUS_WEBDAV_NEVER_CHUNK: When using WebDAV, don’t attempt to send the backup file(s) in chunks – instead, send it all in one go. (Apache’s mod_dav supports chunks; most other WebDAV servers don’t, and occasionally there’s an exotic one that doesn’t manage to even send a useful error code back so that UpdraftPlus can respond – in that case, this define can be useful).”

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.