-
Notifications
You must be signed in to change notification settings - Fork 220
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
Fails to stream to S3 using AWS SDK v3 #662
Comments
I am having the same problem as well. For me it seems especially files with larger file size tend to cause this issue. For some small files it works fine. I hope this can be solved. |
I ran into this today, and managed to get it working better, though perhaps not entirely. I don't fully understand what's happening, and came to the issues to look for an explanation. If you start the S3 Upload promise first, but don't await it, then append to the zip, then await the
I also tried |
I am facing very similar issue, where I am pushing files by zipping them to a sftp server, for small multiple files its working, but for large files, for example I have 3 files each one above 1.12 gb, then I am getting "Archive Error Error: Aborted". has anyone tried such large files, or this library can't handle such big files |
Similar problem here today. I solved this by adding httpsAgent in the s3Client config
|
Hello ! Is there any update on this issue? I am experiencing the same problem. I am testing on archiving s3 prefix which contains 200 objects. |
Try increasing the highWaterMark of your PassThrough stream. |
do you mean like this?
You can see I set it as 1GB but still not working |
I have the same problem. To me it looks it is not streaming at all. Increasing the |
Also experiencing this issue. I dug into it a bit. The problem seems to be that the underlying In Changing the order of promises as @michael-raymond mentioned above seems to make it work. In this case, Anyway that's as far as I dug, hopefully this is helpful. |
Any updates on this? |
Thank you. This was extremely helpful when nothing else was, for a problem related to another package. |
We had trouble with our process ending with no error while trying to implement zip streaming with the s3 v3 sdk. The thing that helped us:
Hope this is helpful in getting someone get past this issue.
|
A similar problem with a Heap out of memory error, |
I have the same problem, when I add ~200 images to the archive everything works fine, when I increase number of images to 1k my lambda exits with success status after 5 minutes (my lambda timeout is 15 minutes). I tried the following:
|
This gist helped me a ton after running into swallowed errors and my lambdas ending without any notice: https://gist.github.com/amiantos/16bacc9ed742c91151fcf1a41012445e?permalink_comment_id=3804034#gistcomment-3804034. Might help you too! |
Hi, I create a zip for 35 files (50M per file) from GCS(Google Cloud Storage), since they are remote files, streaming them one by one works for me: const files = [/* your files */]
const archive = archiver('zip', {
zlib: { level: 1 },
})
archive
.on('entry', (entry) => { // fires when the file been processed and appended to the archive
// Stream the next file.
// In contrast to local files, it's reasonable to stream remote files
// one by one, or else when streaming massive remote files at once
// (i.e. call `archive.append()` for all files), it's likely the
// streaming will be stuck.
streamNext()
})
let index = 0
const streamNext = () => {
const file = files[index++]
if (!file) {
// Finalize when all files are processed.
archive.finalize().then(() => console.log('archive finalized'))
return
}
const stream = createGcsReadStream(file.url)
archive.append(stream, { name: 'something' })
}
// Start streaming.
streamNext() |
Had similar setup to @fullstackzach (archiver + @aws-sdk/lib-storage) and found that the advice on initiating the S3 We found that we could use same S3 Client for all operations (we get Readable stream from S3 for each file using same client).
|
I got it working - I followed the linked instructions exactly, but I had to downgrade to archiver 5.3.2! Once I followed those instructions with 5.3.2 it worked perfectly. 6.0.0 and newer do not work with the solution in the linked gist comment. |
I need to stream a number of files from S3, zip them and stream them back to S3 as a zip file.
I had a previous working version using aws-sdk V2, but I'm attempting to now replace that implementation with V3.
Here's a simplified example of some code to reproduce the issue I'm seeing. This correctly streams the input file down from S3, but then never seems to pipe any output back into the upload stream.
The console output will usually output the zip entry (inconsistently), but I never see any console logs related to upload, and no object gets created in S3. The command completes with exit code 0, but never outputs 'done' from the log statement at the end of the file.
I suspect there is some incompatibility that's been introduced with V3, and noticed there are some discussions relating to the version of readable-stream in archiver here: https://stackoverflow.com/questions/69751320/upload-stream-to-amazon-s3-using-nodejs-sdk-v3
Can anyone reproduce or provide a workaround?
Archiver 5.3.1
Node 18.16.0
@aws-sdk/client-s3 3.327.0
@aws-sdk/lib-storage 3.327.0
The text was updated successfully, but these errors were encountered: