Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone,
I am creating a job where i need to pull the data from Google Analytics .I had already register the Service account and downloaded the .p12 key File.While running the job i am facing the error
tarting job filefetch at 13:05 15/11/2017.
[statistics] connecting to socket on port 3509
[statistics] connected
WARN:Got error:401 Unauthorized
ERROR
top processing because of this error does not allow a retry.
Exception in component tGoogleAnalyticsInput_1
com.google.api.client.auth.oauth2.TokenResponseException: 401 Unauthorized
at com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:105)
at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:287)
at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:307)
at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.executeRefreshToken(GoogleCredential.java:384)
at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:489)
at com.google.api.client.auth.oauth2.Credential.intercept(Credential.java:217)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:868)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
[statistics] disconnected
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
at de.jlo.talendcomp.google.analytics.v3.GoogleAnalyticsInput.doExecute(GoogleAnalyticsInput.java:334)
at de.jlo.talendcomp.google.analytics.v3.GoogleAnalyticsInput.executeDataQuery(GoogleAnalyticsInput.java:267)
at de.jlo.talendcomp.google.analytics.v3.GoogleAnalyticsInput.executeQuery(GoogleAnalyticsInput.java:318)
at local_project.filefetch_0_1.filefetch.tGoogleAnalyticsInput_1Process(filefetch.java:629)
at local_project.filefetch_0_1.filefetch.tSetProxy_1Process(filefetch.java:385)
at local_project.filefetch_0_1.filefetch.runJobInTOS(filefetch.java:1026)
at local_project.filefetch_0_1.filefetch.main(filefetch.java:883)
Job filefetch ended at 13:05 15/11/2017. [exit code=1].
Can you please let me know the root cause of it. An early response is highly appreciated.
Thanks
Rohit
Hello,
From the error message, it seems you have an issue with OAuth 2.0.
Could you please have a look at this article:https://www.rilhia.com/tutorials/using-oauth-20-talend-access-google-apis to see if it is OK with you?
Best regards
Sabrina
Hello,
From the error message, it seems you have an issue with OAuth 2.0.
Could you please have a look at this article:https://www.rilhia.com/tutorials/using-oauth-20-talend-access-google-apis to see if it is OK with you?
Best regards
Sabrina
Hello Rohit ,
Thanks for your feedback. Feel free to post your issue on forum.
Best regards
Sabrina
Hello,
I'm also facing the same issue(Got error:401 Unauthorized) with tGoogleAnalyticsInput component.
I've followed the link which you have provided but tGoogleAnalyticsInput component has not been used there.
More appreciated if you give any suggestions.
Thanks,
Naageshwar
Could anyone help with this issue? As I am also facing it when trying to connect using a service account.
The page https://www.rilhia.com/tutorials/using-oauth-20-talend-access-google-apis , that is referred to in the solution is not working anymore.
I finally managed to tackle it.
Why did not I try this earlier
On console.developers.google.com you need to have 2 account.
The normal user/google account, which you use to login to console.developers.google.com
and a separate service account user. That I had both.
See screenshot : Capture Users
Separately when you want to use the service account, the service account itself needs to have access to the view that you wish to read.
And this was what we had wrong .
We only added the normal user/google account with Read privileges to that view, and 'forgot' to add the service account user
Check via : https://analytics.google.com
There check (or add) the service account-user (so the <username>@>projectname>-<uniquenr>.iam.gserviceaccount.com) to the view you which to read.
So stupid