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

DynamoDB returns operation error use of closed network (relates to issue #1825) #2935

Closed
2 of 3 tasks
katesclau opened this issue Dec 18, 2024 · 2 comments
Closed
2 of 3 tasks
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@katesclau
Copy link

Acknowledgements

Describe the bug

SDK often returns the error below

operation error DynamoDB: Query, https response error StatusCode: 200, RequestID: E8GNL8TL9KAI5LAERRM784GLBJVV4KQNSO5AEMVJF66Q9ASUAAJG, deserialization failed, failed to decode response body, read tcp 10.204.XX.XXX:38876->35.71.XX.XXX:443: use of closed network connection

Regression Issue

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

Expected Behavior

No errors

Current Behavior

operation error DynamoDB: Query, https response error StatusCode: 200, RequestID: E8GNL8TL9KAI5LAERRM784GLBJVV4KQNSO5AEMVJF66Q9ASUAAJG, deserialization failed, failed to decode response body, read tcp 10.204.XX.XXX:38876->35.71.XX.XXX:443: use of closed network connection

Reproduction Steps

	ddb := dynamodb.NewFromConfig(awsCfg, func(o *dynamodb.Options) {
		client := o.HTTPClient.(*awshttp.BuildableClient)
		o.HTTPClient = client.WithTransportOptions(func(t *http.Transport) {
			t.DialContext = trace.TraceConn(t.DialContext)
		})
	})
	item, err := ddb.GetItem(ctx, &dynamodb.GetItemInput{
		TableName: "test-table-name",
		Key: map[string]types.AttributeValue{
			lstAttrID: &types.AttributeValueMemberS{Value: id},
		},
	})
	if err != nil {
		return nil, err
	}

Possible Solution

No response

Additional Information/Context

Additional Information/Context

As requested on Issue #1825 , we've implemented a TracedConnection to evaluate the stack trace on the connection close event, following these instructions:

goroutine 52154 [running]:
runtime/debug.Stack()
\t/usr/local/go/src/runtime/debug/stack.go:26 +0x5e
github.com/.../helpers/trace.(*TracedConn).Close(0xc001fde9e0)
\t/tmp/source/vendor/github.com/.../helpers/trace/tracedconnection.go:43 +0x18
crypto/tls.(*Conn).Close(0xc00018a010?)
\t/usr/local/go/src/crypto/tls/conn.go:1444 +0xc8
net/http.(*persistConn).closeLocked(0xc0001ea480, {0x19e6a00, 0x2400680})
\t/usr/local/go/src/net/http/transport.go:2848 +0x13a
net/http.(*persistConn).close(0xc0001e0d80?, {0x19e6a00?, 0x2400680?})
\t/usr/local/go/src/net/http/transport.go:2833 +0xa5
net/http.(*persistConn).closeConnIfStillIdle(0xc0001ea480)
\t/usr/local/go/src/net/http/transport.go:2103 +0xbd
created by time.goFunc
\t/usr/local/go/src/time/sleep.go:215 +0x2d

AWS Go SDK V2 Module Versions Used

	github.com/aws/aws-sdk-go-v2 v1.32.6
	github.com/aws/aws-sdk-go-v2/config v1.28.6
	github.com/aws/aws-sdk-go-v2/credentials v1.17.47
	github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.21
	github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression v1.7.56
	github.com/aws/aws-sdk-go-v2/service/dynamodb v1.38.0
	github.com/aws/aws-sdk-go-v2/service/s3 v1.71.0
	github.com/aws/aws-sdk-go-v2/service/sqs v1.37.2

Compiler and Version used

go 1.23.0

Operating System and version

Linux (alpine:latest)

@katesclau katesclau added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 18, 2024
@lucix-aws
Copy link
Contributor

lucix-aws commented Dec 18, 2024

Looks like your trace matches one someone posted in #2737 so closing as duplicate. Track that ticket for updates.

@lucix-aws lucix-aws closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants