Skip to content
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

Error sync contacts : PdoAddressBook[WARNING]: Sync() invalid DavClient #822

Closed
aukfood opened this issue Jan 2, 2023 · 8 comments
Closed
Labels
documentation Improvements or additions to documentation

Comments

@aukfood
Copy link

aukfood commented Jan 2, 2023

Hello,

Describe the bug
contacts are not synced between nextcloud contacts and snappymail

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'snappymail'
  2. Click on 'contact'
  3. no contacts synced

Expected behavior
List of contacts

Please complete the following information:

  • Browser: Firefox 108.0.1
  • IMAP daemon: dovecot
  • PHP version: 8.1
  • SnappyMail Version: 2.24.4
  • Nextcloud : 25.0.2

Debug/logging information

[2023-01-02 13:35:55.168][6a0d9957] PdoAddressBook[WARNING]: Sync() invalid DavClient
[2023-01-02 13:35:55.170][6a0d9957] SERVICE[WARNING]: ContactsSyncError[140]
#0 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/apps/snappymail/app/snappymail/v/2.24.4/app/libraries/RainLoop/ServiceActions.php(137): RainLoop\Actions->DoContactsSync()
#1 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/apps/snappymail/app/snappymail/v/2.24.4/app/libraries/RainLoop/Service.php(112): RainLoop\ServiceActions->ServiceJson('')
#2 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/apps/snappymail/app/snappymail/v/2.24.4/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()
#3 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/apps/snappymail/lib/Util/SnappyMailHelper.php(153): RainLoop\Service::Handle()
#4 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/apps/snappymail/lib/Controller/PageController.php(26): OCA\SnappyMail\Util\SnappyMailHelper::startApp(true)
#5 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/lib/private/AppFramework/Http/Dispatcher.php(225): OCA\SnappyMail\Controller\PageController->index()
#6 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/lib/private/AppFramework/Http/Dispatcher.php(133): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\SnappyMail\Controller\PageController), 'index')
#7 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/lib/private/AppFramework/App.php(172): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\SnappyMail\Controller\PageController), 'index')
#8 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/lib/private/Route/Router.php(298): OC\AppFramework\App::main('PageController', 'index', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#9 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/lib/base.php(1047): OC\Route\Router->match('/apps/snappymai...')
#10 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/index.php(36): OC::handleRequest()
#11 {main}
[2023-01-02 13:35:55.171][6a0d9957] [NOTICE]: RainLoop\Exceptions\ClientException: ContactsSyncError[140] in /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/apps/snappymail/app/snappymail/v/2.24.4/app/libraries/RainLoop/Actions/Contacts.php:44
Stack trace:
#0 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/apps/snappymail/app/snappymail/v/2.24.4/app/libraries/RainLoop/ServiceActions.php(137): RainLoop\Actions->DoContactsSync()
#1 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/apps/snappymail/app/snappymail/v/2.24.4/app/libraries/RainLoop/Service.php(112): RainLoop\ServiceActions->ServiceJson('')
#2 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/apps/snappymail/app/snappymail/v/2.24.4/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()
#3 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/apps/snappymail/lib/Util/SnappyMailHelper.php(153): RainLoop\Service::Handle()
#4 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/apps/snappymail/lib/Controller/PageController.php(26): OCA\SnappyMail\Util\SnappyMailHelper::startApp(true)
#5 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/lib/private/AppFramework/Http/Dispatcher.php(225): OCA\SnappyMail\Controller\PageController->index()
#6 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/lib/private/AppFramework/Http/Dispatcher.php(133): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\SnappyMail\Controller\PageController), 'index')
#7 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/lib/private/AppFramework/App.php(172): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\SnappyMail\Controller\PageController), 'index')
#8 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/lib/private/Route/Router.php(298): OC\AppFramework\App::main('PageController', 'index', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#9 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/lib/base.php(1047): OC\Route\Router->match('/apps/snappymai...')
#10 /var/www/preprod-nextcollab-demo.hub3.aukfood.ovh/www/index.php(36): OC::handleRequest()
#11 {main}
[2023-01-02 13:35:55.171][6a0d9957] JSON[INFO]: {"Action":"ContactsSync","Result":false,"ErrorCode":140,"ErrorMessage":"","ErrorMessageAdditional":"AddressBookProvider->Sync() failed","Time":184}

Thanks for you're help

@the-djmaze
Copy link
Owner

protected function getDavClient() : ?DAVClient

As you can see there, the DAVClient code does several checks to find the contacts.
When it can't find them it returns invalid DavClient.

Are your DAV settings correct?

the-djmaze pushed a commit that referenced this issue Jan 3, 2023
@solracsf
Copy link

Hey @the-djmaze where these DAV settings should be set?

@the-djmaze
Copy link
Owner

Settings -> Contacts

@aukfood
Copy link
Author

aukfood commented Jan 19, 2023

My dav configuration seems to be good now in apache but no sync between contacts and snappymail. There is a command to sync data ?

@the-djmaze
Copy link
Owner

There is a command to sync data ?

Yes, in the contacts window there is a sync button

@the-djmaze the-djmaze added the documentation Improvements or additions to documentation label Jan 27, 2023
@aukfood
Copy link
Author

aukfood commented Jan 27, 2023

@the-djmaze I have this message "Erreur de synchronisation des contacts" "Synchronisation Errors" without informations in logs

@the-djmaze
Copy link
Owner

Please debug why it fails.
More info at https://github.com/the-djmaze/snappymail/wiki/FAQ#how-do-i-enable-logging

@patvdv
Copy link

patvdv commented Jun 5, 2023

I had the same problem as above. In my case the problem was 2-factor authentication:

<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:o="http://owncloud.org/ns">
  <s:exception>OCA\DAV\Connector\Sabre\Exception\PasswordLoginForbidden</s:exception>
  <s:message/>
  <o:hint xmlns:o="o:">password login forbidden</o:hint>
</d:error> in /var/www/html/nextcloud/apps/snappymail/app/snappymail/v/2.28.0/app/libraries/snappymail/dav/client.php:88

I had to create a separate token (app password) for the SnappyMail cardDAV sync and then it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants