Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tGoogleAnalyticsInput 401 Unauthorized

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

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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

 

 

View solution in original post

6 Replies
Anonymous
Not applicable
Author

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

 

 

Anonymous
Not applicable
Author

Hello Sabrina,

Thanks for your help.The error got resolved.I have gone through the URL provided and it is very helpful.

Thanks

Rohit
Anonymous
Not applicable
Author

Hello Rohit ,

Thanks for your feedback. Feel free to post your issue on forum.

Best regards

Sabrina

Anonymous
Not applicable
Author

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  

 

 

Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
Author

I finally managed to tackle it.

Why did not I try this earlier 0683p000009MPcz.png

 

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 0683p000009MPcz.png

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 0683p000009MACn.png

 

 

 

 

 


Capture_USERS.PNG