server icon indicating copy to clipboard operation
server copied to clipboard

Cannot connect with CardBook

Open biva opened this issue 8 years ago • 12 comments

I have issues to connect my Nextcloud with CardBook on Thunderbird, while it works on DavDroid. I get a validation error when creating a new address book to sync with Nextcloud.

We are trying to find a solution with CardBookd developer on https://gitlab.com/CardBook/CardBook/issues/306 but without success. You'll find all our investigation there.

Steps:

  1. Create new address book
  2. Enter CalDAV info (https://nextcloud.mysite.com/remote.php/dav/addressbooks/users/sisim/Perso/
  3. Credentials, click Validate
  4. Error message: "Validation en erreur"

Version:

TB 60.0b7 Cardbook 29.6 Nextcloud 13.0.4 Contacts app 2.1.5

Cardbook Log:

2018.06.14 08:52:34:342 : Validation module : Requête de validation sans découverte d'URL sur https://nextcloud.mysite.com/remote.php/dav/addressbooks/users/sisim/Perso/ …
2018.06.14 08:52:34:346 : Validation module : debug mode : method : (new String("PROPFIND"))
2018.06.14 08:52:34:346 : Validation module : debug mode : headers : (new String("depth: \"1\", content-type: \"application/xml; charset=utf-8\", User-Agent: \"Thunderbird CardBook/29.6\", Authorization: \"Basic \"*****\""))
2018.06.14 08:52:34:346 : Validation module : debug mode : body : (new String("<?xml version=\"1.0\" encoding=\"utf-8\"?><D:propfind xmlns:D=\"DAV:\"><D:prop><D:resourcetype/><D:displayname/></D:prop></D:propfind>"))
2018.06.14 08:52:34:346 : Validation module : debug mode : username : (new String("sisim"))
2018.06.14 08:52:34:346 : Validation module : debug mode : url : (new String("https://nextcloud.mysite.com/remote.php/dav/addressbooks/users/sisim/Perso/"))
2018.06.14 08:52:34:415 : Validation module : debug mode : response code : (new Number(503))
2018.06.14 08:52:34:416 : Validation module : Synchronisation en erreur (étape : validateWithoutDiscovery, url : https://nextcloud.mysite.com/remote.php/dav/addressbooks/users/sisim/Perso/, statut : 503)
2018.06.14 08:52:35:360 : Validation module : debug mode : cardbookRepository.cardbookServerDiscoveryRequest : (new Number(1))
2018.06.14 08:52:35:361 : Validation module : debug mode : cardbookRepository.cardbookServerDiscoveryResponse : (new Number(1))
2018.06.14 08:52:35:362 : Validation module : debug mode : cardbookRepository.cardbookServerDiscoveryError : (new Number(1))
2018.06.14 08:52:35:362 : Validation module : debug mode : cardbookRepository.cardbookServerValidation : ({length:0, user:"sisim"})
2018.06.14 08:52:35:373 : Validation module : Requête de découverte d'URL phase 1 sur https://nextcloud.mysite.com/remote.php/dav/addressbooks/users/sisim/Perso/.well-known/carddav …
2018.06.14 08:52:35:376 : Validation module : debug mode : method : (new String("PROPFIND"))
2018.06.14 08:52:35:376 : Validation module : debug mode : headers : (new String("depth: \"0\", content-type: \"application/xml; charset=utf-8\", User-Agent: \"Thunderbird CardBook/29.6\", Authorization: \"Basic \"*****\""))
2018.06.14 08:52:35:376 : Validation module : debug mode : body : (new String("<?xml version=\"1.0\" encoding=\"utf-8\"?><D:propfind xmlns:D=\"DAV:\"><D:prop><D:current-user-principal/></D:prop></D:propfind>"))
2018.06.14 08:52:35:376 : Validation module : debug mode : username : (new String("sisim"))
2018.06.14 08:52:35:376 : Validation module : debug mode : url : (new String("https://nextcloud.mysite.com/remote.php/dav/addressbooks/users/sisim/Perso/.well-known/carddav"))
2018.06.14 08:52:35:427 : Validation module : debug mode : response code : (new Number(503))
2018.06.14 08:52:35:427 : Validation module : Synchronisation en erreur (étape : discoverPhase1, url : https://nextcloud.mysite.com/remote.php/dav/addressbooks/users/sisim/Perso/.well-known/carddav, statut : 503)
2018.06.14 08:52:36:400 : Validation module : debug mode : cardbookRepository.cardbookServerDiscoveryRequest : (new Number(1))
2018.06.14 08:52:36:400 : Validation module : debug mode : cardbookRepository.cardbookServerDiscoveryResponse : (new Number(1))
2018.06.14 08:52:36:400 : Validation module : debug mode : cardbookRepository.cardbookServerDiscoveryError : (new Number(1))
2018.06.14 08:52:36:400 : Validation module : debug mode : cardbookRepository.cardbookServerValidation : ({length:0, user:"sisim"})
2018.06.14 08:52:36:411 : Validation module : Requête de validation sans découverte d'URL sur https://nextcloud.mysite.com/remote.php/dav/addressbooks/sisim …
2018.06.14 08:52:36:415 : Validation module : debug mode : method : (new String("PROPFIND"))
2018.06.14 08:52:36:416 : Validation module : debug mode : headers : (new String("depth: \"1\", content-type: \"application/xml; charset=utf-8\", User-Agent: \"Thunderbird CardBook/29.6\", Authorization: \"Basic \"*****\""))
2018.06.14 08:52:36:416 : Validation module : debug mode : body : (new String("<?xml version=\"1.0\" encoding=\"utf-8\"?><D:propfind xmlns:D=\"DAV:\"><D:prop><D:resourcetype/><D:displayname/></D:prop></D:propfind>"))
2018.06.14 08:52:36:416 : Validation module : debug mode : username : (new String("sisim"))
2018.06.14 08:52:36:416 : Validation module : debug mode : url : (new String("https://nextcloud.mysite.com/remote.php/dav/addressbooks/sisim"))
2018.06.14 08:52:36:469 : Validation module : debug mode : response code : (new Number(503))
2018.06.14 08:52:36:469 : Validation module : Synchronisation en erreur (étape : validateWithoutDiscovery, url : https://nextcloud.mysite.com/remote.php/dav/addressbooks/sisim, statut : 503)
2018.06.14 08:52:37:430 : Validation module : debug mode : cardbookRepository.cardbookServerDiscoveryRequest : (new Number(1))
2018.06.14 08:52:37:430 : Validation module : debug mode : cardbookRepository.cardbookServerDiscoveryResponse : (new Number(1))
2018.06.14 08:52:37:431 : Validation module : debug mode : cardbookRepository.cardbookServerDiscoveryError : (new Number(1))
2018.06.14 08:52:37:431 : Validation module : debug mode : cardbookRepository.cardbookServerValidation : ({length:0, user:"sisim"})

Nextcloud apache access log:

192.168.1.1 - sisim [14/Jun/2018:11:58:02 +0200] "PROPFIND /remote.php/dav/addressbooks/users/sisim/Perso/ HTTP/2.0" 503 -
192.168.1.1 - sisim [14/Jun/2018:11:58:03 +0200] "PROPFIND /remote.php/dav/addressbooks/users/sisim/Perso/.well-known/carddav HTTP/2.0" 503 -
192.168.1.1 - sisim [14/Jun/2018:11:58:04 +0200] "PROPFIND /remote.php/dav/addressbooks/sisim HTTP/2.0" 503 -

Nextcloud log:

{"reqId":"XXXXXZZZ","level":1,"time":"2018-06-14T11:48:42+00:00","remoteAddr":"192.168.1.1","user":"--","app":"admin_audit","method":"PROPFIND","url":"\/remote.php\/dav\/addressbooks\/users\/sisim\/Perso\/","message":"Login attempt: \"sisim\"","userAgent":"Thunderbird CardBook\/29.6 Lightning\/6.2","version":"13.0.3.2"}
{"reqId":"XXXXXYYY","level":1,"time":"2018-06-14T11:48:42+00:00","remoteAddr":"192.168.1.1","user":"sisim","app":"admin_audit","method":"PROPFIND","url":"\/remote.php\/dav\/addressbooks\/users\/sisim\/Perso\/","message":"Login successful: \"sisim\"","userAgent":"Thunderbird CardBook\/29.6 Lightning\/6.2","version":"13.0.3.2"}

biva avatar Jun 14 '18 12:06 biva

Investigating further, it does not come from Nextcloud, but from Thunderbird. I close it for now

biva avatar Jun 14 '18 16:06 biva

For all Users with Thunderbird 60, problems with Address and Calendar Sync.

You need

-> about:config ----> network.cookie.same-site.enabled = true ---> false

Than works all sync...... https://github.com/nextcloud/server/issues/10134#issuecomment-411322692

https://blog.mozilla.org/security/2018/04/24/same-site-cookies-in-firefox-60/ https://bugzilla.mozilla.org/show_bug.cgi?id=1468912 https://www.thunderbird.net/en-US/thunderbird/60.0/releasenotes/#known-issues

vampsm avatar Aug 28 '18 14:08 vampsm

The above fix from @vampsm also fixes lightning calender connection issues.

adsworth avatar Sep 26 '18 18:09 adsworth

Edit -> Preferences -> General -> Config Editor.

dcrobertson01 avatar Dec 04 '18 20:12 dcrobertson01

Above worked for me also. Thank you so much @vampsm

Windows version of thunderbird, select tools, options, general tab, "config editor"

slowmoe420 avatar Jan 22 '19 03:01 slowmoe420

Changing network.cookie.same-site.enabled = true ---> false worked for me also. DON'T FORGET TO RESTART THUNDERBIRD! Otherwise the changes won#t take effect.

ar-ml avatar Jan 31 '19 00:01 ar-ml

network.cookie.same-site.enabled does not exist anymore in latest Thunderbird and issue still persists.

diqidoq avatar Dec 04 '19 11:12 diqidoq

@diqidoq Are you aware that this is the Nextcloud product bug tracker and NOT the Nextcloud help forum? Thundebird 68.3.0/Cardbook 43.1 are definitely working with Nextcloud 17.x. Please use the search function of the Nextcloud help forum to find answers on your question, see e.g. https://help.nextcloud.com/search?q=thunderbird%2060%20cardbook

j-ed avatar Dec 04 '19 15:12 j-ed

@diqidoq, if network.cookie.cookiebehavior is set to 2 or 3, change it to 1, and it should work. I had the same trouble with Thunderbird 68 and searching lead me here.

karlmiles avatar Dec 30 '19 11:12 karlmiles

Thanks @diqidoq it also works for me but network.cookie.cookiebehavior was at "0" I changed it to 1. I have Thunderbird 78.10.2 and Cardbook 59.4

Alain-81 avatar May 28 '21 18:05 Alain-81

:: OFFTOPIC

@j-ed commented on Dec 4, 2019 @diqidoq Are you aware that this is the Nextcloud product bug tracker and NOT the Nextcloud help forum?

Accidently humbled over this old thread here today... @j-ed Sorry if I miss something here: and you are who? Are you aware of your "tone"? Apart from that I do not remember to have asked (you) any question nor for help, I tried to help others by reporting a (more or less) relevant info to an open issue at this time. After being CEO and lead in dev sector over 2 decades contributing many own created open source projects to the community I surely need no explanation about the difference between help forums and issue trackers.

:: ENDOF OFFTOPIC

diqidoq avatar Oct 11 '21 16:10 diqidoq

For those who humble over this thread all the years again, in our case here I managed to solve this TB issue with Nextcloud, which pops up here and there again, then it disappears, and then appears again, by the ordering of sync configurations, so that you FIRST sync your calendars and THEN the contacts for cardbook, and not the other way around. In our case here it seem to be caused by the private serverside self-signed generated SSL certificate which (so I assume) many use by default. And it seems that Thunderbird calendar sync asks for permission to use this certificate and the contacts sync of cardbook does not and simply refuses without notification. By confirming the url in the calendar sync config steps it seems that this domain related certificate is confirmed TB wide and so it is for cardbook too. Just an assumption. But it surely needs other users to confirm this, because, IF IT IS the reason for the issue or maybe one of the possible reasons for this issue we maybe need a "warning" or something for Nextcloud regardng self-signed certificates and syncs with TB.

(And no, this is not wrong to report here. It is 200% OK to report here to help others getting over this issue between NC & TB quickly. From managing multiple huge issue queues of big Open Source projects I know we learn a lot of such user reports about issues from other perspectives to focus on parts corresponding to this.)

diqidoq avatar Jun 03 '23 16:06 diqidoq