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

[Bug]: libappindicator3-1 has been renamed on debian #7822

Closed
mmouterde opened this issue Dec 3, 2021 · 9 comments
Closed

[Bug]: libappindicator3-1 has been renamed on debian #7822

mmouterde opened this issue Dec 3, 2021 · 9 comments

Comments

@mmouterde
Copy link

Bug description

Steps to reproduce the problem:

  1. for use in docker from node:lts-bullseye image, I added debian dependencies as mentioned in https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#chrome-headless-doesnt-launch-on-unix
  2. get error libappindicator3-1 has no installation candidate

I suggest to mention libayatana-appindicator3-1 instead

Puppeteer version

latest

Node.js version

latest

npm version

latest

What operating system are you seeing the problem on?

Linux

Relevant log output

No response

@mmouterde mmouterde added the bug label Dec 3, 2021
@runxc1
Copy link

runxc1 commented Dec 13, 2021

Do you have a working DockerFile that works to download Chrome as I'm running into this issue as well

@mmouterde
Copy link
Author

sure :

# https://github.com/puppeteer/puppeteer/blob/edb01972b9606d8b05b979a588eda0d622315981/docs/troubleshooting.md#running-puppeteer-in-docker
FROM node:lts-bullseye

RUN apt-get update \
    && apt-get install -y wget gnupg \
    && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
    && apt-get update \
    && apt-get install -y --no-install-recommends google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei \
                                                  fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
                                                  ca-certificates fonts-liberation libayatana-appindicator3-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 libxshmfence-dev libxcb1 \
                                                  libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 \
                                                  libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /var/lib

RUN npm install -g npm@8
RUN npm --version
RUN cd /var/lib && \
    npm init -y &&  \
    npm i puppeteer@10.4

RUN mkdir /var/lib/app
WORKDIR  /var/lib/app

CMD ["google-chrome-stable"]

@Rongronggg9
Copy link

Rongronggg9 commented Apr 26, 2022

libappindicator is just used to help programs display their icon on the systray. Does headless Chromium really need it?

What's more, libayatana-appindicator3-1 has tons of dependencies!

I've done some tests on node:16-bullseye-slim:

yarn add puppeteer
ldd node_modules/puppeteer/.local-chromium/linux-982053/chrome-linux/chrome | grep not
        libgobject-2.0.so.0 => not found
        libglib-2.0.so.0 => not found
        libnss3.so => not found
        libnssutil3.so => not found
        libsmime3.so => not found
        libnspr4.so => not found
        libatk-1.0.so.0 => not found
        libatk-bridge-2.0.so.0 => not found
        libcups.so.2 => not found
        libgio-2.0.so.0 => not found
        libdrm.so.2 => not found
        libdbus-1.so.3 => not found
        libexpat.so.1 => not found
        libxcb.so.1 => not found
        libxkbcommon.so.0 => not found
        libX11.so.6 => not found
        libXcomposite.so.1 => not found
        libXdamage.so.1 => not found
        libXext.so.6 => not found
        libXfixes.so.3 => not found
        libXrandr.so.2 => not found
        libgbm.so.1 => not found
        libpango-1.0.so.0 => not found
        libcairo.so.2 => not found
        libasound.so.2 => not found
        libatspi.so.0 => not found
apt install libayatana-appindicator3-1 --no-install-recommends
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  adwaita-icon-theme dbus dbus-user-session dconf-gsettings-backend dconf-service dmsetup
  fontconfig fontconfig-config fonts-dejavu-core glib-networking glib-networking-common
  glib-networking-services gsettings-desktop-schemas gtk-update-icon-cache hicolor-icon-theme
  libapparmor1 libargon2-1 libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatspi2.0-0
  libavahi-client3 libavahi-common-data libavahi-common3 libayatana-ido3-0.4-0
  libayatana-indicator3-7 libbrotli1 libbsd0 libcairo-gobject2 libcairo2 libcap2 libcolord2
  libcryptsetup12 libcups2 libdatrie1 libdbus-1-3 libdbusmenu-glib4 libdbusmenu-gtk3-4 libdconf1
  libdeflate0 libdevmapper1.02.1 libepoxy0 libexpat1 libfontconfig1 libfreetype6 libfribidi0
  libgdk-pixbuf-2.0-0 libgdk-pixbuf-xlib-2.0-0 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common
  libglib2.0-0 libgraphite2-3 libgtk-3-0 libgtk-3-common libharfbuzz0b libicu67 libip4tc2 libjbig0
  libjpeg62-turbo libjson-c5 libjson-glib-1.0-0 libjson-glib-1.0-common libkmod2 liblcms2-2 libmd0
  libpam-systemd libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 libpng16-16
  libproxy1v5 libpsl5 librest-0.7-0 libsoup-gnome2.4-1 libsoup2.4-1 libsqlite3-0 libthai-data
  libthai0 libtiff5 libwayland-client0 libwayland-cursor0 libwayland-egl1 libwebp6 libx11-6
  libx11-data libxau6 libxcb-render0 libxcb-shm0 libxcb1 libxcomposite1 libxcursor1 libxdamage1
  libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxkbcommon0 libxml2 libxrandr2 libxrender1
  sensible-utils shared-mime-info systemd systemd-sysv ucf xkb-data
