You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an rclone WebDAV server (rclone serve webdav ...) running behind an HTTPS reverse proxy. This server works with the DavX5 client but appears to fail with the internal Seedvault WebDAV client.
Steps to reproduce
Steps to reproduce are a bit fiddly because you need a trusted HTTPS front-end in front of the rclone server. I can privately provide a server for testing if that's useful.
After setting up the server and entering any auth details, then tapping "Use WebDAV Cloud" there is an immediate HTTP 405 (Method Not Allowed) error shown. Logcat shows:
01-28 09:25:02.387 21197 21240 D a.g.s.c.b.w.WebDavBackend: [DefaultDispatcher-worker-6] test() = [1, 2] Response{protocol=h2, code=200, message=, url=https://HOST/my/webdav/}
01-28 09:25:02.396 21197 21240 E WebDavHandler: Error testing WebDAV config at https://HOST/my/webdav/
01-28 09:25:02.396 21197 21240 E WebDavHandler: at.bitfire.dav4jvm.exception.HttpException: HTTP 405
01-28 09:25:02.396 21197 21240 E WebDavHandler: at at.bitfire.dav4jvm.DavResource.checkStatus(DavResource.kt:650)
01-28 09:25:02.396 21197 21240 E WebDavHandler: at at.bitfire.dav4jvm.DavResource.checkStatus(DavResource.kt:624)
01-28 09:25:02.396 21197 21240 E WebDavHandler: at at.bitfire.dav4jvm.DavResource.head(DavResource.kt:296)
01-28 09:25:02.396 21197 21240 E WebDavHandler: at app.grapheneos.seedvault.core.backends.webdav.WebDavHelperKt.ensureFoldersExist(WebDavHelper.kt:92)
01-28 09:25:02.396 21197 21240 E WebDavHandler: at app.grapheneos.seedvault.core.backends.webdav.WebDavBackend.test(WebDavBackend.kt:101)
01-28 09:25:02.396 21197 21240 E WebDavHandler: at com.stevesoltys.seedvault.backend.webdav.WebDavHandler.onConfigReceived(WebDavHandler.kt:59)
01-28 09:25:02.396 21197 21240 E WebDavHandler: at com.stevesoltys.seedvault.ui.storage.StorageViewModel$onWebDavConfigReceived$1.invokeSuspend(StorageViewModel.kt:101)
01-28 09:25:02.396 21197 21240 E WebDavHandler: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
01-28 09:25:02.396 21197 21240 E WebDavHandler: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
01-28 09:25:02.396 21197 21240 E WebDavHandler: at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
01-28 09:25:02.396 21197 21240 E WebDavHandler: at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
01-28 09:25:02.396 21197 21240 E WebDavHandler: at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
01-28 09:25:02.396 21197 21240 E WebDavHandler: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
01-28 09:25:02.396 21197 21240 E WebDavHandler: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
01-28 09:25:02.396 21197 21240 E WebDavHandler: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
rclone debug log shows two requests:
Jan 28 10:21:10 host webdav[879352]: 2025/01/27 23:21:10 INFO : /my/webdav/: OPTIONS from 127.0.0.1:58044
Jan 28 10:21:10 host webdav[879352]: 2025/01/27 23:21:10 DEBUG : /.SeedVaultAndroidBackup: OpenFile: flags=O_RDONLY, perm=----------
Jan 28 10:21:10 host webdav[879352]: 2025/01/27 23:21:10 DEBUG : /.SeedVaultAndroidBackup: >OpenFile: fd=.SeedVaultAndroidBackup/ (r), err=<nil>
Jan 28 10:21:10 host webdav[879352]: 2025/01/27 23:21:10 INFO : /my/webdav/.SeedVaultAndroidBackup: HEAD from 127.0.0.1:58044
Also visible in the the reverse proxy log which shows the OPTIONS request succeeds and then the HEAD fails:
I believe the problem is that the collection URL generated in the ensureFoldersExist helper function (in this case /my/webdav/.SeedVaultAndroidBackup) is missing a trailing slash. RFC4198 says WebDAV servers can optionally handle a request formatted this way:
There is a standing convention that when a collection is referred to
by its name without a trailing slash, the server MAY handle the
request as if the trailing slash were present.
[...]
In general, clients SHOULD use the trailing slash form of
collection names.
My reading is that what Rclone does is technically RFC compliant, although also uncommon.
This could also be considered as a bug in the dav4jvm DavCollection class (which uses the supplied collection URL verbatim, where it arguably could check and append the trailing slash). If so then I'm happy to open an issue there, instead.
The text was updated successfully, but these errors were encountered:
I have an rclone WebDAV server (
rclone serve webdav ...
) running behind an HTTPS reverse proxy. This server works with the DavX5 client but appears to fail with the internal Seedvault WebDAV client.Steps to reproduce
Steps to reproduce are a bit fiddly because you need a trusted HTTPS front-end in front of the rclone server. I can privately provide a server for testing if that's useful.
After setting up the server and entering any auth details, then tapping "Use WebDAV Cloud" there is an immediate HTTP 405 (Method Not Allowed) error shown. Logcat shows:
rclone debug log shows two requests:
Also visible in the the reverse proxy log which shows the OPTIONS request succeeds and then the HEAD fails:
Possible root cause
I believe the problem is that the collection URL generated in the
ensureFoldersExist
helper function (in this case/my/webdav/.SeedVaultAndroidBackup
) is missing a trailing slash. RFC4198 says WebDAV servers can optionally handle a request formatted this way:However, Rclone instead uses the presence of a trailing slash as an indication that a request is for a collection when handling GET and HEAD: https://github.com/rclone/rclone/blob/master/cmd/serve/webdav/webdav.go#L332
I can see the behaviour locally with curl, running
mkdir testdir; rclone -vv serve webdav $PWD
My reading is that what Rclone does is technically RFC compliant, although also uncommon.
This could also be considered as a bug in the dav4jvm
DavCollection
class (which uses the supplied collection URL verbatim, where it arguably could check and append the trailing slash). If so then I'm happy to open an issue there, instead.The text was updated successfully, but these errors were encountered: