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

fix: Use S3 Upload function instead of PutObjectCommand #218

Merged
merged 3 commits into from
Jul 13, 2024

Conversation

jadenv
Copy link
Contributor

@jadenv jadenv commented Jul 11, 2024

We started frequently facing this error when uploading S3 assets
RequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.

After some research, it seems like using the Upload constructor from @aws-sdk/lib-storage has more fault tolerance and better retry logic than the usual S3 PutObjectCommand.

https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-lib-storage/

We have been running this change in production for a few weeks now and haven't had the error happen once since, so it seems to fix the issue.

@jadenv jadenv changed the title Use S3 Upload function instead of PutObjectCommand fix: Use S3 Upload function instead of PutObjectCommand Jul 11, 2024
@bestickley bestickley merged commit 8e1e853 into jetbridge:main Jul 13, 2024
4 of 5 checks passed
@onhate
Copy link
Contributor

onhate commented Aug 2, 2024

Not sure if it was this change or what but since 4 was released my deployments are failing on next bucket deployment lambda stage with the error XAmzContentSHA256Mismatch: The provided 'x-amz-content-sha256' header does not match what was computed.

@onhate
Copy link
Contributor

onhate commented Aug 2, 2024

I've traced to the 4.0.0-beta.31 release, it works on 4.0.0-beta.30, so definitely this is the cause

https://github.com/jetbridge/cdk-nextjs/releases/tag/v4.0.0-beta.31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants