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

requestId is not populated in metadata if header name is x-amz-request-id #1522

Closed
trivikr opened this issue Sep 14, 2020 · 1 comment · Fixed by #1640
Closed

requestId is not populated in metadata if header name is x-amz-request-id #1522

trivikr opened this issue Sep 14, 2020 · 1 comment · Fixed by #1640
Assignees
Labels
bug This issue is a bug. High Priority

Comments

@trivikr
Copy link
Member

trivikr commented Sep 14, 2020

Describe the bug
requestId is not populated in metadata if header name is x-amz-request-id

In 0.1.0-preview clients, the requestId was populated from x-amz-request-id or x-amz-requestid

requestId:
httpHeaders[REQUEST_ID_HEADER] || httpHeaders[REQUEST_ID_ALT_HEADER],

In gamma clients, the requestId is only populated from x-amzn-requestid

const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
httpStatusCode: output.statusCode,
httpHeaders: output.headers,
requestId: output.headers["x-amzn-requestid"],
});

Due to this, the requestId is not populated in metadata if header name is x-amz-request-id

SDK version number

    "@aws-sdk/client-s3-control": "1.0.0-gamma.8",
    "@aws-sdk/client-sts": "1.0.0-gamma.8",

To Reproduce (observed behavior)

Code
const { STS } = require("@aws-sdk/client-sts");
const { S3Control } = require("@aws-sdk/client-s3-control");

(async () => {
  const stsClient = new STS({});
  const s3ControlClient = new S3Control({});

  const { Account } = await stsClient.getCallerIdentity({});
  console.log(await s3ControlClient.listAccessPoints({ AccountId: Account }));
})();
Output
{
  '$metadata': {
    httpStatusCode: 200,
    httpHeaders: {
      'x-amz-id-2': 'r7rFiQubPFSqaW+cXofM2hmAYGqtbg5Jj3ctEWwt1cKzx5eFFW5lwrTa6Qn1rdYEZxrlcEQiD5E=',
      'x-amz-request-id': '2516C4C3BADE55E6',
      date: 'Mon, 14 Sep 2020 16:32:45 GMT',
      'content-length': '72',
      server: 'AmazonS3'
    },
    requestId: undefined,
    attempts: 1,
    totalRetryDelay: 0
  },
  __type: 'ListAccessPointsResult',
  AccessPointList: [],
  NextToken: undefined
}

Expected behavior
requestId is populated from header x-amz-request-id

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. High Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants