-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Nginx WedDAV Sync Problem #808
Comments
Looks like about the same bug to me, which was fixed at version 1.0 and then reverted as it broke something else. I just version locked to the "good" versions and moved on, there should be sufficient documentation for someone else to progress another fix that incorporates both interpretations of the underlying standards. |
Thanks. I downloaded v1.0.100 and it works with nginx WebDAV! Updating the docs to warn people of this issue with nginx could be useful. Is it worth leaving this issue open then? |
We can leave it open till someone finds a real fix. |
So do we have a regression? |
In case it is useful, when I tried to use nginx WebDAV, I discovered that it does not send correct error responses (for instance when a file is missing). It sends generic-ish 404s rather than the XML formatted response that box.com and wsgidav do. Based on my memory of the error logs, this was the most likely problem. It is therefore likely that this is a nginx bug rather than a Joplin one, though it may be worth having someone confirm my information. With all that said however, I have no idea how it was working for you in the first place. I now use wsgidav behind a nginx reverse proxy. |
Isn't it possible to add the solution/workaround from 1.0.100 as a separate synchronisation-target? |
Based on what I remember seeing, it's likely that it would not even need to be a separate target. The webdav library (if any) would simply have to be hacked to accept a 404 as a "Not Found" response. |
What's wrong with using this hack until there is a nicer solution? |
The problem is the hack was breaking support for SeaFile, so it would need to be tweaked so that it works with both SeaFile and Nginx. |
And addinga new synchronization target "webdav on nginx" or something like that, that uses the hack without touching the "webdav"-synchronization target is no option? |
No unfortunately creating a sync target for this is not really an option. I prefer if the existing driver supports as many services as possible, as it makes long term maintenance easier and it means that the fix we add for Nginx could also benefit other services. I assume it's not too hard to get it working with Nginx in a backward compatible way but I've never had the opportunity to properly look at it with a test server. |
Would it help, if I would give you access to an an nginx-webdav account and access to the log files? |
At the moment I wouldn't have time but I'll let you know when I do. |
@laurent22 The code you pasted at #624 (comment) works for me with nginx. The WebDAV spec is a bit ambiguous but multistatus is allowed to have zero or an arbitrary number of response nodes (don't ask me how zero makes sense) and I don't see any text disallowing sending a multistatus error to a PROPFIND request for a file. There is even an example with a multistatus reply for PROPFIND a file https://tools.ietf.org/html/rfc4918#section-9.1.3 , so I guess nginx is not violating the spec. |
Oh I forgot I've suggested a solution at some point, good to know it's actually working. Yes I assume what Nginx is doing is spec compliant but a bit unusual. Since the hack is narrowly scoped it shouldn't affect other implementations so I think we could go ahead and add it, then let's see if it's working for everybody using Nginx. I won't have time in the coming days but if someone can create a PR I'll merge it. |
It works! Tested using build instructions on master branch that includes commit 3943192 |
Works for me now too with v1.0.118 beta and a Nginx running on Debian GNU/Linux 8 (jessie). |
Operating system
Application
Server
WebDAV server successfully tested with cadaver client but Joplin fails to sync.
I see there was a previous issue to-do with Nginx and WebDAV that gave the same "Cannot read property '0' of null" error: #523 Perhaps @bradmcl would know.
joplin-desktop/log.txt relevant output:
nginx error log, relevant output:
nginx conf:
The text was updated successfully, but these errors were encountered: