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

Intermittent InternalError on PutObject requests #6459

Open
3 tasks done
litsters opened this issue Sep 10, 2024 · 2 comments
Open
3 tasks done

Intermittent InternalError on PutObject requests #6459

litsters opened this issue Sep 10, 2024 · 2 comments
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Comments

@litsters
Copy link

Checkboxes for prior research

Describe the bug

Our electron app ([email protected]) uses the SDK to copy a large number of image files (hundreds to a thousand in a set, 120 sets a day) from a local disk to our S3 bucket. We recently switched from version 2 of the SDK to version 3, and now we are getting a large number of 500 errors from PutObject requests. Prior to the switch we had never had one of these errors surface, and now the majority of sets we try to upload have one interrupt the process.

Errors are hard to reproduce, as when we tell the system to retry these failures it's usually able to do them without a problem. The full error is InternalError: We encountered an internal error. Please try again.

We use anonymous clients for these uploads, so we can't use the version 3 Upload to do this. We stream the files from disk to avoid reading all of them into memory, and do about 40 PutObject requests at a time.

I was able to get a screenshot with details about the request itself. Hoping that will make this easier to look into.
details

SDK version number

@aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

16.17

Reproduction Steps

These errors aren't deliberately reproducible. Whether or not they happen is random and the error is transient.

Observed Behavior

We see a lot of PutObjectCommands fail with S3 putObject failed with S3ServiceException [InternalError]: We encountered an internal error. Please try again.

stack_trace

Expected Behavior

I expect these errors to not be thrown, or at least be thrown rarely. The message suggests they can be retried, but they're being thrown anyways.

Possible Solution

Maybe the version 3 sdk has changed how it handles stream uploads so that automatic retries don't happen.

Additional Information/Context

No response

@litsters litsters added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 10, 2024
@aBurmeseDev
Copy link
Member

Hi @litsters - thanks for reaching out.

The error you're seeing is a generic error message from S3 indicating that there was an unexpected issue on the AWS side during the PutObject request. This error is typically transient and retrying the request usually resolves the issue.

Are you retrying these requests? If so, consider increasing timeouts values. Sometimes, transient issues can cause requests to take longer than expected leading to timeouts and errors.

Another recommendation is to consider a retry mechanism with exponential backoff for failed PutObject requests. This will help reduce the load on S3 by spacing out retries and giving AWS time to recover from any temporary issues.

Here's docs on retry strategy and backoff computation: https://github.com/smithy-lang/smithy-typescript/blob/main/packages/util-retry/README.md

If issue persists, please share a minimal reproducible code for further guidance and investigation.

Hope it helps!
Best,
John

@aBurmeseDev aBurmeseDev self-assigned this Sep 13, 2024
@aBurmeseDev aBurmeseDev added response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Sep 13, 2024
@litsters
Copy link
Author

Thanks for the response. It does look like timeouts may be a factor here, so I'll look closer there.

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. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants