rclone: WebDAV: Redirects for metadata queries are interpreted as "file not found"
I’m using XRootD as WebDAV server, and encountered an issue with RClone.
XRootD allows clustering of several servers. For example, in our setup, we have one load-balancing redirector in front (which is the entry point) and several other servers behind. Since all these servers export the same file system and the redirector does neither need nor have access to the filesystem, it delegates metadata queries to the dedicated endpoints. In short, the role of the redirector (which measures the load of the other servers) is purely to check authentication / authorization and then find the least used server, and redirect there.
So this means the first PROPFIND is replied to with 302 Redirect. It seems that rclone then immediately gives up, assuming the file does not exist:
Is this restriction on purpose, or could it be loosened?
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 3
- Comments: 15 (6 by maintainers)
To change this we’d have to look at why it is like that.
Can you look back through the history to find the relevant issues?
I remember making a go bug report about this too so it may not be easy to fix.
https://github.com/golang/go/issues/41377
So the go stdlib changes the PROPGET into a GET on 302 redirects which will break stuff.
If we can fix it and not break other WebDAV backend then I’m all for that.
Looks like I’m running into the same issue with PhotoPrism WebDAV server running behind a Traefik reverse proxy. The other WebDAV clients I’ve tried work well with this setup, but
rclonegoes belly-up withTo simplify the example, I tried
rclone copynext — and this fails duringPROPFIND, since it does not follow the redirect, i.e. in short:I’m confused — it seems
rclone mountPROPFINDcalls follow307redirects, butrclone copyPROPFINDcalls error out when getting307. If I read the code correctly, any redirects are blocked byNoRedirectindependent of status code forPROPFINDas-is. Is this on purpose?Going the ugly route (due to my limited
goknowledge to do this right…) and replacing:fixes the
PROPFINDcalls when usingrclone copy, so these now follow307redirects as expected. ButPUTstill fails to follow redirects, and I do not understand why.So I’m unsure how a server which has to redirect (since it holds neither data nor metadata) should respond for
rcloneto follow along the redirect.I will, thanks for pointing to the Go bugreport! This was an interesting read indeed. Similar to your conclusion, I am not sure I can derive an argument which is compelling enough to change the server-side implementation, especially since it is used for many petabytes of data transfers for decades (in some cases, with multi-tiered redirections), and none of the other existing clients (davix, gfal, curl etc.) have similar behaviour, so they may be afraid to break other clients by changing the server-side behaviour.
I think I will proceed in two stages:
may be compelling to at least consider it.
The latter may also allow me to find out why your proposal to:
was not implemented, maybe there was a reason not go this way.