Sync Error in 5.0.80
Hey there,
I am experiencing some issues with the current 5.0.80 release. I use webdav to sync my file attachments. Zotero 5.0.80 tells me, that my webdav Server is responding with a HTTP 503 Error, which would not be Zoteros issue.
The problem is, that on other machines and even on the same machine the same sync with the same library and the same file works fine under 5.0.77. I have both versions installed and made a copy of the Zotero-Folder before upgrading.
Does anyone have an idea why this is happening?
DEBUG ID 43399149
I am experiencing some issues with the current 5.0.80 release. I use webdav to sync my file attachments. Zotero 5.0.80 tells me, that my webdav Server is responding with a HTTP 503 Error, which would not be Zoteros issue.
The problem is, that on other machines and even on the same machine the same sync with the same library and the same file works fine under 5.0.77. I have both versions installed and made a copy of the Zotero-Folder before upgrading.
Does anyone have an idea why this is happening?
DEBUG ID 43399149
Is there any other way? My password is in clear-text in the Output (in the URL of the Error message), I would prefer not to send that to anyone.
I can send you version with the passwords removed via Mail or post it here, if that helps
(Passwords are generally removed from the output automatically. We'll see if we're able to hide it for the one you're experiencing.)
"Exception":"Sabre\\DAV\\Exception\\NotAuthenticated","Message":"No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured"
That does not appear, when I download a file with 5.0.77
The full message of the webdav log is (with a redacted middle part of the IP):
{"reqId":"SP8MoRWX2TFoeRLZUEpc","level":0,"time":"2019-12-10T10:12:07+00:00","remoteAddr":"2a02::93ce","user":"--","app":"webdav","method":"GET","url":"\/nextcloud\/remote.php\/webdav\/zotero\/3VHY352J.prop","message":{"Exception":"Sabre\\DAV\\Exception\\NotAuthenticated","Message":"No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured","Code":0,"Trace":[{"function":"beforeMethod","class":"Sabre\\DAV\\Auth\\Plugin","type":"->","args":[{"absoluteUrl":"http:\/\/lerhard.ddns.net\/nextcloud\/remote.php\/webdav\/zotero\/3VHY352J.prop","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"\/var\/www\/html\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[[{"autoRequireLogin":true,"__class__":"Sabre\\DAV\\Auth\\Plugin"},"beforeMethod"],[{"absoluteUrl":"http:\/\/lerhard.ddns.net\/nextcloud\/remote.php\/webdav\/zotero\/3VHY352J.prop","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"\/var\/www\/html\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":466,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["beforeMethod",[{"absoluteUrl":"http:\/\/lerhard.ddns.net\/nextcloud\/remote.php\/webdav\/zotero\/3VHY352J.prop","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"\/var\/www\/html\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":254,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"absoluteUrl":"http:\/\/lerhard.ddns.net\/nextcloud\/remote.php\/webdav\/zotero\/3VHY352J.prop","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"\/var\/www\/html\/nextcloud\/apps\/dav\/appinfo\/v1\/webdav.php","line":80,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"\/var\/www\/html\/nextcloud\/remote.php","line":163,"args":["\/var\/www\/html\/nextcloud\/apps\/dav\/appinfo\/v1\/webdav.php"],"function":"require_once"}],"File":"\/var\/www\/html\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Auth\/Plugin.php","Line":168,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:60.0) Gecko\/20100101 Firefox\/60.0","version":"17.0.1.1"}
- only significant difference is the user-agent: "Mozilla\/5.0 (X11; Linux x86_64; rv:52.0) Gecko\/20100101 Firefox\/52.0"
The difference remains: 5.0.77 works either way, 5.0.80 does not
In any case: If you move the cert8.db/cert9.db and key3.db/key4.db files out of the Zotero profile directory, restart Zotero, and then reenter your sync credentials, is this error still logged in Zotero?
(in 5.0.77 it is line 146 instead of 179)
I dug a bit deeper into the HTTP Packets that are sent between nextcloud-webdav and zotero. It seems the problem indeed lies in the user-agent and the cookies that are exchanged between the two during the HTTP requests.
The sync between zotero and nextcloud works, if I set nextcloud to debug mode, because then it skips some cookie-checks apparently. (It seems to relate to CSFR-checks).
Here are some related links:
https://github.com/keeweb/keeweb/issues/1172
https://github.com/nextcloud/server/issues/7344
https://github.com/nextcloud/server/issues/2099
Fix (or workaround) for people interested:
add '/^Mozilla/'
to the list of incompatible user-agents, as shown in https://github.com/nextcloud/server/issues/2099#issuecomment-274586973
In any case, thank you very much for your time and keep up the good work !
Unfortunately, I don't fully manage my NextCloud, so I'm afraid I can't apply the workaround above. I understand NextCloud may be to blame here, but looking at that GitHub issue it looks like they are not going to change their approach there. Is there anything I can do from Zotero's side to make this work?
So if you have a fully synced backup (and if you're making a fresh install, this is very likely the case), it is possible to use this workaround:
1. install Zotero 5.0.77
https://download.zotero.org/client/release/5.0.77/Zotero-5.0.77_linux-x86_64.tar.bz2
2. Set up webdav and sync.
3. Restart. Zotero will update automatically, and webdav will work fine even after the upgrade to 5.0.80.
I think this explains why this issue has not yet touched all the users that it could have, as many are simply updating from previous versions.
But this is due to emerge more and more often, so I still feel it would be nice for this to be fixed from Zotero's side
In any case, I don't have a NextCloud installation to test this against, but I'm hoping this is fixed in the latest Zotero beta. @lerhard, @hklemens, and others experiencing this, you can try that version and let me know if you still have trouble with new downloads.
5.0.77 works fine, sync option for download files set to "on demand"
updated to 5.0.8 (within Zotero), get a HTTP 503 error
installed the beta version, get the HTTP 503 error
will go back to 5.0.77 now
NextCloud's behavior here is totally bizarre, so we can't spend a lot more time on this, but if someone can help us see exactly what's happening we can try to fix it.
We're no longer sending any cookies for WebDAV requests, which seems to avoid this misguided attempt at a security feature in Nextcloud.