-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
S3 GetObjectRequest flakily has empty RequestID #5141
Comments
Hi @christodenny, A couple of points.
The error you are seeing is a networking error indicating the server is closing the connection prematurely. This means that the server's repsonse is not going to make it to the client, and therefore the request object will not contain the requestID object. Here is a visual aid: package main
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"log"
)
func main() {
sess, err := session.NewSession(&aws.Config{
Region: aws.String("us-east-1"),
LogLevel: aws.LogLevel(aws.LogDebugWithHTTPBody),
})
if err != nil {
panic(err)
}
params := &s3.GetObjectInput{
Bucket: aws.String("fake-bucket"),
Key: aws.String("fake-key"),
}
req, _ := s3.New(sess).GetObjectRequest(params)
err = req.Send()
if err != nil {
log.Fatal("AWS request failed, requestID: ", req.RequestID, ", error: ", err.Error())
}
} Output log:
Because in your case the response is not a valid server response, instead it is a networking stack error, that information will not be present, and the SDK will not be able to deserialize that information from the response. I'm not sure why the service is resetting the connection, but the service team might be able to use the Let me know how it goes. |
This issue has not received a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled. |
Describe the bug
RequestError: send request failed
read tcp 10.205.2.84:50600->52.216.106.252:443: read: connection reset by peer
anddial tcp 52.92.136.58:443: i/o timeout
Expected Behavior
RequestID field is populated so we can log and attach to AWS support ticket
Current Behavior
During these failures the RequestID field is empty
Reproduction Steps
The following flakily repros. When i run it locally one off the req succeeds, but in prod across millions of requests it occasionally doesn't have RequestID populated:
Possible Solution
I noticed locally editing this logic that if I log
req.RequestID
before callingreq.Send()
the RequestID is always empty.Is this ID only populated after successfully contacting the S3 server? These failures to populate the RequestID are correlated with
connection reset by peer
andi/o timeout
. I wonder if those errors imply something failed before we either generate a request ID or get one back from S3.Additional Information/Context
No response
SDK version used
v1.43.39
Environment details (Version of Go (
go version
)? OS name and version, etc.)go version go1.21.4 darwin/amd64
The text was updated successfully, but these errors were encountered: