(StatusCodeException (Response {responseStatus = Status {statusCode = 405, statusMessage = "Method Not Allowed"}, responseVersion = HTTP/1.1, responseHeaders = [("Date","Sun, 07 Oct 2018 17:56:27 GMT"),("Server","Apache"),("Strict-Transport-Security","max-age=15768000"),("Allow","HEAD,HEAD,GET,HEAD,POST,OPTIONS"),("Content-Length","292"),("Content-Type","text/html; charset=iso-8859-1")], responseBody = (), responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}) "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>405 Method Not Allowed</title>\n</head><body>\n<h1>Method Not Allowed</h1>\n<p>The requested method MKCOL is not allowed for the URL /index.html.</p>\n<hr>\n<address>Apache Server at example.net Port 443</address>\n</body></html>\n"): user error
failed
git-annex: initremote: 1 failed
I have tried with and without chunking and with and without extra
paths (existing or not) in the `url` parameter.
I was able to successfully use `rclone` to configure the remote, with
copy test.txt 2018/10/07 13:31:45 ERROR : : error listing: directory not found 2018/10/07 13:31:45 Failed to size: directory not found
(to rclone...)
ok
(recording state in git...)
The error message is actually just a warning and the directory is
created automatically. I checked and the file is present on the remote so rclone (and therefore webdav) works. Thunar can also browse the host as a Webdav remote without problems.
Unfortunately, the rclone remote doesn't support [[git-annex-export]]
which makes it unusable for my use case (a publicly visible gallery
instead of a backup).
### What version of git-annex are you using? On what operating system?
The server is running Nextcloud 14 on Debian stable, I assume. I have checked and Nextcloud definitely [supports](https://docs.nextcloud.com/server/12/developer_manual/client_apis/WebDAV/index.html) the MKCOL verb.
### Please provide any additional information below.
Here's the debug output when creating the remote. It seems it fails on
the `MKCOL` verb, which is denied by the server:
[[!format sh """
# If you can, paste a complete transcript of the problem occurring here.
# If the problem is with the git-annex assistant, paste in .git/annex/daemon.log
(StatusCodeException (Response {responseStatus = Status {statusCode = 405, statusMessage = "Method Not Allowed"}, responseVersion = HTTP/1.1, responseHeaders = [("Date","Sun, 07 Oct 2018 17:22:33 GMT"),("Server","Apache"),("Strict-Transport-Security","max-age=15768000"),("Allow","HEAD,HEAD,GET,HEAD,POST,OPTIONS"),("Content-Length","292"),("Content-Type","text/html; charset=iso-8859-1")], responseBody = (), responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}) "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>405 Method Not Allowed</title>\n</head><body>\n<h1>Method Not Allowed</h1>\n<p>The requested method MKCOL is not allowed for the URL /index.html.</p>\n<hr>\n<address>Apache Server at example.net Port 443</address>\n</body></html>\n"): user error
failed
[2018-10-07 13:22:33.235310398] process done ExitSuccess
[2018-10-07 13:22:33.235869777] process done ExitSuccess
git-annex: initremote: 1 failed
# End of transcript or log.
"""]]
Notice how the server is hosted on a subdirectory of `example.net` (a placeholder name of course, my hosting provide wants to stay private ;). Maybe that's the problem? The error message says `MKCOL is not allowed for the URL /index.html`, so that is probably `example.net/index.html` responding. I suspect it's failing to do `getProps /` right before and assumes the WebDAV server does not have a root directory (which makes no sense - the Nextcloud server endpoint is actually at `/nextcloud/remote.php/webdav`). I would argue that `getProps /` should never fail or rather, we should *assume* the server is hosted in a subdirectory in that case.
Incidentally, the [[tips/owncloudannex]] remote also [fails](https://github.com/TobiasTheViking/owncloudannex/issues/5), but at the upload stage - it gives a 500 error message. But since it doesn't support the `exporttree` functionality, it's out of the question here as well.