You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Without changing my codebase, this utility suddenly stopped working this week. All zip files are now 0 bytes (invalid). I've been banging my head against the wall for at least 20 hours now, so any help in advance is very appreciated.
Environment
Node 20.13.1
Streaming files into it using the AWS S3 SDK (v3)
Code
constarchiver=require('archiver')const{
S3Client,
GetObjectCommand
}=require('@aws-sdk/client-s3')constconfig=require('config')constclient=newS3Client({region: 'us-east-2'})module.exports=asyncfunctioncreateArchiveFromS3(filePaths){constzipArchive=archiver('zip')console.log(`number of files: ${filePaths.length}`)zipArchive.on('progress',function(args){console.log('//////progress')console.log(args)})zipArchive.on('finish',function(args){console.log('-------finished')})// wait for all stream request from s3 to be doneconststreamsPromises=filePaths.map(myFilePath=>streamFileFromS3(myFilePath))consts3Streams=awaitPromise.all(streamsPromises)s3Streams.map((myS3Stream,index)=>{zipArchive.append(myS3Stream,{name: filePaths[index]})})console.log('finalizing...')zipArchive.finalize()returnzipArchive}asyncfunctionstreamFileFromS3(s3Key){constcommand=newGetObjectCommand({Bucket: config.s3Bucket,Key: s3Key,})constresponse=awaitclient.send(command)console.log('got one file from s3')returnresponse.Body}
Oh wow, this problem existed earlier I just didn't have any users report it earlier. Looks like a few weeks ago I introduced a package that imported buffer, which my best guess is causing problems. Hopefully this helps someone in the future 🤞
Without changing my codebase, this utility suddenly stopped working this week. All zip files are now 0 bytes (invalid). I've been banging my head against the wall for at least 20 hours now, so any help in advance is very appreciated.
Environment
Code
Output
This is what the "entry" event gives me, so you can see it's receiving a stream for each file.
I then pipe this through to ExpressJS. The alarming thing to me is the "progress" report. Any ideas what's going on?
The text was updated successfully, but these errors were encountered: