We have a task (goovy/gradle) that calls the confluence API to update the content and upload attachments. The task runs successfully for some pages, but fails on others. It's always different which page fails to update.
request = new HttpPut(String.format("%s/rest/api/content/%s?os_authType=basic&os_username=%s&os_password=%s", config.baseURL, 290363828, URLEncoder.encode(config.user, Charsets.UTF_8.name()), URLEncoder.encode(config.password, Charsets.UTF_8.name())));
09:17:44.853 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection request: [route: {s}->https://confluence.test.net:443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
09:17:44.853 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection leased: [id: 146][route: {s}->https://confluence.test.net:443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
09:17:44.853 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Opening connection {s}->https://confluence.test.net:443
09:17:44.853 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connecting to confluence.test.net/10.130.30.47:443
09:17:44.853 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Connecting socket to confluence.test.net/10.130.30.47:443 with timeout 0
09:17:44.854 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Enabled protocols: [TLSv1, TLSv1.1, TLSv1.2]
09:17:44.855 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Enabled cipher suites:[TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
09:17:44.855 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Starting handshake
09:17:44.877 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Secure session established
09:17:44.877 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] negotiated protocol: TLSv1.2
09:17:44.877 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] negotiated cipher suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
09:17:44.877 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] peer principal: CN=confluence.test.net, OU=IT, O=Avaloq Evolution AG, L=Zurich, ST=Zurich, C=CH
09:17:44.877 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] peer alternative names: [confluence.test.net]
09:17:44.877 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] issuer principal: CN=Avaloq Issuing CA 001 - SITS, O=Avaloq, C=CH
09:17:44.877 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connection established 10.116.2.164:36484<->10.130.30.47:443
09:17:44.877 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Executing request PUT /rest/api/content/290363828?os_authType=basic&os_username=****&os_password=**** HTTP/1.1
09:17:44.877 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Target auth state: UNCHALLENGED
09:17:44.877 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Proxy auth state: UNCHALLENGED
09:20:54.146 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-146: Close connection
09:20:54.146 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-146: Shutdown connection
There is a big difference on time, I'm guessing this the reason why did the connection closed. Timeout is set to 0, but somehow the connection closes.
Is there any other reason for this issue?