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

s3Object.Body.transformToWebStream().pipeTo(Writable.toWeb(destinationStream)) promise never settle from 3.729.0 #6827

Closed
3 of 4 tasks
ert78gb opened this issue Jan 18, 2025 · 9 comments
Assignees
Labels
bug This issue is a bug. p1 This is a high priority issue queued This issues is on the AWS team's backlog

Comments

@ert78gb
Copy link

ert78gb commented Jan 18, 2025

Checkboxes for prior research

Describe the bug

await s3Object.Body.transformToWebStream().pipeTo(Writable.toWeb(destinationStream)) never settle from @aws-sdk/[email protected].
Everything works fine with @aws-sdk/[email protected]

The issue is present in the latest 3.731.1 version too.

Regression Issue

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

SDK version number

@aws-sdk/[email protected], @aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v22.13.0, v23.6.0

Reproduction Steps

Reproduction repo https://github.com/ert78gb/aws-sdk3-729-0-s3-streampipe-issue

Observed Behavior

The stream pipe crashes

Expected Behavior

no crash

Possible Solution

If you don't use stream, but consume much memory in case of large files.

Additional Information/Context

Maybe the related Node.js issue nodejs/node#56139
BUT everything works fine with node 22 and 23 with @aws-sdk/[email protected]
so an aws sdk modification breaks this.

@ert78gb ert78gb added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 18, 2025
@agustin-golmar
Copy link

Exactly the same problem, but in another context:

Image

It stops between steps C and D forever:

Image

This methods works perfectly for years, but brokes after update NPM dependency @aws-sdk/client-s3 to 3.731.1.

The Node.js runtime version is 20.18.0. I think that the method that cause the halt was:

const manifest = await (integrityManifest.Body?.transformToString("utf-8"))

but I was wrong, it was the previously getObjectAsync that was called just before this.

Good luck!

@s1owjke
Copy link

s1owjke commented Jan 23, 2025

We encountered a similar issue during the upgrade of @aws-sdk/client-s3 from 3.717.0 to 3.731.1.

The problem only occurs for files with checksum (which is now calculated by default since 3.729.0 release). This issue only affects the transformToWebStream method, which appears to never close properly, which is a root cause.

@gsf4726
Copy link

gsf4726 commented Jan 23, 2025

We just encountered this bug as well after upgrading @aws-sdk/client-s3 from 3.726.1 that is blocking our S3 downloads.

I'm surprised there's not more activity around this or investigation started?

Here's our usage that demonstrates the issue:

const downloadFileStream = fs.createWriteStream(filePath);
const response = await this.client.send(new GetObjectCommand(input));
await pipeline(response.Body.transformToWebStream(), writableStream); // <-- Never resolves

@kuhe kuhe self-assigned this Jan 23, 2025
@kuhe kuhe added investigating Issue is being investigated and/or work is in progress to resolve the issue. pending-release This issue will be fixed by an approved PR that hasn't been released yet. queued This issues is on the AWS team's backlog and removed investigating Issue is being investigated and/or work is in progress to resolve the issue. needs-triage This issue or PR still needs to be triaged. labels Jan 23, 2025
@kuhe
Copy link
Contributor

kuhe commented Jan 24, 2025

Hi, thanks to everyone who reported this issue.

This should be fixed as of https://github.com/aws/aws-sdk-js-v3/releases/tag/v3.735.0 with
https://www.npmjs.com/package/@aws-sdk/client-s3/v/3.735.0.

@kuhe kuhe added response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. p1 This is a high priority issue and removed pending-release This issue will be fixed by an approved PR that hasn't been released yet. labels Jan 24, 2025
@dimfeld
Copy link

dimfeld commented Jan 24, 2025

Confirmed that our tests which were failing on 3.729 work with 3.735. Thanks!

@agustin-golmar
Copy link

We test GetObjectCommand again and it works perfectly with the new realease v3.735.0. Problem solved. Thanks!

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Jan 25, 2025
@ert78gb
Copy link
Author

ert78gb commented Jan 25, 2025

I can confirm the referenced version solves the problem. Thx for the fix

@ert78gb ert78gb closed this as completed Jan 25, 2025
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.

Copy link

github-actions bot commented Feb 9, 2025

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. p1 This is a high priority issue queued This issues is on the AWS team's backlog
Projects
None yet
Development

No branches or pull requests

6 participants