One Star

tGoogleAnalyticsInput time out

Hi,
I hope you can help. I am quite new to Talend and am trying to use the connection for Google Analytics.
I have created all the relevant connections in Google Developer Console and have added the service email address to my Google Analytics account but can't seem to get any data back, just a time out error.
Any advice would be appreciated.
Thanks
Starting job GoogleAnalytics at 17:25 04/12/2015.

connecting to socket on port 3773
connected
WARN:Got error:connect timed out
INFO:Retry request in 1000ms
WARN:Got error:connect timed out
ERROR:All repetition of requests failed:connect timed out
Exception in component tGoogleAnalyticsInput_1
java.net.SocketTimeoutException: connect timed out
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:77)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:972)
at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:283)
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:859)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
at de.jlo.talendcomp.googleanalytics.GoogleAnalyticsInput.doExecute(GoogleAnalyticsInput.java:446)
at de.jlo.talendcomp.googleanalytics.GoogleAnalyticsInput.executeDataQuery(GoogleAnalyticsInput.java:383)
at de.jlo.talendcomp.googleanalytics.GoogleAnalyticsInput.executeQuery(GoogleAnalyticsInput.java:434)
at local_project.googleanalytics_0_1.GoogleAnalytics.tGoogleAnalyticsInput_1Process(GoogleAnalytics.java:1195)
at local_project.googleanalytics_0_1.GoogleAnalytics.runJobInTOS(GoogleAnalytics.java:1642)
at local_project.googleanalytics_0_1.GoogleAnalytics.main(GoogleAnalytics.java:1487)
disconnected
Job GoogleAnalytics ended at 17:26 04/12/2015.
12 REPLIES
Moderator

Re: tGoogleAnalyticsInput time out

Hi,
Is your network Ok with you? Can you connect to Google Analytics successfully without using Talend Tool?
The tGoogleAnalyticsInput is a custom component written by Talend community user and shared on Talend Exchange.
Feel free to contact to the author jan.lolling directly.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: tGoogleAnalyticsInput time out

Hi, 
Is this post has been solved? If yes, how did you solve it?
I encountered exactly the same error.I double checked my network and I can access the internet. I also adjusted the time so that they are in sync with GA server but no luck. 
Any advice would be appreciated.
Regards, 
Cris
Moderator

Re: tGoogleAnalyticsInput time out

Hi Cris,
On which talend build version you got this "timeout" issue?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: tGoogleAnalyticsInput time out

Hi,
I'm facing the same problem and still not finding the answer.
This is the message error :

connecting to socket on port 3416

connected

DEBUG:add metric: {expression=ga:sessions}

WARN:Got error:connect timed out

ERRORSmiley Frustratedtop processing because of this error does not allow a retry.

Exception in component tGoogleAnalyticsInput_1

java.net.SocketTimeoutException: connect timed out

at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)

at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:589)

at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668)

at sun.net.NetworkClient.doConnect(NetworkClient.java:175)

at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)

at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)

at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)

at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)

at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)

at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105)

at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999)

at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)

at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1283)

at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1258)

at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)

at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:77)

at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:981)

at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:283)

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)

at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)

at de.jlo.talendcomp.google.analytics.v4.GoogleAnalyticsInput.doExecute(GoogleAnalyticsInput.java:333)

at de.jlo.talendcomp.google.analytics.v4.GoogleAnalyticsInput.executeDataQuery(GoogleAnalyticsInput.java:284)

at de.jlo.talendcomp.google.analytics.v4.GoogleAnalyticsInput.executeQuery(GoogleAnalyticsInput.java:313)

at local_project.test_0_1.test.tGoogleAnalyticsInput_1Process(test.java:526)

at local_project.test_0_1.test.runJobInTOS(test.java:942)

at local_project.test_0_1.test.main(test.java:799)


Any help would be appreciated.

Best Regards,
jaafer
Seventeen Stars

Re: tGoogleAnalyticsInput time out

Hi Jaafer,
the problem is not caused by the component, you have a network problem. The URLs are fix defined within the API classes and therefore it is also not a configuration problem on your side. Please try to ping this server: www.googleapis.com
Please also take care you have no disturbing firewall configuration.
Sometimes - especially in companies you have to setup a proxy. If you need to setup a proxy in your job please use the components tSetProxy.
One Star

Re: tGoogleAnalyticsInput time out

Hi jlolling,
Thank you for replying. I tried to ping : www.googleapis.com but I cant he told me request timed out.
As you have said I'm in companies and I'll try to use the tSetProxy component.
If this is the solution I'll tell you.
Best Regards,
jaafer
Seventeen Stars

Re: tGoogleAnalyticsInput time out

This is a typical situation. 
The next problem could happen in companies is sometimes, they do not allow transparent https connections and their proxy decrypt the content and encrypt it with a self made certificate. This is a terrible practice and allow the company to read what users send in encrypted channels. In such a case you have to import the company certificate in the java trust store - but you cannot be sure it will work.
One Star

Re: tGoogleAnalyticsInput time out

Hi jlolling,
I configured the tSetProxy and used my company proxy parameters.
When I run the job I get this error :
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Maybe we are using a none trusted certification ?
Best regards,
jaafer
Seventeen Stars

Re: tGoogleAnalyticsInput time out

Yes, you are right, that is exactly what I told you. Your company uses a https proxy and replace the original certificate with a company certificate - obviously a self signed one without binding to a real root certificate. You have to download this and install it on a trust store. Unfortunately my component doe not provide the settings to use an trust store. Use the component tSetKeystore to establish a keystore.
One Star

Re: tGoogleAnalyticsInput time out

Hi jlolling,
So I should download our self signed certificate and install it in a truststore or add it to the JVM keystore which is under my folder :
C:\Program Files\Java\jdk......\jre\lib\security\cacerts. Because maybe I didn't understand well the tSetkeyStore component in which I should provide him with trustStore and keystore.
Thank you again for your help.
Best Regards,
jaafer
One Star

Re: tGoogleAnalyticsInput time out

I forget to say I used a software called : portecle-1.9 to add my certificate to the JVM keystore : C:\Program Files\Java\jdk......\jre\lib\security\cacerts.
But I still get the same error.
One Star

Re: tGoogleAnalyticsInput time out

Hi all,
I want to say that I resolved this problem. So I wanted to share it:
first you need to configure the component tSetProxy with the informations of your proxy server.
If you're using a self signed certificate like me so you need to add it to the JVM keystore : download your certificate and I used a software called portecle-1.9 to add it to my JVM keystore you'll find it here : C:\Program Files\Java\jdk......\jre\lib\security\cacerts.
Finally just restart talend and that's all and I want to thank jlolling again for his nice components.
Best Regards,
jaafer