Suggested packages:
  colord cups-common gvfs liblcms2-utils systemd-container policykit-1
Recommended packages:
  librsvg2-common at-spi2-core libgdk-pixbuf2.0-bin libglib2.0-data xdg-user-dirs libgtk-3-bin
  publicsuffix systemd-timesyncd | time-daemon libnss-systemd
The following NEW packages will be installed:
  adwaita-icon-theme dbus dbus-user-session dconf-gsettings-backend dconf-service dmsetup
  fontconfig fontconfig-config fonts-dejavu-core glib-networking glib-networking-common
  glib-networking-services gsettings-desktop-schemas gtk-update-icon-cache hicolor-icon-theme
  libapparmor1 libargon2-1 libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatspi2.0-0
  libavahi-client3 libavahi-common-data libavahi-common3 libayatana-appindicator3-1
  libayatana-ido3-0.4-0 libayatana-indicator3-7 libbrotli1 libbsd0 libcairo-gobject2 libcairo2
  libcap2 libcolord2 libcryptsetup12 libcups2 libdatrie1 libdbus-1-3 libdbusmenu-glib4
  libdbusmenu-gtk3-4 libdconf1 libdeflate0 libdevmapper1.02.1 libepoxy0 libexpat1 libfontconfig1
  libfreetype6 libfribidi0 libgdk-pixbuf-2.0-0 libgdk-pixbuf-xlib-2.0-0 libgdk-pixbuf2.0-0
  libgdk-pixbuf2.0-common libglib2.0-0 libgraphite2-3 libgtk-3-0 libgtk-3-common libharfbuzz0b
  libicu67 libip4tc2 libjbig0 libjpeg62-turbo libjson-c5 libjson-glib-1.0-0
  libjson-glib-1.0-common libkmod2 liblcms2-2 libmd0 libpam-systemd libpango-1.0-0
  libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 libpng16-16 libproxy1v5 libpsl5
  librest-0.7-0 libsoup-gnome2.4-1 libsoup2.4-1 libsqlite3-0 libthai-data libthai0 libtiff5
  libwayland-client0 libwayland-cursor0 libwayland-egl1 libwebp6 libx11-6 libx11-data libxau6
  libxcb-render0 libxcb-shm0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6
  libxfixes3 libxi6 libxinerama1 libxkbcommon0 libxml2 libxrandr2 libxrender1 sensible-utils
  shared-mime-info systemd systemd-sysv ucf xkb-data
0 upgraded, 109 newly installed, 0 to remove and 2 not upgraded.
Need to get 49.9 MB of archives.
After this operation, 176 MB of additional disk space will be used.

@Rongronggg9
Copy link

Rongronggg9 commented Apr 26, 2022

So I figured out some magic to install only those necessary libs:

RUN \
    set -ex && \
    apt-get update && \
    apt install -yq --no-install-recommends \
        apt-file \
    && \
    apt-file update && \
    find /app/node_modules/puppeteer/ -name chrome | tee /tmp/.chromium_path && \
    ldd $(cat /tmp/.chromium_path) | grep -Po "\S+(?= => not found)" | \
    sed 's/\./\\./g' | awk '{print $1"$"}' | apt-file search -xlf - | grep ^lib | \
    xargs -d '\n' -- \
        apt-get install -yq --no-install-recommends \
    && \
    apt purge -yq --auto-remove \
        apt-file \
    && \
    ldd $(cat /tmp/.chromium_path) | grep "not found" | tee /tmp/.unmet_chromium_deps && \
    if [ -s /tmp/.unmet_chromium_deps ]; then \
        echo "!!! Chromium has unmet dependencies !!!" && \
        exit 1 ; \
    fi; \
    rm -rf /tmp/.chromium_path /tmp/.unmet_chromium_deps /var/lib/apt/lists/*

They are (for node:16-bullseye-slim and puppeteer v13.6.0):

libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcups2 libdbus-1-3
libdrm2 libexpat1 libgbm1 libglib2.0-0 libnspr4 libnss3 libpango-1.0-0 libx11-6 libxcb1
libxcomposite1 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2

Still, the doc suggests us to install these non-lib packages:

ca-certificates fonts-liberation lsb-release wget xdg-utils

And If you do need to render pages and screenshot them, fonts are still required (that is, otherwise they are just wasting disk space).

@Rongronggg9
Copy link

Rongronggg9 commented Apr 26, 2022

In fact, neither chromium from Debian nor google-chrome-stable from Google depends or transitively depends on libappindicator or libayatana-appindicator. Just verify that yourself:

apt-rdepends chromium | grep appindicator
apt-rdepends google-chrome-stable | grep appindicator

Meanwhile, I really doubt if lsb-release is still required. The reason is the same.

These are all packages on which chromium/google-chrome-stable depends (transitive dependencies omitted):

chromium
  Depends: chromium-common (= 100.0.4896.127-1~deb11u1)
  Depends: libasound2 (>= 1.0.16)
  Depends: libatk-bridge2.0-0 (>= 2.5.3)
  Depends: libatk1.0-0 (>= 2.2.0)
  Depends: libatomic1 (>= 4.8)
  Depends: libatspi2.0-0 (>= 2.9.90)
  Depends: libc6 (>= 2.30)
  Depends: libcairo2 (>= 1.6.0)
  Depends: libcups2 (>= 1.7.0)
  Depends: libdbus-1-3 (>= 1.9.14)
  Depends: libdrm2 (>= 2.4.38)
  Depends: libevent-2.1-7 (>= 2.1.8-stable)
  Depends: libexpat1 (>= 2.0.1)
  Depends: libflac8 (>= 1.3.0)
  Depends: libfontconfig1 (>= 2.12.6)
  Depends: libfreetype6 (>= 2.10.1)
  Depends: libgbm1 (>= 17.1.0~rc2)
  Depends: libgcc-s1 (>= 4.0)
  Depends: libglib2.0-0 (>= 2.39.4)
  Depends: libgtk-3-0
  Depends: libjpeg62-turbo (>= 1:1.5.0)
  Depends: libjsoncpp24 (>= 1.9.4)
  Depends: liblcms2-2 (>= 2.2+git20110628)
  Depends: libminizip1 (>= 1.1)
  Depends: libnspr4 (>= 2:4.9-2~)
  Depends: libnss3 (>= 2:3.22)
  Depends: libopenjp2-7 (>= 2.2.0)
  Depends: libopus0 (>= 1.1)
  Depends: libpango-1.0-0 (>= 1.14.0)
  Depends: libpng16-16 (>= 1.6.2-1)
  Depends: libpulse0 (>= 0.99.1)
  Depends: libre2-9 (>= 20201101+dfsg)
  Depends: libsnappy1v5 (>= 1.1.8)
  Depends: libstdc++6 (>= 9)
  Depends: libwebp6 (>= 0.5.1)
  Depends: libwebpdemux2 (>= 0.5.1)
  Depends: libwebpmux3 (>= 0.6.1-2.1)
  Depends: libx11-6 (>= 2:1.4.99.1)
  Depends: libxcb1 (>= 1.9.2)
  Depends: libxcomposite1 (>= 1:0.4.5)
  Depends: libxdamage1 (>= 1:1.1)
  Depends: libxext6
  Depends: libxfixes3
  Depends: libxkbcommon0 (>= 1.0.0)
  Depends: libxml2 (>= 2.7.4)
  Depends: libxrandr2
  Depends: libxslt1.1 (>= 1.1.25)
  Depends: xdg-desktop-portal-backend
  Depends: zlib1g (>= 1:1.2.2)
chromium-common
  Depends: libc6 (>= 2.30)
  Depends: libstdc++6 (>= 9)
  Depends: libx11-6 (>= 2:1.4.99.1)
  Depends: libxext6
  Depends: x11-utils
  Depends: xdg-utils
  Depends: zlib1g (>= 1:1.2.2)
google-chrome-stable
  Depends: ca-certificates
  Depends: fonts-liberation
  Depends: libasound2 (>= 1.0.16)
  Depends: libatk-bridge2.0-0 (>= 2.5.3)
  Depends: libatk1.0-0 (>= 2.2.0)
  Depends: libatspi2.0-0 (>= 2.9.90)
  Depends: libc6 (>= 2.17)
  Depends: libcairo2 (>= 1.6.0)
  Depends: libcups2 (>= 1.6.0)
  Depends: libcurl3
  Depends: libcurl3-gnutls
  Depends: libcurl3-nss
  Depends: libcurl4
  Depends: libdbus-1-3 (>= 1.5.12)
  Depends: libdrm2 (>= 2.4.38)
  Depends: libexpat1 (>= 2.0.1)
  Depends: libgbm1 (>= 8.1~0)
  Depends: libgcc1 (>= 1:3.0)
  Depends: libglib2.0-0 (>= 2.39.4)
  Depends: libgtk-3-0 (>= 3.9.10)
  Depends: libgtk-4-1
  Depends: libnspr4 (>= 2:4.9-2~)
  Depends: libnss3 (>= 2:3.26)
  Depends: libpango-1.0-0 (>= 1.14.0)
  Depends: libx11-6 (>= 2:1.4.99.1)
  Depends: libxcb1 (>= 1.9.2)
  Depends: libxcomposite1 (>= 1:0.4.4-1)
  Depends: libxdamage1 (>= 1:1.1)
  Depends: libxext6
  Depends: libxfixes3
  Depends: libxkbcommon0 (>= 0.4.1)
  Depends: libxrandr2
  Depends: wget
  Depends: xdg-utils (>= 1.0.2)
  PreDepends: dpkg (>= 1.14.0)

@Rongronggg9
Copy link

Rongronggg9 commented Apr 26, 2022

sure :

# https://github.com/puppeteer/puppeteer/blob/edb01972b9606d8b05b979a588eda0d622315981/docs/troubleshooting.md#running-puppeteer-in-docker
FROM node:lts-bullseye

RUN apt-get update \
    && apt-get install -y wget gnupg \
    && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
    && apt-get update \
    && apt-get install -y --no-install-recommends google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei \
                                                  fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
                                                  ca-certificates fonts-liberation libayatana-appindicator3-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 libxshmfence-dev libxcb1 \
                                                  libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 \
                                                  libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /var/lib

RUN npm install -g npm@8
RUN npm --version
RUN cd /var/lib && \
    npm init -y &&  \
    npm i puppeteer@10.4

RUN mkdir /var/lib/app
WORKDIR  /var/lib/app

CMD ["google-chrome-stable"]

@mmouterde And just an off-topic reminder:
You don't need to install those packages listed in https://github.com/puppeteer/puppeteer/blob/1308d9aa6a5920b20da02dca8db03c63e43c8b84/docs/troubleshooting.md#chrome-headless-doesnt-launch-on-unix as long as you install google-chrome-stable. APT will get all dependencies installed.
If you merely use the bundled Chromium from puppeteer, no need to keep google-chrome-stable in your image. Just do apt-get purge -y google-chrome-stable immediately after installing it (note: without --auto-remove).
But installing so many dependencies is so unnecessary since some of them are of no use in a headless environment.

I am not really sure why the doc has such a weird example executing CMD ["google-chrome-stable"] while puppeteer will always use its own bundled Chromium unless explicitly configured.

I've verified that with only these packages installed, puppeteer, along with its bundled Chromium, still works perfectly in the case it is just used to grab rendered HTML:

ca-certificates fonts-liberation wget xdg-utils
libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcups2 libdbus-1-3
libdrm2 libexpat1 libgbm1 libglib2.0-0 libnspr4 libnss3 libpango-1.0-0 libx11-6 libxcb1
libxcomposite1 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2

Last but not least, you should not install puppeteer using npm i puppeteer@xx.yy if your dependencies are from google-chrome-stable. The latter is always the latest stable version but the former is pinned on vxx.yy. The bundled Chromium may have different dependencies from google-chrome-stable if the puppeteer version you pinned is too outdated.

@stale
Copy link

stale bot commented Jun 28, 2022

We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.

@stale stale bot added the unconfirmed label Jun 28, 2022
@frank-dspeed
Copy link

This should get labeled docs as this is docs related not a real bug

@stale
Copy link

stale bot commented Aug 2, 2022

We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!

@stale stale bot closed this as completed Aug 2, 2022
@OrKoN OrKoN reopened this Aug 2, 2022
@OrKoN OrKoN added feature and removed feature labels Sep 6, 2022
OrKoN added a commit that referenced this issue Dec 9, 2022
OrKoN added a commit that referenced this issue Dec 9, 2022
OrKoN added a commit that referenced this issue Dec 9, 2022
@OrKoN OrKoN closed this as completed Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants