elegantapp / pwa-asset-generator

Automates PWA asset generation and image declaration. Automatically generates icon and splash screen images, favicons and mstile images. Updates manifest.json and index.html files with the generated images according to Web App Manifest specs and Apple Human Interface guidelines.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cli Error: Failed to launch the browser process! (libxshmfence.so.1: cannot open shared object file: No such file or directory)

xstable opened this issue · comments

Describe the bug
Since last update, I got the error described below.
As I got this error at a new Project, I also try to only re-run an deployment-script, which works perfectly fine 3 Day's ago.
So I'm sure the issue depends on something that was changed in the last release.

As there seems only this line to be changed: bc655fd, the question is, how can I archive the opposite of this command with a cli-parameter for npx-command?!

To Reproduce
Steps to reproduce the behavior:

  1. Execute cli command
    npx pwa-asset-generator -n ./public/assets/images/logo.svg ./public/assets/appIcons/ --path-override /assets/appIcons -m ./public/manifest.json -i ./public/assets/appIcons/index.html --padding "10px"
  2. Result ins:
1:39:25 PM installer Chromium is not found in module folder, gonna have to download r848005 for you once 🤔
1:39:32 PM installer Chromium downloaded to /builds/onepager1/xxx.de/yarn_cache/node_modules/puppeteer-core/.local-chromium/linux-848005
1:39:34 PM cli Error: Failed to launch the browser process!
/builds/onepager1/xxx.de/yarn_cache/node_modules/puppeteer-core/.local-chromium/linux-848005/chrome-linux/chrome: error while loading shared libraries: libxshmfence.so.1: cannot open shared object file: No such file or directory

System (please complete the following information):

  • OS: Linux Debian 10.0 (BUSTER) [docker-image: node:latest]

Additional context
I've run the deployment-script on gitlab 3 Day's ago, and everything worked like expected.
Today, I re-run the same deployment to check the npx-command again with a as working known version, and its broken with the above error-message.

If I do run the npx command with forcing 4.1.1, it works again:

npx pwa-asset-generator@4.1.1 -n ./public/assets/images/logo.svg ./public/assets/appIcons/ --path-override /assets/appIcons -m ./public/manifest.json -i ./public/assets/appIcons/index.html --padding "10px"

🎉 This issue has been resolved in version 4.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Hi @xstable, thanks for your attention and swift feedback. I've just published a fix for this issue reverting the latest arg change. In addition, I covered the npx usage with a test on the CI - #632.

Hopefully, any regression related to npx usage of the library will be automatically detected next time.

Unfortunately it seems not to work.
Maybe there are also changed other things, you don't noticed in the changelog?!?

4.2.1 stuck with the same error-message. 4.1.1 still work like expected.

This is strange. There was no other change in the code and no package change which might directly impact. Now I wonder if it was a real issue in the first place.

I added a new test to validate the npx usage with end to end usage of the library, and it seems to work just fine on ubuntu with the latest release, you can see it on https://github.com/onderceylan/pwa-asset-generator/pull/632/checks?check_run_id=3057818690.

I even tried to pin it to 4.2.1, same result:
image

and pinned to 4.1.1 it works again, like expected
image

I do use a docker-image with debian 10 (Buster)

Hi @xstable, thanks for helping diagnose the issue. I've tried to reproduce the issue you're facing, by overriding my action setup with debian:buster distribution - https://github.com/onderceylan/pwa-asset-generator/actions/runs/1027890795. During my tests, I've faced a failure due to another library being missing on debian.

After inspecting the logs you shared, I've found out the root cause of the issue you are facing.

Because Puppeteer / Chromium is at the core of this library, we have to keep those dependencies up to date and secure. And, Chromium will require further dependencies from the execution environment. So, you need to find a permanent solution to your issue to make your system future proof.

You have a few options to tackle this issue;

  • Create a docker image with installing all the dependencies mentioned on the troubleshooting page of Puppeteer (recommended)
  • Use another linux distribution / remove debian:buster from container config and just use ubuntu-latest (recommended)
  • Stick to v4.1.1 of pwa-asset-generator (not recommended / might be temporary)

I hope I was able to clarify both the problem and the solution for you. Cheers!

I'll give it a try. But anyway, I think it's important for you to notice this somewhere in your documentations, so that other people know this "known Issues" and can handle them.
I'll come back to report, how I solved it, so you could add this to your docs if you want.

Ok, with this apt-packages on Debian Buster it works again:

apt-get install -yq ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils libdrm2 libgbm-dev libxshmfence-dev --no-install-recommends

I've updated tho pagckages like described in the pupeteer-page, but also added libxshmfence-dev, which seems to be the important part to do the trick.

Great, thanks for sharing your update. I will update the docs accordingly.