-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
WebDAV sync broken in new versions (Android and MacOS) #624
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
Comments
Just had a look into the server logs: it seems that Joplin does not even try to contact my webdav server. I see no access to the URL I had configured. |
When I "check synchronisation settings" I get the following message: Error. Please check that URL, username, password, etc. are correct and that the sync target is accessible. The reported error was: |
Just reverted to 1.0.99 on Mac and synchronisation works again. |
Same is true for version 1.0.125 on Android |
Could you provide the log as described here? https://joplin.cozic.net/debugging/ |
The only WebDAV change in this release was this one which seems somewhat related to what you're describing, but not sure what the issue is exactly as cannot replicate it. Do you happen to have a user I could test with on your server? |
Closing for now, but feel free to comment here if it's still happening. |
I just tested with 1.101 on macos. Still doesn't work. I did what is written in the debugging description but there is absolutely nothing in the console. In log.txt I found this: 2018-06-21 19:51:43: "Starting scheduled sync" |
Regarding the webdav server: it's a seafile seafdav behind an nginx reverse proxy. It worked with the older versions perfectly well, so I guess it's not a problem of that particular setup. |
I'll be downgrding now because Joplin is beginning to become a really important part of my workflows... 😄 Thanks for that great piece of software! |
Ok I don't understand this error but it looks it might be due to the recent change for nginx (404 error handling). I'm going to disable this change for now and let's see in the next release if it works. CC @bradmcl |
1.0.103 on macos works. Thanks! |
Nice, good to know SeaFile works again. @bradmcl, but it means Nginx is now broken again. Not sure how to fix it as I'm not able to test and don't know enough about it. However if you have a safe fix for Nginx feel free to let me know. |
Any chance we can get a peek at what that dav response from SeaFile looks like? Presumably there's a status line in there that contains a 404 - the context of what that is and why would be helpful. |
What do you need and how can I obtain that info? Please understand that I am a bit reluctant to give out accounts on my server. |
Completely understand that! I feel the same way. What I'd like to see is the response of a PROPFIND request to your SeaFile server. One way to get that if you are comfortable at the command line is: |
Here's a response from mine, if that helps: `HTTP/2 207 <ns0:multistatus xmlns:ns0="DAV:">ns0:responsens0:href/seafdav/Joplin/.sync/</ns0:href>ns0:propstatns0:propns0:resourcetype<ns0:collection /></ns0:resourcetype>ns0:displayname.sync</ns0:displayname>ns0:getetag0000000000000000000000000000000000000000</ns0:getetag><ns0:lockdiscovery />ns0:supportedlockns0:lockentryns0:lockscope<ns0:exclusive /></ns0:lockscope>ns0:locktype<ns0:write /></ns0:locktype></ns0:lockentry>ns0:lockentryns0:lockscope<ns0:shared /></ns0:lockscope>ns0:locktype<ns0:write /></ns0:locktype></ns0:lockentry></ns0:supportedlock></ns0:prop>ns0:statusHTTP/1.1 200 OK</ns0:status></ns0:propstat></ns0:response></ns0:multistatus>%` |
Thanks! I think we're looking for one with a 404 hidden in it, but I'll add that one to a set of test cases for sure. |
Is there a way to replicate the 404, e.g. ask for a file that doesn't exist? I am experiencing the error as well (haven't yet moved to 103). |
Sure, give that a try, just change |
I think the issue might be that the Nginx 404 detection code is in So I think to fix it we might need to either know why there's a 404 error code in the SeaFile response or, maybe better, to implement a fix for Nginx while still ignoring the 404 errors that can be ignored. |
Maybe try the above curl command but with the root "/" instead of a specific dir?
And then see if there's a 404 error somewhere in the result. |
A la
|
Agreed, laurent, I'm trying to understand the SeaFile response a little better to craft in that direction. Hmm, Jestre. That's not the magic response either that's running into trouble, since that would not have triggered the trace shown above. More thinking needed here. Thanks! |
@laurent22 Doing it on the root ('/') yields a much longer response, since it appears to provide info for each file. I grepped through that, and there were no 404's except in the etag for a few of the files, so unless that is useful I'll save the space here :) |
Can you pastebin it or something? I would like to have it to test the next version of this fix. |
Hi, I did this "curl -i --basic --user '' -X PROPFIND https:////.sync --upload-file - -H "Depth: 1" <<end" thing: (please keep in mind that the seafile server is behind an nginx reverse proxy) HTTP/1.1 100 Continue HTTP/1.1 207 Multistatus <D:multistatus xmlns:D="DAV:"><D:response><D:href>/seafdav/Joplin/.sync/</D:href><D:propstat><D:prop><D:resourcetype><D:collection/></D:resourcetype><D:displayname>.sync</D:displayname><D:getetag>0000000000000000000000000000000000000000</D:getetag><D:lockdiscovery/><D:supportedlock><D:lockentry><D:lockscope><D:exclusive/></D:lockscope><D:locktype><D:write/></D:locktype></D:lockentry><D:lockentry><D:lockscope><D:shared/></D:lockscope><D:locktype><D:write/></D:locktype></D:lockentry></D:supportedlock></D:prop><D:status>HTTP/1.1 200 OK</D:status></D:propstat></D:response></D:multistatus> |
Hello, I'm having some sync issue with a flesh server/Nginx installation. I'm trying to sync with a Nginx webdav installation, it creates the .sync and .resource folders correctly, but it fails to create new files because now it fails to detect the file didn't exist (the 404 status issue). I'm tracing the exception using the DevTools
Resource:
} Having the resource above, causes a crash after hitting the line
As d:getlastmodified returns null, WebDavAPI.js:166 crashes because it think the lastmodified is a non-null string tries to access it's index 0:
What if we used the empty lastModified String to test if a file is a 404? :) |
So, when I go back and look at this again, I return to the original PR #541 that was rejected. It does do the narrowly defined fix for the call that NGINX makes. In the light of what we now know, should that be the type of approach here? @laurent22 |
@bradmcl, I don't know enough about the Nginx WebDAV implementation, but I get the feeling Maybe post the XML that's causing an issue and we can try to figure out where to put the 404 detection code? Probably it should simply be in |
Failing Nginx 404 response: Request:
Response
Response Result Object
|
Based on the XML above, I think the solution is to check if the multistatus contains only one response and, if it does, and that response contains a 404 status, throw an error. It's a bit of a hack but if only Nginx does this, and only that response needs to be handled that would be fine for now. To make sure the error is caught early and handled properly, it should be in WebDavApi::exec(). I cannot test as I don't have an Nginx server running, but adding that code, below this line should work: const responseArray = this.arrayFromJson(output, ['d:multistatus', 'd:response']);
if (responseArray && responseArray.length === 1) {
const status = this.stringFromJson(output, ['d:multistatus', 'd:response', 0, 'd:propstat', 0, 'd:status', 0]);
if (status && status.indexOf('404') >= 0) throw newError('Not found', 404);
} If someone could test and confirm that would be great. |
@laurent22 Do you need an account to test with? |
@laurent22 , sorry for the delay, I could build & run with the recommended code, now it is able to create files and sync now! :) |
This fix never was committed it seems. I do experience the same sync errors with nginx WebDAV. What's the status on this one? |
Operating system
Application
New version of Joplin on Mac (1.0.100) and on Android (1.0.127) do not sync over WebDAV anymore. It still works with the iOS version (10.0.24).
It seems that Joplin gets a 404 from my WebDAV server, but I could not find out what URL was being used in the debug mode or the logs.
I also used the function for testing the connection settings - also no luck.
The WebDAV server is working and I can access the correct URL with my webbrowser and log in, so the problem is very probably on the client side. And as mentioned above, the iOS version still works perfectly.
The text was updated successfully, but these errors were encountered: