Fresh install of chromium-browser during installer-like process, in a chroot fails (when preparing machines prior to first boot)

Bug #1882232 reported by eoli3n on 2020-06-05
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Medium
Olivier Tilloy
Focal
Medium
Olivier Tilloy

Bug Description

[Impact]

Users trying to install chromium-browser with apt in a chroot will see the preinst script hang for 30min, and eventually fail.
This use case is important as chroots are used by sysadmins to prepare installers.

[Test Case]

Create a focal chroot (for example using "pcreate -a amd64 -d focal focal-amd64"), enter the chroot and run "apt install chromium-browser".
Expected outcome: the installation succeeds, even though the chromium snap is not being installed because snapd cannot run in the chroot.
Incorrect (current) outcome: the installation hangs during 30 minutes while trying to contact the snap store, and eventually fails.

[Regression Potential]

As this change modifies the chromium-browser preinstallation script, it should be verified that installing the package on systems that are capable of running snapd (e.g. virtual machines or bare metal) still works as expected.

[Original Description]

Since snapd integration, chromium-browser package fails to install in a post kickstart chroot.
As APT obfuscate snap installation, I worry about auto installation off any other snap package.

When a user is running the installer, and instructs to install chromium-browser with apt in the /target chroot the experience is extremely bad.

There are timeouts, there is critical debconf prompt, and no explanation as to what is happening.

This is not an upgrade, and no conversion from deb2snap is needed.

It is in a chroot, because this is how installers work.

It feels like as if on fresh install of chromium-browser it should try "snap install --now-or-schedule-for-later chromium-browser" such that if snapd is running and available install it now, otherwise record a task for snapd to execute if and when it comes up (on first boot). Or like for example, it should call snap prepare-image --classic instead.

Overall, imho on new installations of the package, if there is no snapd running, it should be skipped without asking any questions or popping up any dialogues.

eoli3n (eoli3neoli3n) wrote :
Dimitri John Ledkov (xnox) wrote :

That's a debconf note. How did you invoke installation?

All package installation is interactive. If you want non-interactive package installation one has to pass options to apt to "do not disturb me" and accept defaults to any questions around installation or upgrades.

DEBIAN_FRONTEND=noninteractive chroot $MY_CHROOT apt-get -y install $packages

is the better way to install packages non-interactively. Does doing something like that sufficient to complete chromium-browser package installation?

Changed in chromium-browser (Ubuntu):
status: New → Incomplete
eoli3n (eoli3neoli3n) wrote :

I did install with "apt install chromium-browser -y" for the demonstration.
In my specific case, i use ansible so it is non interactive.

That task fails.

- name: install browsers
  apt:
    state: latest
    name:
      - firefox
      - firefox-locale-fr
      - chromium-browser
      - chromium-browser-l10n
      - adobe-flashplugin

eoli3n (eoli3neoli3n) wrote :

To reproduce

apt install ansible -y
ansible localhost -m apt -a "name=chromium-browser"

You can try it in a container. That's not exactly a chroot but...

docker run --rm -it ubuntu:latest /bin/bash
apt update && apt install ansible -y
ansible localhost -m apt -a "name=chromium-browser"

Dimitri John Ledkov (xnox) wrote :

"-y" is not enough to install non-interactive under ansible.

Either specify debconf non-interactive frontened, or ask ansible to preseed the debconf answer that you acknowledge the debconf note that the package will provide.

eoli3n (eoli3neoli3n) wrote :
Download full text (4.0 KiB)

Ansible use his own module to wrap apt command, and it uses non-interactive way, not just "-y".

Anyway i confirm that this fails under a chroot :

$ DEBIAN_FRONTEND=noninteractive chroot /target apt-get -y install chromium-browser
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  liblzo2-2 snapd squashfs-tools
Suggested packages:
  zenity | kdialog
The following NEW packages will be installed:
  chromium-browser liblzo2-2 snapd squashfs-tools
Preconfiguring packages ...
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/23.4 MB of archives.
After this operation, 105 MB of additional disk space will be used.
Selecting previously unselected package liblzo2-2:amd64.
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 72913 files and directories currently installed.)
Preparing to unpack .../liblzo2-2_2.10-2_amd64.deb ...
Unpacking liblzo2-2:amd64 (2.10-2) ...
Selecting previously unselected package squashfs-tools.
Preparing to unpack .../squashfs-tools_1%3a4.4-1_amd64.deb ...
Unpacking squashfs-tools (1:4.4-1) ...
Selecting previously unselected package snapd.
Preparing to unpack .../snapd_2.44.3+20.04_amd64.deb ...
Unpacking snapd (2.44.3+20.04) ...
Setting up liblzo2-2:amd64 (2.10-2) ...
Setting up squashfs-tools (1:4.4-1) ...
Setting up snapd (2.44.3+20.04) ...
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.apparmor.service → /lib/systemd/system/snapd.apparmor.service.
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.autoimport.service → /lib/systemd/system/snapd.autoimport.service.
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.core-fixup.service → /lib/systemd/system/snapd.core-fixup.service.
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.recovery-chooser-trigger.service → /lib/systemd/system/snapd.recovery-chooser-trigger.service.
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.seeded.service → /lib/systemd/system/snapd.seeded.service.
Created symlink /etc/systemd/system/cloud-final.service.wants/snapd.seeded.service → /lib/systemd/system/snapd.seeded.service.
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.service → /lib/systemd/system/snapd.service.
Created symlink /etc/systemd/system/timers.target.wants/snapd.snap-repair.timer → /lib/systemd/system/snapd.snap-repair.timer.
Created symlink /etc/systemd/system/sockets.target.wants/snapd.socket → /lib/systemd/system/snapd.socket.
Created symlink /etc/systemd/system/final.target.wants/snapd.system-shutdown.service → /lib/systemd/system/snapd.system-shutdown.service.
...

Read more...

Dimitri John Ledkov (xnox) wrote :

My debconf prompt is different and has options to retry abort skip, or press ok.

My screen is larger, is there a scrollbar that is not visible? can you scroll down to skip and press skip?

Alternatively, can you use debconf pressed to pressed the answer to the quesiton as Skip:

chromium-browser chromium-browser/snap-no-connectivity select Skip

summary: - install chromium-browser in a chroot fails
+ Fresh install of chromium-browser during installer-like process, in a
+ chroot fails (when preparing machines prior to first boot)
Dimitri John Ledkov (xnox) wrote :

We had a lot of conversations on IRC about this.

tl;dr overall, the UX is bad and confusing and must be improved.

description: updated
Changed in chromium-browser (Ubuntu):
status: Incomplete → Confirmed
tags: added: rls-gg-incoming
Dimitri John Ledkov (xnox) wrote :

In lxd deb2snap we have this:

        # Check store connectivity
        echo "==> Checking connectivity with the snap store"
        COUNT=0
        SKIP=false
        while :; do
            if skip_unusable_snapd; then
                echo "===> System doesn't have a working snapd and LXD was never used, skipping"
                SKIP=true
                break
            fi

similar does not exist in chromium-browser, but must.

Olivier Tilloy (osomon) wrote :

That code is pretty new in the lxd deb2snap, it was added with https://github.com/lxc/lxd-pkg-ubuntu/pull/42. I'll test and replicate in the chromium deb2snap.

Changed in chromium-browser (Ubuntu):
importance: Undecided → Medium
assignee: nobody → Olivier Tilloy (osomon)
Olivier Tilloy (osomon) wrote :
Changed in chromium-browser (Ubuntu):
status: Confirmed → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package chromium-browser - 83.0.4103.97-0ubuntu1

---------------
chromium-browser (83.0.4103.97-0ubuntu1) groovy; urgency=medium

  * New upstream release: 83.0.4103.97
  * Do not attempt to install the snap on systems where snapd isn't running
    (including chroots and WSL) (LP: #1882232)

 -- Olivier Tilloy <email address hidden> Mon, 08 Jun 2020 17:49:24 +0200

Changed in chromium-browser (Ubuntu):
status: Fix Committed → Fix Released
Olivier Tilloy (osomon) on 2020-06-08
Changed in chromium-browser (Ubuntu Focal):
assignee: nobody → Olivier Tilloy (osomon)
importance: Undecided → Medium
status: New → In Progress
Olivier Tilloy (osomon) on 2020-06-08
description: updated

Hello Jo, or anyone else affected,

Accepted chromium-browser into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/chromium-browser/83.0.4103.97-0ubuntu0.20.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in chromium-browser (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
eoli3n (eoli3neoli3n) wrote :

Just tried with -proposed repo, installation of chromium-browser package doesn't hang in a chroot anymore.
After first reboot the package is installed in version: 83.0.4103.97-0ubuntu0.20.04.1

Please change tag from verification-needed-focal to verification-done-focal.

eoli3n (eoli3neoli3n) wrote :

Oups

```
Command '/usr/bin/chromium-browser' requires the chromium snap to be installed.
Please install it with:

snap install chromium
```

when should it trigger snap installation ?

Olivier Tilloy (osomon) wrote :

If the snap installation failed at deb installation/upgrade, it is left as an exercise to the user to manually install (as suggested by the help text displayed by /usr/bin/chromium-browser). So this is the intended behaviour.

Olivier Tilloy (osomon) wrote :

I enabled focal-proposed for universe in a fully up-to-date focal chroot, and verified that issuing "apt install chromium-browser" installed version 83.0.4103.97-0ubuntu0.20.04.1, and that the installation completed in a reasonable amount of time. Relevant excerpt of the output:

Preparing to unpack .../chromium-browser_83.0.4103.97-0ubuntu0.20.04.1_amd64.deb ...
=> Installing the chromium snap
==> Checking connectivity with the snap store
===> System doesn't have a working snapd, skipping
Unpacking chromium-browser (83.0.4103.97-0ubuntu0.20.04.1) ...
Setting up chromium-browser (83.0.4103.97-0ubuntu0.20.04.1) ...

tags: added: verification-done-focal
removed: verification-needed-focal
tags: removed: rls-gg-incoming
Brian Murray (brian-murray) wrote :

Please also verify "that installing the package on systems that are capable of running snapd (e.g. virtual machines or bare metal) still works as expected" per the Regression Potential section of the bug description.

Changed in chromium-browser (Ubuntu Focal):
status: Fix Committed → Incomplete
tags: added: verification-needed-focal
removed: verification-done-focal
Olivier Tilloy (osomon) wrote :

Right, my testing was incomplete indeed.
I enabled focal-proposed for universe in a fully up-to-date focal VM (amd64), and verified that issuing "apt install chromium-browser" installed version 83.0.4103.97-0ubuntu0.20.04.1, and that the installation completed successfully and installed the chromium snap indeed. For good measure I verified that running "chromium-browser" did launch the snap.

tags: added: verification-done-focal
removed: verification-needed-focal
Changed in chromium-browser (Ubuntu Focal):
status: Incomplete → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package chromium-browser - 83.0.4103.97-0ubuntu0.20.04.1

---------------
chromium-browser (83.0.4103.97-0ubuntu0.20.04.1) focal; urgency=medium

  * New upstream release: 83.0.4103.97
  * Do not attempt to install the snap on systems where snapd isn't running
    (including chroots and WSL) (LP: #1882232)

 -- Olivier Tilloy <email address hidden> Mon, 08 Jun 2020 22:48:58 +0200

Changed in chromium-browser (Ubuntu Focal):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for chromium-browser has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers