[snap] chromium headless crashes at startup on non-desktop system

Bug #1908284 reported by T.J. Cravey
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

I'm running Ubuntu 20.04 and it looks like the current stable version of the Chromium snap has an issue running headless:

```
tjcravey@chromium:~$ chromium --headless --remote-debugging-port=9222 https://chromium.org
[0100/000000.240635:ERROR:zygote_linux.cc(607)] Zygote could not fork: process_type gpu-process numfds 3 child_pid -1
[0100/000000.240882:ERROR:zygote_linux.cc(639)] write: Broken pipe (32)
Trace/breakpoint trap (core dumped)
```

```
tjcravey@chromium:~$ snap info chromium
name: chromium
summary: Chromium web browser, open-source version of Chrome
publisher: Canonical✓
store-url: https://snapcraft.io/chromium
contact: https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bugs?field.tag=snap
license: unset
description: |
  An open-source browser project that aims to build a safer, faster, and more stable way for all
  Internet users to experience the web.
commands:
  - chromium.chromedriver
  - chromium
snap-id: XKEcBqPM06H1Z7zGOdG5fbICuf8NWK5R
tracking: latest/stable
refresh-date: today at 15:33 UTC
channels:
  latest/stable: 87.0.4280.88 2020-12-10 (1424) 124MB -
  latest/candidate: 87.0.4280.88 2020-12-10 (1424) 124MB -
  latest/beta: 88.0.4324.41 2020-12-15 (1441) 144MB -
  latest/edge: 89.0.4350.4 2020-12-11 (1434) 257MB -
installed: 87.0.4280.88 (1424) 124MB -
```

I was able to revert back to snap 1421 on a different system and that command works fine there.

Tags: snap
Revision history for this message
Olivier Tilloy (osomon) wrote :

So if I understand correctly, revision 1421 works on one system, and revision 1424 doesn't work on a different system. It would be useful to test either 1424 on the first system, or 1421 or the other system, to confirm the regression, and rule out a system-specific issue.

Changed in chromium-browser (Ubuntu):
status: New → Incomplete
summary: - chromium headless crashes in snap 1424
+ [snap] chromium headless crashes in revision 1424
tags: added: snap
Revision history for this message
Olivier Tilloy (osomon) wrote : Re: [snap] chromium headless crashes in revision 1424

Just tested with revision 1424 in a clean and up-to-date focal amd64 VM, and headless chromium works, I can inspect the page being loaded using devtools in a separate chromium instance.

Revision history for this message
T.J. Cravey (tj-2) wrote :

I set up a new VM running Ubuntu 20.04 just to rule out any issue with my original system. On my original system, when the chromium snap was updated to 1424 headless chromium started crashing. On that same system, I reverted back to 1421 and things are working again.

So, 1424 doesn't work on either my original system, or the new VPS I set up. 1421 works on my original system, but I can't roll back to 1421 on the new VM.

Revision history for this message
T.J. Cravey (tj-2) wrote :

I should have specified that I'm experiencing the error on Ubuntu Server. I just tested on my laptop running Ubuntu Desktop and it works fine.

I also found that on my headless Ubuntu Servers if you install the ubuntu-desktop metapackage before you install the chromium snap, everything will work fine then too. However, if you install the chromium snap before you install the ubuntu-desktop metapackage it will still be broken even after the ubuntu-desktop metapackage is done installing.

I'd still reckon that this is a regression though, because chromium snap revision 1421 was working fine in headless mode on a standard install of Ubuntu Server without the need to install any other packages first.

T.J. Cravey (tj-2)
Changed in chromium-browser (Ubuntu):
status: Incomplete → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in chromium-browser (Ubuntu):
status: New → Confirmed
Olivier Tilloy (osomon)
summary: - [snap] chromium headless crashes in revision 1424
+ [snap] chromium headless crashes at startup on non-desktop system
Changed in chromium-browser (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Olivier Tilloy (osomon) wrote :

I can reliably observe the problem on a system without a desktop environment, and I can confirm that installing ubuntu-desktop-minimal and then reinstalling the snap makes the problem go away.

This is a regression that appeared when switching to using the gnome-3-28 extension.

After removing again ubuntu-desktop-minimal and all its dependencies, and reinstalling the snap, the snap still works, so the root of the problem is not really a missing dependency, but more likely user files/folders created when installing those packages or when installing the snap (configure hook maybe).

Revision history for this message
Olivier Tilloy (osomon) wrote :

A more minimal workaround is to "apt install fonts-dejavu-core" before installing the chromium snap (verified working on a headless system). This ensures that there is at least one font when the configure hook pre-generates a font cache.

Revision history for this message
Greg (gdrapp) wrote :

I can confirm this workaround works. Thanks.

Olivier Tilloy (osomon)
Changed in chromium-browser (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
Revision history for this message
Lorenz (lorenzhab) wrote :

I seem to experience the same issue on Ubuntu Core 18.

I include the chromium snap within my snap for use with puppeteer.

Adding font packages like fonts-dejavu-core as stage-packages does not seem to work.

Do you have any idea how to get around the issue on Ubuntu Core?

Revision history for this message
Olivier Tilloy (osomon) wrote :

Does deleting ~/snap/chromium/common/.cache/fontconfig work around the problem, by any chance?

Revision history for this message
Lorenz (lorenzhab) wrote :

~/snap/chromium/common/.cache/fontconfig does not exist. After trying to run chromium headless the first time ~/snap/chromium/current/.config/fontconfig/ is created. Deleting this folder does not fix the crash.

You can easily reproduce this error by setting up a clean Ubuntu Core 18 instance within a VM, install the chromium snap, and then run

chromium --headless --remote-debugging-port=9222 --remote-debugging-address=[interface-address] https://www.chromium.org/

Olivier Tilloy (osomon)
Changed in chromium-browser (Ubuntu):
assignee: Olivier Tilloy (osomon) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.