Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAVx5 backups fail with rclone and apache2 #503

Closed
khimaros opened this issue Jan 14, 2023 · 6 comments
Closed

DAVx5 backups fail with rclone and apache2 #503

khimaros opened this issue Jan 14, 2023 · 6 comments

Comments

@khimaros
Copy link

khimaros commented Jan 14, 2023

rclone: the server crashes during backup, usually around 30% of the way through rclone/rclone#6695 -- it makes more progress than any of the other methods but cannot complete a backup.

apache2 mod_dav_fs: has two failure modes:

  • 301 Moved Permanently redirects are not handled correctly by DAVx5. apache2 returns 301 redirect response to PROPFIND directory requests if the requests is missing a trailing slash. SeedVault/DAVx5 sends PROPFIND /.SeedVaultAndroidBackup and apache2 returns a 301 redirect to /.SeedVaultAndroidBackup/ -- this problem can be worked around with BrowserMatch "^DAVx5/" redirect-carefully in the apache2 config. see also: follow 301 redirects bitfireAT/davx5-ose#253
  • SeedVault/DAVx5 attempts to MKCOL /.SeedVaultAndroidBackup multiple times, even when the PROPFIND /.SeedVaultAndroidBackup returns a 207. subsequent MKCOL requests return a 405 Method Not Allowed response which causes the backup to abort. see also: [WebDAV] avoid MKCOL on directory that already exists bitfireAT/davx5-ose#254

radicale: i believe is "working as intended" -- it supports CardDAV and CalDAV but not plain WebDAV.

@khimaros
Copy link
Author

here's a bit more detail from apache2 logs:

[14/Jan/2023:01:05:34 +0000] "MKCOL /blobs/.SeedVaultAndroidBackup HTTP/2.0" 201 239 "-" "DAVx5/4.2.6-ose (2022/12/12; dav4jvm; okhttp/4.10.0) Android/13" 152 0.021 0.020 . -
[14/Jan/2023:01:05:34 +0000]  "PROPFIND /blobs/.SeedVaultAndroidBackup HTTP/2.0" 207 815 "-" "DAVx5/4.2.6-ose (2022/12/12; dav4jvm; okhttp/4.10.0) Android/13" 526 0.018 0.020 . -
[14/Jan/2023:01:05:34 +0000] "PUT /blobs/.SeedVaultAndroidBackup/.nomedia HTTP/2.0" 201 246 "-" "DAVx5/4.2.6-ose (2022/12/12; dav4jvm; okhttp/4.10.0) Android/13" 162 0.044 0.040 . -
[14/Jan/2023:01:05:34 +0000] "PROPFIND /blobs/.SeedVaultAndroidBackup HTTP/2.0" 207 1403 "-" "DAVx5/4.2.6-ose (2022/12/12; dav4jvm; okhttp/4.10.0) Android/13" 526 0.046 0.048 . -
[14/Jan/2023:01:05:34 +0000] "MKCOL /blobs/.SeedVaultAndroidBackup/1673656571251 HTTP/2.0" 201 253 "-" "DAVx5/4.2.6-ose (2022/12/12; dav4jvm; okhttp/4.10.0) Android/13" 162 0.051 0.048 . -
[14/Jan/2023:01:05:35 +0000] "PROPFIND /blobs/.SeedVaultAndroidBackup/1673656571251 HTTP/2.0" 207 829 "-" "DAVx5/4.2.6-ose (2022/12/12; dav4jvm; okhttp/4.10.0) Android/13" 536 0.018 0.016 . -
[14/Jan/2023:01:05:35 +0000] "MKCOL /blobs/.SeedVaultAndroidBackup HTTP/2.0" 405 222 "-" "DAVx5/4.2.6-ose (2022/12/12; dav4jvm; okhttp/4.10.0) Android/13" 152 0.047 0.044 . -
<backup aborts>

@khimaros
Copy link
Author

i have a theory as to why this might be happening.

may not be matching due to the redirect issue mentioned above:

$ curl --basic -u <name> -H 'Depth: 1' -X PROPFIND 'https://<host>/.SeedVaultAndroidBackup'
<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response xmlns:lp1="DAV:" xmlns:lp2="http://apache.org/dav/props/">
<D:href>/.SeedVaultAndroidBackup/</D:href>

in other words, solving the trailing slash problem may solve both problems.

@khimaros
Copy link
Author

hmm, the above only seems to be used for the .sv directories, so maybe not relevant here. this seems more relevant:

parent.createOrGetDirectory(context, DIRECTORY_ROOT).apply {

the solution may be as simple as appending a directory separator to DocumentFile.createOrGetDirectory() and DocumentFile.createOrGetFile() here:

it may also be possible to fix this by modifying DocumentFile.findFileBlocking(), but the name matching in the two other functions may still get in the way:

@grote
Copy link
Collaborator

grote commented Jan 17, 2023

Related to #500

@grote grote changed the title WebDAV backups fail with rclone, apache2, and radicale servers DAVx5 backups fail with rclone and apache2 Jan 17, 2023
@grote
Copy link
Collaborator

grote commented Sep 24, 2024

@khimaros did you try our new built-in WebDav functionality? Please re-open if it presents the same issues.

@grote grote closed this as completed Sep 24, 2024
@khimaros
Copy link
Author

khimaros commented Oct 9, 2024

the DAVx5 method now seems to work with apache2 mod_webdav_fs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants