Google Contact synchronization (upload) not working

Support related problems and questions

Moderators: TerryRogers, Max

Post Reply
User avatar
ferenczy
Posts: 3
Joined: Tue Dec 11, 2018 4:57 pm
Location: Prague, Czech republic
Has thanked: 1 time
Contact:

Google Contact synchronization (upload) not working

Post by ferenczy »

I just installed a fresh instance of the EssentialPIM 9.9 Pro (so far in the trial mode) and set it up to synchronize with my Google account (mail, calendar, and contacts). It looks like everything has been successfully downloaded but I noticed that contacts are not being synchronized back to the Google Contacts.

The error happens when EssentialPIM tries to upload the changed contact. It's being reported in the synchronization popup dialog and GoogleSync logs contain further details. It seems to be caused by binary image data of the contact photo being improperly encoded by the Base64 encoding.

API request:

Code: Select all

PATCH /v1/people/<id>:updateContactPhoto HTTP/1.1
Response (that's also reported by the synchronization popup dialog):

Code: Select all

HTTP/1.1 400 Bad Request
Response payload:

Code: Select all

"error": {<LF>    "code": 400,<LF>    "message": "Invalid value at 'photo_bytes' (TYPE_BYTES), Base64 decoding failed for <Base64-data>
"status": "INVALID_ARGUMENT",<LF>    "details": [<LF>      {<LF>        "@type": "type.googleapis.com/google.rpc.BadRequest",<LF>        "fieldViolations": [<LF>          {<LF>            "field": "photo_bytes",<LF>            "description": "Invalid value at 'photo_bytes' (TYPE_BYTES), Base64 decoding failed for <Base64-data>
It doesn't affect just the contact photo but no other field is being synchronized back to the Google Contacts. It actually looks like the whole synchronization is interrupted by a failure to upload one of the fields of one of the entries in one of the modules. I guess so since that error is the last entry in the GoogleSync log. The very last line contains the following:

Code: Select all

16:05:00.916  133928  HTTP/1.1 400 Bad Request
If that's the case, I don't think that the interruption of the whole synchronization is the best handling of a failure of the upload of one of the entries.
admin
Site Admin
Posts: 15601
Joined: Thu Nov 25, 2004 3:12 am
Has thanked: 1411 times
Been thanked: 984 times

Re: Google Contact synchronization (upload) not working

Post by admin »

Will check this, thanks. Meanwhile, you can mark the contact as private, exclude private items from synchronization in options and see if it starts working then.
Android version of EssentialPIM. Keep all your data in sync!
User avatar
ferenczy
Posts: 3
Joined: Tue Dec 11, 2018 4:57 pm
Location: Prague, Czech republic
Has thanked: 1 time
Contact:

Re: Google Contact synchronization (upload) not working

Post by ferenczy »

OK, thanks for the suggestion. I have identified the particular contact that's causing it, so I'll try it to see if it's an issue of that specific contact photo or with contact photos in general.
admin
Site Admin
Posts: 15601
Joined: Thu Nov 25, 2004 3:12 am
Has thanked: 1411 times
Been thanked: 984 times

Re: Google Contact synchronization (upload) not working

Post by admin »

According to our tests that should be an issue with that particular contact. Although, we found out there were still some adjustments to be made for the sync of pictures with Google Contacts. These changes will be included in the next update. Thanks!
Android version of EssentialPIM. Keep all your data in sync!
EFvanGelder
Guru
Posts: 139
Joined: Thu Mar 29, 2012 9:02 am
Been thanked: 24 times

Re: Google Contact synchronization (upload) not working

Post by EFvanGelder »

Somehow, I very much doubt that a particular contact causes this problem. In my case anyway.
I happen to experience the same problem.

I used EPIM Portable r 9.6 for quite some time, and never had any problems synchronizing my contacts with Google.
From the moment I upgraded my EPIM Portable from r9.6 to EPIM Portable r9.95, I experienced this HTTP/1.1 400 Bad Request upon synchronizing my contacts. Theproblem also occurs in releases 9.96 and 9.97, but not in 9.6

Sync settings are: One way sync, contacts only.

When rolling back to EPIM r9.6, with the same database, no problem synchronizing whatsoever. So, the database doesn't seem to be the problem.

Also tried to upgrade to EPIM Pro r9.95 (NOT the portable version): Same database, same problem again as the portable version.
Tried to upgrade to EPIM Pro r9.96 (NOT the portable version): Same database, same problem again.
Rolled back to EPIM Portable r9.6, same database, no problem synchronizing.
Tried all this on my second computer: Same problem with EPIM Portable r9.9x and the same database. No problem with EPIM Portable r9.6 and the same database.

,
Last edited by EFvanGelder on Thu Aug 05, 2021 8:19 am, edited 1 time in total.
With kind regards,
Erik Franciscus van Gelder
admin
Site Admin
Posts: 15601
Joined: Thu Nov 25, 2004 3:12 am
Has thanked: 1411 times
Been thanked: 984 times

Re: Google Contact synchronization (upload) not working

Post by admin »

We need to see a log file with the error in order to understand what's causing the problem.
Android version of EssentialPIM. Keep all your data in sync!
EFvanGelder
Guru
Posts: 139
Joined: Thu Mar 29, 2012 9:02 am
Been thanked: 24 times

Re: Google Contact synchronization (upload) not working

Post by EFvanGelder »

Here's the essential part of the log file:

09:10:36.824 11708 SyncGroups
09:10:36.824 11708 GGroupsCount 17
09:10:36.825 11708 ItemInfo.Count 15
09:10:36.825 11708 SyncInfo.Count 9
09:10:36.829 11708 NewItems.Count 9
09:10:36.829 11708 Copy1 112976777653723831 contactGroups/5d4cde8908f3a105
09:10:36.843 11708 Copy1 134185341256031879 contactGroups/3961687f0d338dbc
09:10:36.856 11708 Copy1 110850578923247658 contactGroups/35e1a980a9ebc47
09:10:36.870 11708 Copy1 89015651755196695 contactGroups/4deabb2e0e908fa7
09:10:36.884 11708 Copy1 98664676138660209 contactGroups/2d692ae40b2394f9
09:10:36.897 11708 Copy1 111546140108852787 contactGroups/5ec0c0ac8a7a858a
09:10:36.911 11708 Copy1 117758329490774155 contactGroups/4abeef718e501fd4
09:10:36.925 11708 Copy1 109892790201981791 contactGroups/75dd4652091db295
09:10:36.939 11708 Copy1 91435130712197109 contactGroups/5298fb608fa094be
09:10:36.953 11708 NewItems.Count 0
09:10:36.953 11708 GroupsStore
09:10:36.955 11708 SyncGroups OK
09:10:36.955 11708 GContactsStore
09:10:37.133 11708 POST /v1/people:createContact?personFields=metadata,names,memberships,nicknames,phoneNumbers,emailAddresses,urls,imClients,addresses,events,birthdays,userDefined,organizations,photos,biographies HTTP/1.1<EOL>Content-Type: application/json; charset=UTF-8<EOL>Content-Length: 97<EOL>Authorization: Bearer<EOL> ya29.a0ARrdaM8PBuHBu75huNTlnVpDIi3mZpP78v1ppb96-nS6QJtKDZG0XzALYeXmaxd2eM-SENNDvytxkEpwMQ4p-e0oljE9FO0584B4f_2k4W5mj9BeJoRT_44x9HfkQFG2G9rST35bKS0JVSV6mX3WnLk7WhsrINc<EOL>Host: people.googleapis.com<EOL>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8<EOL>Accept-Encoding: identity<EOL>User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; WOW64; Trident/7.0)<EOL><EOL>
09:10:37.133 11708 {<EOL> "biographies": [<EOL> {<EOL> "contentType": "TEXT_PLAIN",<EOL> "value": ""<EOL> }],<EOL> "etag": ""<EOL>}
09:10:37.204 11708 HTTP/1.1 400 Bad Request<EOL>Vary: X-Origin<EOL>Vary: Referer<EOL>Content-Type: application/json; charset=UTF-8<EOL>Date: Thu, 05 Aug 2021 07:10:37 GMT<EOL>Server: ESF<EOL>Cache-Control: private<EOL>X-XSS-Protection: 0<EOL>X-Frame-Options: SAMEORIGIN<EOL>X-Content-Type-Options: nosniff<EOL>Accept-Ranges: none<EOL>Vary: Origin,Accept-Encoding<EOL>Transfer-Encoding: chunked<EOL>Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"<EOL><EOL>92<EOL>{<LF> "error": {<LF> "code": 400,<LF> "message": "Must specify a non-metadata contact field on the person.",<LF> "status": "INVALID_ARGUMENT"<LF> }<LF>}<LF><EOL>
09:10:37.204 11708 0<EOL><EOL>
09:10:37.208 11708 HTTP/1.1 400 Bad Request
With kind regards,
Erik Franciscus van Gelder
EFvanGelder
Guru
Posts: 139
Joined: Thu Mar 29, 2012 9:02 am
Been thanked: 24 times

Re: Google Contact synchronization (upload) not working

Post by EFvanGelder »

Ehm......I just may have found a clue to this problem.

I experienced this problem, when I upgraded from EPIM r9.6 to r9.95, r9.96, r9.97.
Since I upgraded to r9.9x I had this http 400 sync problem, every time I tried to synchronize with Google:
On every sync attempt I received a BAD REQUEST error (http 400)

I used to synchronize inidirectional, from EPIM to Google. Apparently. Apparently, that was the cause of the problem.
After I changed the setting to unidirectional, but the other way around (so, from Google to EPIM), the problem as I experienced, was gone.
Several changes in my database were made, i.e. some fieldlabels were added/changed, but those wer minor changes.
When I then changed my settings back to the original settings, i.e. unidirectional from EPIM to Google, the problem did not occur anymore.

At least for me, this remedied the problem. I hope, for others who use to sync their contacts unidirectionally from EPIM to Google, this works too.
With kind regards,
Erik Franciscus van Gelder
Post Reply