googleads / googleads/googleads-java-lib

ReportService Method: getReportDownloadUrlWithOptions, FaultMessage: java.net.SocketTimeoutException: Read timed out

Open
#273 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
234
Forks
360
PR merge metrics
No merged PRs in 30d

Description

The problem arises when attempting to generate a GAM report. When generating the URL to download the CSV report file, it takes over 20 minutes and eventually fails with the error message "FaultMessage: java.net.SocketTimeoutException: Read timed out". It's worth mentioning that this issue occurs exclusively in the production environment within a Kubernetes pod. When tested locally, it functions properly without any problems. please find the pod error logs attched

2024-04-03 08:59:35.664 WARN 1 --- [ main] c.g.a.a.a.l.c.A.requestInfoLogger : Request made: Service: ReportService Method: getReportDownloadUrlWithOptions networkCode: 2187-----94 URL: https://ads.google.com/apis/ads/publisher/v202311/ReportService Request ID: null ResponseTime(ms): null OperationsCount: null IsFault: true FaultMessage: java.net.SocketTimeoutException: Read timed out
2024-04-03 08:59:35.669 INFO 1 --- [ main] c.g.a.a.a.l.c.A.soapXmlLogger : SOAP request:

<soapenv:Header>
    <ns1:RequestHeader xmlns:ns1="https://www.google.com/apis/ads/publisher/v202311" soapenv:mustUnderstand="0">
        <ns1:networkCode>21------94</ns1:networkCode>
        <ns1:applicationName>jobGamReportCache (DfpApi-Java, Dfp-Axis/5.4.0, Common-Java/5.4.0, Axis/1.4, Java/1.8.0_342, maven)</ns1:applicationName>
    </ns1:RequestHeader>
</soapenv:Header>
<soapenv:Body>
    <getReportDownloadUrlWithOptions xmlns="https://www.google.com/apis/ads/publisher/v202311">
        <reportJobId>145147484</reportJobId>
        <reportDownloadOptions>
            <exportFormat>CSV_DUMP</exportFormat>
            <useGzipCompression>true</useGzipCompression>
        </reportDownloadOptions>
    </getReportDownloadUrlWithOptions>
</soapenv:Body>

</soapenv:Envelope>

2024-04-03 08:59:35.670 INFO 1 --- [ main] c.g.a.a.a.l.c.A.soapXmlLogger : SOAP response:

<soapenv:Body>
    <soapenv:Fault>
        <faultcode>soapenv:Server.userException</faultcode>
        <faultstring>java.net.SocketTimeoutException: Read timed out</faultstring>
        <detail>
            <ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:464)
at sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:68)
at sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1346)
at sun.security.ssl.SSLSocketImpl.access$300(SSLSocketImpl.java:73)
at sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:962)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:743)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:678)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1595)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1500)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:352)
at com.google.api.client.http.javanet.NetHttpResponse.&lt;init&gt;(NetHttpResponse.java:36)
at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:152)
at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:84)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1012)
at com.google.api.ads.common.lib.soap.axis.HttpHandler.invoke(HttpHandler.java:83)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.google.api.ads.admanager.axis.v202311.ReportServiceSoapBindingStub.getReportDownloadUrlWithOptions(ReportServiceSoapBindingStub.java:788)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.google.api.ads.common.lib.soap.SoapClientHandler.invoke(SoapClientHandler.java:100)
at com.google.api.ads.common.lib.soap.axis.AxisHandler.invokeSoapCall(AxisHandler.java:234)
at com.google.api.ads.common.lib.soap.SoapServiceClient.callSoapClient(SoapServiceClient.java:63)
at com.google.api.ads.common.lib.soap.SoapServiceClient.invoke(SoapServiceClient.java:93)
at com.sun.proxy.$Proxy71.getReportDownloadUrlWithOptions(Unknown Source)
at com.google.api.ads.admanager.axis.utils.v202311.ReportDownloader.getDownloadUrl(ReportDownloader.java:187)
at com.example.jobGamInstreamReportToBq.GamKeyValueReportToBqService.downloadReportFromGAMAndProcessToBQ(GamKeyValueReportToBqService.java:116)
at com.example.jobGamInstreamReportToBq.GamInstreamReportToBqReportService.processGamReportForKeyValues(GamInstreamReportToBqReportService.java:307)
at com.example.jobGamInstreamReportToBq.GamCustomReportsToBqService.runReportForKeyValues(GamCustomReportsToBqService.java:113)
at com.example.jobGamInstreamReportToBq.GamCustomReportsToBqService.run(GamCustomReportsToBqService.java:243)
at com.example.JobGamReportCacheApplication.main(JobGamReportCacheApplication.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)

</ns1:stackTrace>
<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">job-custom-gam-reports-manual-hyter-7q5sf</ns2:hostname>

</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ReportDownloader.getDownloadUrl call and the application stack frames at GamKeyValueReportToBqService.java:116 and GamInstreamReportToBqReportService.java:307. Compare the Java client’s HTTP behavior in the Kubernetes pod with the local run, using the attached Axis and NetHttpRequest timeout stack trace; done means identifying a reproducible cause and verifying that report URL generation completes in the affected environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.