Curl timeouts when using AWS cpp sdk for Google cloud

419 Views Asked by At

I have a Debian 9 client with aws cpp sdk installed. I am using this sdk for Google Cloud Storage. The sdk uses curl to issue requests to the cloud. I have a test program which does a bunch of PUTs to the cloud. I observed that a couple of PUTs succeed initially and then I start seeing curl timeout errors for PUTs. Following are logs from AWS sdk which indicate that the curl request timed out:

[DEBUG] 2020-09-08 20:24:44.466 AWSAuthV4Signer [140206136674048] Signed Headers value:content-length;content-type;host;x-amz-content-sha256;x-amz-date
[DEBUG] 2020-09-08 20:24:44.466 AWSAuthV4Signer [140206136674048] Canonical Request String: PUT
<Objname>

content-length:2101248
content-type:binary/octet-stream
host:storage.googleapis.com
x-amz-content-sha256:UNSIGNED-PAYLOAD
x-amz-date:20200908T202444Z

content-length;content-type;host;x-amz-content-sha256;x-amz-date
UNSIGNED-PAYLOAD
[DEBUG] 2020-09-08 20:24:44.466 AWSAuthV4Signer [140206136674048] Final String to sign: AWS4-HMAC-SHA256
20200908T202444Z
20200908/us-east-1/s3/aws4_request
79a64334206d67cfc19f147fdf51caa409d39f5054ab48a7ca655d5bc3a30438
..
[DEBUG] 2020-09-08 20:24:44.466 AWSClient [140206136674048] Request Successfully signed
[DEBUG] 2020-09-08 20:24:44.466 CurlHandleContainer [140206136674048] Attempting to acquire curl connection.
[INFO] 2020-09-08 20:24:44.466 CurlHandleContainer [140206136674048] Connection has been released. Continuing.
[DEBUG] 2020-09-08 20:24:44.466 CurlHandleContainer [140206136674048] Returning connection handle 0x7f839801e740
[DEBUG] 2020-09-08 20:24:44.466 CurlHttpClient [140206136674048] Obtained connection handle 0x7f839801e740
[ERROR] 2020-09-08 20:26:44.739 CurlHttpClient [140206136674048] Curl returned error code 28 - Timeout was reached
[DEBUG] 2020-09-08 20:26:44.739 CurlHandleContainer [140206136674048] Releasing curl handle 0x7f839801e740
[DEBUG] 2020-09-08 20:26:44.739 CurlHandleContainer [140206136674048] Notified waiting threads.
[DEBUG] 2020-09-08 20:26:44.739 AWSClient [140206136674048] Request returned error. Attempting to generate appropriate error codes from response
[ERROR] 2020-09-08 20:26:44.739 AWSClient [140206136674048] HTTP response code: -1
Exception name:
Error message: Unable to connect to endpoint

Some observations that I have:

  • I don't have this issue with GETs.
  • I see this issue only when using Debian. When I tried a host with Ubuntu 18.04, it worked fine.
  • I don't see this issue when I use HTTP and port 80 instead of HTTPS and port 443.

Any ideas what might be causing the curl timeouts?

0

There are 0 best solutions below