B4G: Validate Bitbucket Server connection error - Read timed out
search cancel

B4G: Validate Bitbucket Server connection error - Read timed out

book

Article ID: 262129

calendar_today

Updated On:

Products

Endevor

Issue/Introduction

Having connection issue between Bridge for Git server and Bitbucket. 

Bridge for git log: 

2023-02-21 01:46:05.003  INFO 39426 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 58322 ms

2023-02-21 01:46:29.118 ERROR 39426 --- [           main] c.c.e.b.v.auth.BitbucketValidator        :

com.ca.endevor.integration.connector.rest.exception.RestConnectorException: java.net.SocketTimeoutException: Read timed out
        at com.ca.endevor.integration.connector.git.rest.bitbucket.BitbucketClient.call(BitbucketClient.java:148)
        at com.ca.endevor.integration.connector.git.rest.bitbucket.BitbucketClient.post(BitbucketClient.java:181)
Caused by: 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.<init>(NetHttpResponse.java:36)
        at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:149)
        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.ca.endevor.integration.connector.git.rest.bitbucket.BitbucketClient.call(BitbucketClient.java:136)
        ... 105 common frames omitted

2023-02-21 01:46:29.178 ERROR 39426 --- [           main] o.s.b.web.embedded.tomcat.TomcatStarter  : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'personalTokenAuthenticationFilter' defined in URL [jar:file:/home/XXXX/bridge_for_git/BridgeForGit-2.10.2.jar!/BOOT-INF/classes!/com/ca/endevor/boot/security/PersonalTokenAuthenticationFilter.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'app-com.ca.endevor.boot.config.AppProperties': Could not bind properties to 'AppProperties' : prefix=app, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'app' to com.ca.endevor.boot.config.AppProperties

2023-02-21 01:46:29.257  INFO 39426 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2023-02-21 01:46:29.263  WARN 39426 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2023-02-21 01:46:29.448  INFO 39426 --- [           main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run application with 'debug' enabled.
2023-02-21 01:46:29.524 ERROR 39426 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :
***************************
APPLICATION FAILED TO START
***************************

 

Description:
Binding to target org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'app' to com.ca.endevor.boot.config.AppProperties failed:
    Reason:
    Reason: There was an error when trying to start Bridge for Git.
    Reason: Validate Bitbucket Server connection error: com.ca.endevor.integration.connector.rest.exception.RestConnectorException: java.net.SocketTimeoutException: Read timed out
    Caused by: java.net.SocketTimeoutException: Read timed out
    Action: Update your application's configuration

 

Environment

Release : 18.1

Bridge for git version 2.10.2

Cause

The default read timeout for the Bitbucket validation is lower than the other Git clients. 

Resolution

The Broadcom development team will increase the read timeout on the Bitbucket client for the startup validation, this fix will be included in the upcoming Bridge for Git release.  

Workaround:  set startup-validation:disabled in application.yml.

For example:

git-bridge:
    # Instance URL (e.g http://<external-URL>)
    url: http://www.example.com:8080
    startup-validation: DISABLED