Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket timout exception #1537

Open
Raghuram0704 opened this issue Jun 22, 2020 · 0 comments
Open

Socket timout exception #1537

Raghuram0704 opened this issue Jun 22, 2020 · 0 comments
Labels
priority: p4 type: question Request for information or clarification. Not an issue.

Comments

@Raghuram0704
Copy link

Raghuram0704 commented Jun 22, 2020

Thanks for stopping by to let us know something could be better!

Please be sure to include as much information as possible:

Environment details

  • OS: linux
  • Java version: 1.8
  • google-api-java-client version:1.30.2

Steps to reproduce

  1. After intitializing Sheets
    public Sheets getSheetsService() throws GeneralSecurityException, IOException {
    Credential credential = getCredential(); // returns credentials

    HttpRequestInitializer httpRequestInitializer = new HttpRequestInitializer() {
    @OverRide
    public void initialize(HttpRequest request) throws IOException {
    credential.initialize(request);
    request.setConnectTimeout(560000);
    request.setReadTimeout(5
    60000);
    }
    };

    Sheets sheets = null;
    if(Optional.ofNullable(credential).isPresent()) {
    sheets = new Sheets.Builder(GoogleNetHttpTransport.newTrustedTransport(),
    JacksonFactory.getDefaultInstance(), credential)
    .setApplicationName("Google Sheets Client").setHttpRequestInitializer(httpRequestInitializer).build();
    }
    return sheets;
    }

  2. when spread sheet create execute is called, resulting in socket timeout exception
    sheets.spreadsheets().create(spreadSheet).execute();

Stacktrace

Any relevant stacktrace here.

java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:1.8.0_201]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[?:1.8.0_201]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[?:1.8.0_201]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[?:1.8.0_201]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:1.8.0_201]
at java.net.Socket.connect(Socket.java:589) ~[?:1.8.0_201]
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:666) ~[?:?]
at sun.net.NetworkClient.doConnect(NetworkClient.java:175) ~[?:?]
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463) ~[?:?]
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558) ~[?:?]
at sun.net.www.protocol.https.HttpsClient.(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:1156) ~[?:?]
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050) ~[?:?]
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177) ~[?:?]
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1334) ~[?:?]
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1309) ~[?:?]
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:259) ~[?:?]
at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:108) ~[google-http-client-1.30.1.jar:?]
at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:79) ~[google-http-client-1.30.1.jar:?]
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:995) ~[google-http-client-1.30.1.jar:?]
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:549) ~[google-api-client-1.30.2.jar:1.30.2]
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:482) ~[google-api-client-1.30.2.jar:1.30.2]
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:599) ~[google-api-client-1.30.2.jar:1.30.2]

External references such as API reference guides used

  • ?

Any additional information below

I have set the request.setConnectTimeout(560000);
request.setReadTimeout(5
60000);
Still same error, any idea of this error

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Jun 22, 2020
@chingor13 chingor13 added the type: question Request for information or clarification. Not an issue. label Jun 29, 2020
@yoshi-automation yoshi-automation removed triage me I really want to be triaged. 🚨 This issue needs some love. labels Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p4 type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

4 participants