Skip to content

S3 PutObject between regions fails after @smithy/node-http-handler 3.3.2Β #6805

@Nevon

Description

@Nevon

Checkboxes for prior research

Describe the bug

When doing a PutObject request using versions of @smithy/node-http-handler equal or higher than 3.3.2 from eu-north-1 to ap-southeast-2 the request fails with RequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed. after a long period of doing nothing. Making the same request using version 3.3.1 or lower works.

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/[email protected]
@smithy/[email protected] (or higher)

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.11.1

Reproduction Steps

To reproduce, I simply created an S3 bucket in ap-southeast-2 and issued a PutObject request from my local computer (located in Stockholm):

const s3client = new S3Client({ region: 'ap-southeast-2', logger: console });
const response = await s3client.send(new PutObjectCommand({
  Bucket: process.env.BUCKET_NAME!,
  Body: randomBytes(1024 * 100),
  Key: randomUUID(),
  ContentType: 'text/plain',
}));

Observed Behavior

After quite some time, the resulting error is:

RequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.
    at throwDefaultError ... {
  '$fault': 'client',
  '$metadata': {
    httpStatusCode: 400,
    requestId: 'VT6TYR1KW11KX7TK',
    extendedRequestId: 'az0TnxKnm01z0ioaVq72g1p22izk6qK6a2chdPs/uYIcJVRT1Vzz4w7ZuxBE7fFdeD8sPsxqHL0=',
    cfId: undefined,
    attempts: 3,
    totalRetryDelay: 84
  },
  Code: 'RequestTimeout',
  RequestId: 'VT6TYR1KW11KX7TK',
  HostId: 'az0TnxKnm01z0ioaVq72g1p22izk6qK6a2chdPs/uYIcJVRT1Vzz4w7ZuxBE7fFdeD8sPsxqHL0='
}

Expected Behavior

If I change the version of @smithy/node-http-handler to be used to 3.3.1 using resolutions, the request works.

Possible Solution

Fixed in smithy-lang/smithy-typescript#1505

Additional Information/Context

The issue happens only if it takes more than 1000ms for the server to send the 100 Continue response after the client sends the initial Expect: 100-continue header. That's why this only occurred for us when making a request from Sweden to Sydney.

Metadata

Metadata

Labels

bugThis issue is a bug.closed-for-stalenessp1This is a high priority issuepotential-regressionMarking this issue as a potential regression to be checked by team memberqueuedThis issues is on the AWS team's backlogworkaround-availableThis issue has a work around available.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions