Google Calendar Sync-Error GoogleSyncBase

Version 7.11.4
Sugar Version 6.5.25 (Build 344)
PHP Version 7.2.15
OVH

Hello,

I have an error when i want to synchronize google calendar.
here the logs

Fri May 24 12:24:10 2019 [5771][1][INFO] /home/xxxxxxxxxxx/www/suitecrm/include/GoogleSync/GoogleSyncBase.php:224 GoogleSyncBase::getGoogleClient - Refreshing Access Token
Fri May 24 12:24:21 2019 [5771][1][FATAL] Caught Exception While Syncing User:1
Fri May 24 12:24:21 2019 [5771][1][ERROR] #0 /home/xxxxxxxxxxx/www/suitecrm/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(149): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 /home/xxxxxxxxxxx/www/suitecrm/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(102): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 /home/xxxxxxxxxxx/www/suitecrm/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#3 /home/xxxxxxxxxxx/www/suitecrm/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#4 /home/xxxxxxxxxxx/www/suitecrm/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(51): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#5 /home/xxxxxxxxxxx/www/suitecrm/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(66): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#6 /home/xxxxxxxxxxx/www/suitecrm/vendor/guzzlehttp/guzzle/src/Middleware.php(30): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#7 /home/xxxxxxxxxxx/www/suitecrm/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(70): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#8 /home/xxxxxxxxxxx/www/suitecrm/vendor/guzzlehttp/guzzle/src/Middleware.php(58): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#9 /home/xxxxxxxxxxx/www/suitecrm/vendor/guzzlehttp/guzzle/src/HandlerStack.php(67): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#10 /home/xxxxxxxxxxx/www/suitecrm/vendor/guzzlehttp/guzzle/src/Client.php(277): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#11 /home/xxxxxxxxxxx/www/suitecrm/vendor/guzzlehttp/guzzle/src/Client.php(99): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array)
#12 /home/xxxxxxxxxxx/www/suitecrm/vendor/guzzlehttp/guzzle/src/Client.php(106): GuzzleHttp\Client->sendAsync(Object(GuzzleHttp\Psr7\Request), Array)
#13 /home/xxxxxxxxxxx/www/suitecrm/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php(34): GuzzleHttp\Client->send(Object(GuzzleHttp\Psr7\Request), Array)
#14 /home/xxxxxxxxxxx/www/suitecrm/vendor/google/auth/src/OAuth2.php(501): Google\Auth\HttpHandler\Guzzle6HttpHandler->__invoke(Object(GuzzleHttp\Psr7\Request))
#15 /home/xxxxxxxxxxx/www/suitecrm/vendor/google/apiclient/src/Google/Client.php(277): Google\Auth\OAuth2->fetchAuthToken(Object(Google\Auth\HttpHandler\Guzzle6HttpHandler))
#16 /home/xxxxxxxxxxx/www/suitecrm/include/GoogleSync/GoogleSyncBase.php(227): Google_Client->fetchAccessTokenWithRefreshToken(‘1/x8ZvNK6NQZKfh…’)
#17 /home/xxxxxxxxxxx/www/suitecrm/include/GoogleSync/GoogleSyncBase.php(192): GoogleSyncBase->getGoogleClient(Array)
#18 /home/xxxxxxxxxxx/www/suitecrm/include/GoogleSync/GoogleSyncBase.php(149): GoogleSyncBase->getClient(1)
#19 /home/xxxxxxxxxxx/www/suitecrm/include/GoogleSync/GoogleSyncBase.php(265): GoogleSyncBase->setClient(1)
#20 /home/xxxxxxxxxxx/www/suitecrm/include/GoogleSync/GoogleSync.php(144): GoogleSyncBase->initUserService(1)
#21 /home/xxxxxxxxxxx/www/suitecrm/include/GoogleSync/GoogleSync.php(296): GoogleSync->doSync(1)
#22 /home/xxxxxxxxxxx/www/suitecrm/modules/Schedulers/_AddJobsHere.php(533): GoogleSync->syncAllUsers()
#23 /home/xxxxxxxxxxx/www/suitecrm/modules/SchedulersJobs/SchedulersJob.php(540): syncGoogleCalendar(Object(SchedulersJob))
#24 /home/xxxxxxxxxxx/www/suitecrm/include/SugarQueue/SugarCronJobs.php(191): SchedulersJob->runJob()
#25 /home/xxxxxxxxxxx/www/suitecrm/include/SugarQueue/SugarCronJobs.php(231): SugarCronJobs->executeJob(Object(SchedulersJob))
#26 /home/xxxxxxxxxxx/www/suitecrm/cron.php(98): SugarCronJobs->runCycle()
#27 {main}
Fri May 24 12:24:21 2019 [5771][1][DEBUG] Hook called: Users::before_retrieve

Does anyone have an idea of ​​where the problem can come from?

Thanks in adavance

Hello,

I don’t know why but the two way google calendar synchronisation is working since this morning.
Perhaps a google error last week ?

Thanks for reading me.

I’m glad it’s working now :slight_smile:

@t.lesca, is it still working? I’m getting the same log error.

Hello,

No it does not work anymore. I updated to suitecrm Version 7.11.5, but that does not work either.

t.lesca,
Can you share the log like you did before? I’ll try to figure out where it’s gone wrong.

Also, Google Calendar was out a few weeks ago. I think that’s what was causing the original issue.

1 Like

Hi Benjamin,

Here are my [ERROR] logs which seem, to my uneducated eye, the same as t.lesca. Do you need Debug log also?

Two users on “xxourdomain.comxx”:

Wed Jun 26 09:28:21 2019 [11368][1][FATAL] Caught Exception While Syncing User:1
Wed Jun 26 09:28:21 2019 [11368][1][ERROR] #0 /var/www/html/crm/vendor/google/apiclient/src/Google/Http/REST.php(94): Google_Http_REST::decodeHttpResponse(Object(GuzzleHttp\Psr7\Response), Object(GuzzleHttp\Psr7\Request), ‘Google_Service_…’)
#1 /var/www/html/crm/vendor/google/apiclient/src/Google/Task/Runner.php(176): Google_Http_REST::doExecute(Object(GuzzleHttp\Client), Object(GuzzleHttp\Psr7\Request), ‘Google_Service_…’)
#2 /var/www/html/crm/vendor/google/apiclient/src/Google/Http/REST.php(58): Google_Task_Runner->run()
#3 /var/www/html/crm/vendor/google/apiclient/src/Google/Client.php(798): Google_Http_REST::execute(Object(GuzzleHttp\Client), Object(GuzzleHttp\Psr7\Request), ‘Google_Service_…’, Array)
#4 /var/www/html/crm/vendor/google/apiclient/src/Google/Service/Resource.php(232): Google_Client->execute(Object(GuzzleHttp\Psr7\Request), ‘Google_Service_…’)
#5 /var/www/html/crm/vendor/google/apiclient-services/src/Google/Service/Calendar/Resource/Events.php(77): Google_Service_Resource->call(‘get’, Array, ‘Google_Service_…’)
#6 /var/www/html/crm/include/GoogleSync/GoogleSyncBase.php(457): Google_Service_Calendar_Resource_Events->get(‘xxourdomain.comxx_…’, ‘60q30c1g60o30e…’)
#7 /var/www/html/crm/include/GoogleSync/GoogleSync.php(152): GoogleSyncBase->getGoogleEventById(‘60q30c1g60o30e…’)
#8 /var/www/html/crm/include/GoogleSync/GoogleSync.php(296): GoogleSync->doSync(1)
#9 /var/www/html/crm/modules/Schedulers/AddJobsHere.php(533): GoogleSync->syncAllUsers()
#10 /var/www/html/crm/modules/SchedulersJobs/SchedulersJob.php(540): syncGoogleCalendar(Object(SchedulersJob))
#11 /var/www/html/crm/include/SugarQueue/SugarCronJobs.php(191): SchedulersJob->runJob()
#12 /var/www/html/crm/include/SugarQueue/SugarCronJobs.php(231): SugarCronJobs->executeJob(Object(SchedulersJob))
#13 /var/www/html/crm/cron.php(98): SugarCronJobs->runCycle()
#14 {main}
Wed Jun 26 09:28:51 2019 [11368][1][FATAL] Caught Exception While Syncing User:137cbac1-a42c-e7b6-6a3f-5b040ac9e717
Wed Jun 26 09:28:51 2019 [11368][1][ERROR] #0 /var/www/html/crm/vendor/google/apiclient/src/Google/Http/REST.php(94): Google_Http_REST::decodeHttpResponse(Object(GuzzleHttp\Psr7\Response), Object(GuzzleHttp\Psr7\Request), 'Google_Service
…’)
#1 /var/www/html/crm/vendor/google/apiclient/src/Google/Task/Runner.php(176): Google_Http_REST::doExecute(Object(GuzzleHttp\Client), Object(GuzzleHttp\Psr7\Request), 'Google_Service
…’)
#2 /var/www/html/crm/vendor/google/apiclient/src/Google/Http/REST.php(58): Google_Task_Runner->run()
#3 /var/www/html/crm/vendor/google/apiclient/src/Google/Client.php(798): Google_Http_REST::execute(Object(GuzzleHttp\Client), Object(GuzzleHttp\Psr7\Request), 'Google_Service
…’, Array)
#4 /var/www/html/crm/vendor/google/apiclient/src/Google/Service/Resource.php(232): Google_Client->execute(Object(GuzzleHttp\Psr7\Request), ‘Google_Service_…’)
#5 /var/www/html/crm/vendor/google/apiclient-services/src/Google/Service/Calendar/Resource/Events.php(77): Google_Service_Resource->call(‘get’, Array, ‘Google_Service_…’)
#6 /var/www/html/crm/include/GoogleSync/GoogleSyncBase.php(457): Google_Service_Calendar_Resource_Events->get(‘xxourdomain.comxx_…’, ‘hdoht54p9ruv63u…’)
#7 /var/www/html/crm/include/GoogleSync/GoogleSync.php(152): GoogleSyncBase->getGoogleEventById(‘hdoht54p9ruv63u…’)
#8 /var/www/html/crm/include/GoogleSync/GoogleSync.php(296): GoogleSync->doSync(‘137cbac1-a42c-e…’)
#9 /var/www/html/crm/modules/Schedulers/_AddJobsHere.php(533): GoogleSync->syncAllUsers()
#10 /var/www/html/crm/modules/SchedulersJobs/SchedulersJob.php(540): syncGoogleCalendar(Object(SchedulersJob))
#11 /var/www/html/crm/include/SugarQueue/SugarCronJobs.php(191): SchedulersJob->runJob()
#12 /var/www/html/crm/include/SugarQueue/SugarCronJobs.php(231): SugarCronJobs->executeJob(Object(SchedulersJob))
#13 /var/www/html/crm/cron.php(98): SugarCronJobs->runCycle()
#14 {main}

Oops… ignore the “same” comment. I see they are different.

Did you have this all working, then delete the SuiteCRM calendar on Google?

If so, this may be Bug #7312

It can be corrected by blanking out the gsync fieids in the Meetings table.

Hi Ben,

No, nothing deleted. The SuiteCRM calendar is still there in Google Calendar.

I removed some funky looking records where gsync_id and/or gsync_lastsync were NULL
and then ran ‘UPDATE meetings SET x = NULL ;’ (for x = gsync_id and gsync_lastsync)
and voila! It works!

Many thanks

Steve

Hi,
I have the same problem with 7.11.15

I have a meetings table with more than 6,000 records
I remove the SuiteCRM calendar on Google
I set all the records to gsync_id and gsync_lastsync = NULL
I let the cron go and at the first try it works, creating a new SuiteCRM calendar on Google
(I noticed that a lot of records still have gsync_id and gsync_lastsync =NULL)

When the cron runs again it doesn’t run properly and i get this error:

Tue Oct 20 17:21:09 2020 [29677][1][INFO] /var/www/clients/client0/web1/web/include/GoogleSync/GoogleSync.php:112 GoogleSync::doAction - Skipping Record: Docenza Unit Formativa I 4lez / Docenza Unit Formativa I 4lez

Tue Oct 20 17:21:09 2020 [29677][1][FATAL] Caught Exception While Syncing User:2eb84214-10c3-d71f-9865-455983c0bd2a
Tue Oct 20 17:21:09 2020 [29677][1][ERROR] #0 /var/www/clients/client0/web1/web/vendor/google/apiclient/src/Google/Http/REST.php(94): Google_Http_REST::decodeHttpResponse(Object(GuzzleHttp\Psr7\Response), Object(GuzzleHttp\Psr7\Request), ‘Google_Service_…’)
#1 /var/www/clients/client0/web1/web/vendor/google/apiclient/src/Google/Task/Runner.php(176): Google_Http_REST::doExecute(Object(GuzzleHttp\Client), Object(GuzzleHttp\Psr7\Request), ‘Google_Service_…’)
#2 /var/www/clients/client0/web1/web/vendor/google/apiclient/src/Google/Http/REST.php(58): Google_Task_Runner->run()
#3 /var/www/clients/client0/web1/web/vendor/google/apiclient/src/Google/Client.php(862): Google_Http_REST::execute(Object(GuzzleHttp\Client), Object(GuzzleHttp\Psr7\Request), ‘Google_Service_…’, Array, NULL)
#4 /var/www/clients/client0/web1/web/vendor/google/apiclient/src/Google/Service/Resource.php(232): Google_Client->execute(Object(GuzzleHttp\Psr7\Request), ‘Google_Service_…’)
#5 /var/www/clients/client0/web1/web/vendor/google/apiclient-services/src/Google/Service/Calendar/Resource/Events.php(75): Google_Service_Resource->call(‘get’, Array, ‘Google_Service_…’)
#6 /var/www/clients/client0/web1/web/include/GoogleSync/GoogleSyncBase.php(472): Google_Service_Calendar_Resource_Events->get(‘b4pok61k5aj807s…’, ‘eutqus036hsfa9t…’)
#7 /var/www/clients/client0/web1/web/include/GoogleSync/GoogleSync.php(152): GoogleSyncBase->getGoogleEventById(‘eutqus036hsfa9t…’)
#8 /var/www/clients/client0/web1/web/include/GoogleSync/GoogleSync.php(296): GoogleSync->doSync(‘2eb84214-10c3-d…’)

I noticed a strange thing:
accessing the DB through PhpMyAdmin and reading the table with 500 rows a time,
I get a new heading row (the one with id | name | date_entered | etc) each 100 rows and I’ve noticed that the last record skipped in the log report is just the one before that “new heading”
I don’t know if it’s relevant, but I want to add some extra info

Hope you can help me.
Thanks,
Carlo

Google API’s have limits

If you can’t sync today, you might be able to sync tomorrow

Great!
It was the “Queries per 100 seconds per user”
I set to 7000 instead of 500 and now it works!

Thank you so much!
Carlo