[resolved] tGoogleAnalyticsInput getting "error" : "invalid_grant"

Six Stars

[resolved] tGoogleAnalyticsInput getting "error" : "invalid_grant"

I am using talend openStudio for data Integration 5.2.2.r99271. i want to pull the data through tGoogleAnlytricsInput Component.i had already register the Service account and downloaded the .p12 key File. when i am running my job getting errors
Exception in component tGoogleAnalyticsInput_1
com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request
{
"error" : "invalid_grant"
}
at com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:103)
at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:303)
at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:323)
at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.executeRefreshToken(GoogleCredential.java:320)
at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:505)

i am new to talend .i urgent need help on this

Accepted Solutions
Six Stars

Re: [resolved] tGoogleAnalyticsInput getting "error" : "invalid_grant"

After two days of struggling ,got the solution by changing the system time sync with NTP.

All Replies
Six Stars

Re: [resolved] tGoogleAnalyticsInput getting "error" : "invalid_grant"

After two days of struggling ,got the solution by changing the system time sync with NTP.
Community Manager

Re: [resolved] tGoogleAnalyticsInput getting "error" : "invalid_grant"

Sorry for our silence. We do our best to answer as many posts as possible.
Glad that you found a workaround.
Thanks for sharing your solution.
I have to admit the error is not very explicit, feel free to open a JIRA to request for this error to be enhanced.
Elisa
One Star

Re: [resolved] tGoogleAnalyticsInput getting "error" : "invalid_grant"

Hi Ashish,
I am also getting the same error . May i know which system time did u change.
Can you please elaborate on your solution, i am finding hard to understand since i am a newbie Smiley Happy
Thank You
Seventeen Stars

Re: [resolved] tGoogleAnalyticsInput getting "error" : "invalid_grant"

Check your system time of the server where this job is running. The problem is, in the request to get an token is the time included because the token is only valid for a particular time. If Google recognizes an time what is in the future (also only for a milli second) the API reject that request and you will get the mentioned error message.
If you are unable to take care a exact time you can configure in the component a time delay called Static time offset (advanced settings) Please set here a larger time. This offset in milliseconds will be added to the time used for the request.
BTW it is not necessary to struggle 2 long days with a problem on my components. You can simply ask me. I do not bite!
One Star

Re: [resolved] tGoogleAnalyticsInput getting "error" : "invalid_grant"

Thanks jlolling for giving me a clue. 
I was also facing the same issue. But the solution was a bit different. I was facing the issue because I did not copy the token.properties file to server. Now the code is working fine.
Thanks