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

Unhandled rejection Error: invalid signature: 0x21726152 #265

Closed
Joshuajrodrigues opened this issue Jan 28, 2023 · 6 comments
Closed

Unhandled rejection Error: invalid signature: 0x21726152 #265

Joshuajrodrigues opened this issue Jan 28, 2023 · 6 comments

Comments

@Joshuajrodrigues
Copy link

I have a zip file which gives this issue,thing is it opens just fine in 7 zip

@Joshuajrodrigues
Copy link
Author

Joshuajrodrigues commented Jan 28, 2023

I belive its because its a 7 zip file
https://stackoverflow.com/questions/4334199/unzipping-a-file-error

Any solution for this ?

@Joshuajrodrigues
Copy link
Author

glebdmitriew#1 (comment) I found another similar issue with a possible explanation. The zip file Im using was infact previously in another zip containing it

@lucasrmendonca
Copy link

Had the same issue, what worked for me was switching my code over to use one of the Open methods instead

@drekka
Copy link

drekka commented May 15, 2024

I'm just trying unzipped out and getting this error. My zips come from Macs and contain around 20 files and are about 20Mb in size. Tried two different zips with the same results using:

        const zip = fs.createReadStream(downloadedFilePath).pipe(unzipper.Parse({forceStream: true}));
        for await (const entry of zip) {
          const fileName = entry.path;
          console.debug(`File: ${fileName}`)
        }

Stack is:

/Users/clarkson/projects/mobile-automobile/functions/node_modules/unzipper/lib/parse.js:67
>        self.emit('error', new Error('invalid signature: 0x' + signature.toString(16)));
>                           ^
>  
>  Error: invalid signature: 0x4f44213c
>      at /Users/clarkson/projects/mobile-automobile/functions/node_modules/unzipper/lib/parse.js:67:26
>      at tryCatcher (/Users/clarkson/projects/mobile-automobile/functions/node_modules/unzipper/node_modules/bluebird/js/release/util.js:16:23)
>      at Promise._settlePromiseFromHandler (/Users/clarkson/projects/mobile-automobile/functions/node_modules/unzipper/node_modules/bluebird/js/release/promise.js:510:31)
>      at Promise._settlePromise (/Users/clarkson/projects/mobile-automobile/functions/node_modules/unzipper/node_modules/bluebird/js/release/promise.js:567:18)
>      at Promise._settlePromise0 (/Users/clarkson/projects/mobile-automobile/functions/node_modules/unzipper/node_modules/bluebird/js/release/promise.js:612:10)
>      at Promise._settlePromises (/Users/clarkson/projects/mobile-automobile/functions/node_modules/unzipper/node_modules/bluebird/js/release/promise.js:691:18)
>      at Async._drainQueue (/Users/clarkson/projects/mobile-automobile/functions/node_modules/unzipper/node_modules/bluebird/js/release/async.js:133:16)
>      at Async._drainQueues (/Users/clarkson/projects/mobile-automobile/functions/node_modules/unzipper/node_modules/bluebird/js/release/async.js:143:10)
>      at Async.drainQueues (/Users/clarkson/projects/mobile-automobile/functions/node_modules/unzipper/node_modules/bluebird/js/release/async.js:17:14)
>      at process.processImmediate (node:internal/timers:478:21)

@drekka
Copy link

drekka commented May 15, 2024

Now tried using Open like this

let zip = await unzipper.Open.file(downloadedFilePath)
zip.files.forEach( (file) => {
    console.debug(`[events_pubsub.ts] handleUploadScreenshotsEvent: Validating screenshot file ${file.path}`)
})

And it gives me a whole different error:

>  node:internal/process/promises:289
>              triggerUncaughtException(err, true /* fromPromise */);
>              ^
>  
>  Error: FILE_ENDED
>      at PullStream.pull (/Users/clarkson/projects/mobile-automobile/functions/node_modules/unzipper/lib/PullStream.js:78:28)
>      at PullStream.emit (node:events:518:28)
>      at PullStream.<anonymous> (/Users/clarkson/projects/mobile-automobile/functions/node_modules/unzipper/lib/PullStream.js:15:10)
>      at PullStream.emit (node:events:530:35)
>      at finish (node:internal/streams/writable:945:10)
>      at node:internal/streams/writable:926:13
>      at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

@ZJONSSON
Copy link
Owner

ZJONSSON commented Jun 8, 2024

Unzipper does not handle 7zip files, unless someone is willing to do the work and submit a PR.

@ZJONSSON ZJONSSON closed this as completed Jun 8, 2024
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

No branches or pull requests

4 participants