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

Post-install extraction keeps failing when running npm install #487

Closed
notarock opened this issue Jan 31, 2020 · 7 comments
Closed

Post-install extraction keeps failing when running npm install #487

notarock opened this issue Jan 31, 2020 · 7 comments

Comments

@notarock
Copy link

Post-install extraction keeps failing when running npm install

We have integrated webviewer in our react app, but we keep running into an issue where @pdftron/webviewer-downloader's post-installation script keeps failing randomly.

image

The build scripts fail with the error:

Extracting WebViewer...events.js:187
      throw er; // Unhandled 'error' event
      ^
Error: invalid central directory file header signature: 0x81ff0020
    at /builds/civalgo/portal/node_modules/yauzl/index.js:258:70
    at /builds/civalgo/portal/node_modules/yauzl/index.js:631:5
    at /builds/civalgo/portal/node_modules/fd-slicer/index.js:32:7
    at FSReqCallback.wrapper [as oncomplete] (fs.js:470:5)
Emitted 'error' event on ZipFile instance at:
    at emitError (/builds/civalgo/portal/node_modules/yauzl/index.js:232:8)
    at emitErrorAndAutoClose (/builds/civalgo/portal/node_modules/yauzl/index.js:227:3)
    at /builds/civalgo/portal/node_modules/yauzl/index.js:258:42
    at /builds/civalgo/portal/node_modules/yauzl/index.js:631:5
    at /builds/civalgo/portal/node_modules/fd-slicer/index.js:32:7
    at FSReqCallback.wrapper [as oncomplete] (fs.js:470:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] download-webviewer: `npx @pdftron/webviewer-downloader --path ./public/webviewer`

Our pipeline is simply:

npm i
npx @pdftron/webviewer-downloader --path ./public/webviewer

It also happens once in a while installing locally, with the same error message. Do you have any idea how to fix this? Rerunning failed pipelines is a bit annoying...

@SamuelC54
Copy link

SamuelC54 commented Jan 31, 2020

We have the same issue at our company, it's very annoying!

@ZhijieZhang
Copy link
Contributor

Hi guys,

Thanks for bringing this to our attention! I just tried webviewer-downloader multiple times locally but wasn't able to reproduce the issue. It's kind of unfortunate that the issue seems to be from a library that webviewer-downloader depends on, which means we might not be able to fix this issue.

I found some similar issues in that github repo thejoshwolfe/yauzl#69, thejoshwolfe/yauzl#98 and thejoshwolfe/yauzl#60.

However these issues might be unrelated since I don't think we are using Mac Archive Utility to create the WebViewer.zip. I will take a look at this issue and see if I'm able to figure something out.

In the meanwhile, we will investigate if it's feasible to put WebViewer worker files on npm so that you don't need to use the downloader to download them in your pipeline.

Sorry for the inconvenience!

@notarock
Copy link
Author

notarock commented Feb 4, 2020

For our pipeline, we are using the node official Docker image node:12.14.0. Hope that helps!

@ZhijieZhang
Copy link
Contributor

Hi guys, we made an attempt to fix this issue. Can you try the latest version and see if the issue is fixed? To install the latest @pdftron/webviewer-downloader in your pipeline please make sure that git is installed as well in that environment.

@notarock
Copy link
Author

notarock commented Feb 6, 2020

After a couple of test, it seems to work fine now. Thanks!

@notarock notarock closed this as completed Feb 6, 2020
@igl
Copy link

igl commented Feb 12, 2020

We still face this issue on a regular basis running yarn install in our github action pipeline.

@igl
Copy link

igl commented Feb 12, 2020

I remove node v12 from the pipeline. No issues with v10 so far

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