question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using headless Chrome Puppeteer with meteor and mup (Error)

See original GitHub issue

Mup version (mup --version): 1.4.5

So I am running into an error with my deployed Meteor app:

/built_app/programs/server/npm/node_modules/puppeteer/.local-chromium/linux-571375/chrome-linux/chrome: error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory

I am 90% sure, that this is just due to some missing libs inside the abernix/meteord:node-8-base docker container? Any ideas on this?

Do I have to make my own docker container with some more libs installed? (see here: https://github.com/GoogleChrome/puppeteer/issues/404 - apt-get install libpangocairo-1.0-0 libx11-xcb1 libxcomposite1 libxcursor1 libxdamage1 libxi6 libxtst6 libnss3 libcups2 libxss1 libxrandr2 libgconf2-4 libasound2 libatk1.0-0 libgtk-3-0).

Or is there some way around this?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
johannel00commented, Jan 16, 2020

Thanks @nabiltntn for the feedback. I was able to get it working by cloning the https://github.com/abernix/meteord repo and made changes to the ‘base’ Dockerfile and built it. I can confirm that it works with my Meteor 1.9 project.

I modified the Dockerfile to this:

FROM debian:stretch
MAINTAINER Jesse Rosenberger

ENV METEORD_DIR /opt/meteord
COPY scripts $METEORD_DIR

ARG NODE_VERSION
ENV NODE_VERSION ${NODE_VERSION:-12.14.0}
ONBUILD ENV NODE_VERSION ${NODE_VERSION:-12.14.0}

RUN bash $METEORD_DIR/lib/install_base.sh
RUN bash $METEORD_DIR/lib/install_node.sh
RUN bash $METEORD_DIR/lib/install_phantomjs.sh
RUN bash $METEORD_DIR/lib/cleanup.sh

EXPOSE 80/tcp
RUN chmod +x $METEORD_DIR/run_app.sh
ENTRYPOINT exec $METEORD_DIR/run_app.sh

ENV NODE_VERSION=12.14.0

RUN apt-get update \
    && apt-get install -y \
    libpangocairo-1.0-0 \
    libx11-xcb1 \
    libxcomposite1 \
    libxcursor1 \
    libxdamage1 \
    libxi6 \
    libxtst6 \
    libnss3 \
    libcups2 \
    libxss1 \
    libxrandr2 \
    libgconf2-4 \
    libasound2 \
    libatk1.0-0 \
    libgtk-3-0 \
    wget \
    --no-install-recommends \
    && rm -rf /var/lib/apt/lists/* \
    && rm -rf /src/*.deb
    
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64

RUN chmod +x /usr/local/bin/dumb-init

ENTRYPOINT /usr/local/bin/dumb-init -- $METEORD_DIR/run_app.sh
1reaction
johannel00commented, Jan 16, 2020

Awesome work @johannel00. Can you make this available on DockerHub?

It’s available here. Let me know if it works for you. https://hub.docker.com/repository/docker/fedescoinc/meteord-node-with-chromium_dumb-init/tags

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using headless-chrome / Chromeless with Meteor for PDF ...
I'm working on a project that requires PDF generation, and in terms of getting a sharp look, nothing does it better than Chrome....
Read more >
Meteor Legacy bundle served when using Headless Chrome ...
I am using Meteor 1.10.2 on Debian 10 Buster. When loading the site in Headless Chrome (using puppeteer ), the web.legacy bundle is...
Read more >
Error while launching headless browser using puppeteer.
Error while launching headless browser using puppeteer. ... { const browser = await puppeteer.launch({ executablePath:'/usr/bin/chromium-browser'}); ...
Read more >
[Solved]-Chrome browser crashed on running multiple chrome ...
Coding example for the question Chrome browser crashed on running multiple chrome browsers in a chrome node Docker container-docker.
Read more >
mn 0 01 05_1 1 10 100 10th 11 11_d0003 12 13 14 141a
... chromatophorous chrome chromic chromide chrominance chromite chromium ... erringly errol erroneous erroneously erroneousness error errorless errors errs ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found