Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get request parameters by AWS request ID

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 ?

like image 327
Alexander Ershov Avatar asked Sep 30 '18 07:09

Alexander Ershov


People also ask

How do I get AWS request ID?

Using the AWS CLI to Obtain Request IDsYou can get your request IDs in the AWS CLI by adding --debug to your command. To use the Amazon Web Services Documentation, Javascript must be enabled. Please refer to your browser's Help pages for instructions.

Is AWS request ID unique?

A 12-digit number, such as 123456789012, that uniquely identifies an AWS account.

What is Amazon request ID?

x-amzn-RequestIdA value created by Amazon {service} that uniquely identifies your request. If you have a problem with Amazon {service}, AWS can use this value to troubleshoot the problem. We recommend that you log these values.

How do I view S3 requests?

You can identify Amazon S3 requests with Amazon S3 access logs using Amazon Athena. Amazon S3 stores server access logs as objects in an S3 bucket. It is often easier to use a tool that can analyze the logs in Amazon S3. Athena supports analysis of S3 objects and can be used to query Amazon S3 access logs.


1 Answers

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.

like image 63
Michael - sqlbot Avatar answered Sep 22 '22 08:09

Michael - sqlbot