6
votes

I got this log message:

com.amazonaws.services.s3.model.AmazonS3Exception: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID: request_id; S3 Extended Request ID:extended_request_id)

Is it possible to get parameters for the request (in this case S3 key and bucket) by request_id and extended_request_id ?

1
I think it doesn't give you the request parameters from aws sdk. I think you can get the s3 key and bucket if you log the AWS request and responses by enabling the http debug log. Please refer to this: linkRodel

1 Answers

6
votes

The Request ID is received on the wire as x-amz-request-id and is styled as the Request ID in the S3 access logs..

This will not provide exhaustive information about the request parameters, depending on what you are trying to find, but it will show the bucket and key -- though you'll have to know which bucket's logs to look in, of course.

More detailed information about the request can potentially found in CloudTrail logs. Object level requests are not captured by CloudTrail by default, so you'd need to enable this. The request ID should appear in these logs as well.

The Extended Request ID, also called x-amz-id-2 is -- as far as I am aware -- only of use to AWS support when tracing things internally for you. Neither value is known to contain sensitive information. The extended ID may be a large random number or may be encrypted, but if it is encrypted, there is no documented way to decrypt it. The documentation calls it a "special token." A little bit more detail in the context of support is here.

In summary, there is no short/simple "lookup" method but it is possible, as noted above.