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

HTTP 412 Precondition failed with surf.nl WebDAV server #863

Open
grote opened this issue Feb 5, 2025 · 1 comment
Open

HTTP 412 Precondition failed with surf.nl WebDAV server #863

grote opened this issue Feb 5, 2025 · 1 comment
Labels
needs info Requires more information from reporter research

Comments

@grote
Copy link
Collaborator

grote commented Feb 5, 2025

02-05 09:04:25.802 16218 16251 E AppBackupWorker: java.io.IOException: Error listing https://surfdrive.surf.nl/files/remote.php/webdav/.SeedVaultAndroidBackup/foobar/
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	at org.calyxos.seedvault.core.backends.webdav.WebDavBackend.list(WebDavBackend.kt:284)
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	at com.stevesoltys.seedvault.repo.AppBackupManager.beforeBackup(AppBackupManager.kt:64)
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	at com.stevesoltys.seedvault.worker.AppBackupWorker.doBackup(AppBackupWorker.kt:156)
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	at com.stevesoltys.seedvault.worker.AppBackupWorker.doWork(AppBackupWorker.kt:134)
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	at com.stevesoltys.seedvault.worker.AppBackupWorker$doWork$1.invokeSuspend(Unknown Source:14)
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
02-05 09:04:25.802 16218 16251 E AppBackupWorker: Caused by: at.bitfire.dav4jvm.exception.PreconditionFailedException: HTTP 412 Precondition failed
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	at at.bitfire.dav4jvm.DavResource.checkStatus(DavResource.kt:646)
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	at at.bitfire.dav4jvm.DavResource.checkStatus(DavResource.kt:624)
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	at at.bitfire.dav4jvm.DavResource.processMultiStatus(DavResource.kt:741)
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	at at.bitfire.dav4jvm.DavResource.propfind(DavResource.kt:550)
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	at org.calyxos.seedvault.core.backends.webdav.WebDavHelperKt.propfindDepthInfinity(WebDavHelper.kt:36)
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	at org.calyxos.seedvault.core.backends.webdav.WebDavBackend.list(WebDavBackend.kt:195)
02-05 09:04:25.802 16218 16251 E AppBackupWorker: 	... 10 more
@grote grote added the needs info Requires more information from reporter label Feb 5, 2025
@grote
Copy link
Collaborator Author

grote commented Feb 5, 2025

It could be that returning 412 is this server's strange way of telling us that it doesn't support the request header Depth: infinity.

If we had such a server to test, we could try adding 412 to:

private fun HttpException.isUnsupportedPropfind(): Boolean {
// nginx is not including 'propfind-finite-depth' in body, so just relay on code
return code == 403 || code == 400 // dufs returns 400
}

@grote grote added the research label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info Requires more information from reporter research
Projects
None yet
Development

No branches or pull requests

1 participant