Firefox Snap won't Start under Ubuntu 21.10

The error messages you shared shouldn’t prevent firefox from starting.

If you’re willing to re-install the firefox snap (the snap and the deb can co-exist), I’d be interested in getting more information about this problem. If so let me know and we can continue the debugging here.

I have removed and reinstalled the Firefox snap. But I’m willing to give it another go. Should I uninstall the Firefox deb first? And assuming I get the same message (different from terminal and gui) how do you want me to collect any data?

Ok, no need to uninstall the deb. The first thing to do is to close the application and ensure it’s not running (the output of ps -ef | grep firefox should be empty).

Then run snap run firefox -version and share the output here.

Then run snap run firefox and let us know what happens, and the full output you get.

Then please share the output of snap connections firefox.

Some details about your hardware (CPU architecture, GPU, graphics drivers, …) would be useful, too.

Seeing the “libEGL missing” part of the error, are you using an Nvidia GPU by any chance? I wonder if this might possibly be related to this issue?

@jamesh, yes I do have an Nvidia graphics card. This was my old gaming rig a while ago.

For everyone else, here is what inxi reports.

paul@p6t:~$ inxi -Fx
System:    Host: p6t Kernel: 5.13.0-20-generic x86_64 bits: 64 compiler: gcc v: 11.2.0 Desktop: GNOME 40.5 
           Distro: Ubuntu 21.10 (Impish Indri) 
Machine:   Type: Desktop Mobo: ASUSTeK model: P6T DELUXE V2 v: Rev 1.xx serial: <superuser required> BIOS: American Megatrends 
           v: 1108 date: 09/21/2010 
CPU:       Info: Quad Core model: Intel Core i7 920 bits: 64 type: MT MCP arch: Nehalem rev: 4 cache: L2: 8 MiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 42765 
           Speed: 2368 MHz min/max: 1600/2668 MHz boost: enabled Core speeds (MHz): 1: 2368 2: 2678 3: 1804 4: 1957 5: 1830 
           6: 2671 7: 2553 8: 2505 
Graphics:  Device-1: NVIDIA GP104 [GeForce GTX 1070] vendor: Micro-Star MSI driver: nvidia v: 470.74 bus-ID: 02:00.0 
           Display: x11 server: X.Org 1.20.13 driver: loaded: nvidia unloaded: fbdev,modesetting,nouveau,vesa 
           resolution: 1920x1080~60Hz 
           OpenGL: renderer: NVIDIA GeForce GTX 1070/PCIe/SSE2 v: 4.6.0 NVIDIA 470.74 direct render: Yes 
Audio:     Device-1: Intel 82801JI HD Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 
           Device-2: NVIDIA GP104 High Definition Audio vendor: Micro-Star MSI driver: snd_hda_intel v: kernel bus-ID: 02:00.1 
           Sound Server-1: ALSA v: k5.13.0-20-generic running: yes 
           Sound Server-2: PulseAudio v: 15.0 running: yes 
           Sound Server-3: PipeWire v: 0.3.32 running: yes 
Network:   Device-1: Marvell 88E8056 PCI-E Gigabit Ethernet vendor: ASUSTeK driver: sky2 v: 1.30 port: d800 bus-ID: 04:00.0 
           IF: enp4s0 state: up speed: 1000 Mbps duplex: full mac: 00:24:8c:5e:5b:e5 
           Device-2: Marvell 88E8056 PCI-E Gigabit Ethernet vendor: ASUSTeK driver: sky2 v: 1.30 port: e800 bus-ID: 05:00.0 
           IF: enp5s0 state: down mac: 00:24:8c:5e:5b:e6 
           IF-ID-1: br-50eeec6bac19 state: down mac: 02:42:0c:09:66:29 
           IF-ID-2: br-57eaed46af7e state: down mac: 02:42:27:17:b1:e3 
           IF-ID-3: docker0 state: down mac: 02:42:3d:d6:c7:1b 
Drives:    Local Storage: total: 3.64 TiB used: 53.88 GiB (1.4%) 
           ID-1: /dev/sda vendor: Mushkin model: MKNSSDRE1TB size: 931.51 GiB temp: 26 C 
           ID-2: /dev/sdb vendor: Hitachi model: HDS721010CLA332 size: 931.51 GiB temp: 33 C 
           ID-3: /dev/sdc vendor: Western Digital model: WD10EACS-00D6B0 size: 931.51 GiB temp: 32 C 
           ID-4: /dev/sdd vendor: Hitachi model: HDS721010CLA332 size: 931.51 GiB temp: 32 C 
Partition: ID-1: / size: 196.74 GiB used: 21.48 GiB (10.9%) fs: ext4 dev: /dev/sda1 
           ID-2: /home size: 2.73 TiB used: 32.4 GiB (1.2%) fs: btrfs dev: /dev/sdb 
Swap:      ID-1: swap-1 type: file size: 1024 MiB used: 328 MiB (32.0%) file: /swapfile 
Sensors:   System Temperatures: cpu: 47.5 C mobo: 38.0 C gpu: nvidia temp: 42 C 
           Fan Speeds (RPM): cpu: 1480 psu: 0 case-1: 0 case-2: 1577 case-3: 0 gpu: nvidia fan: 0% 
           Power: 12v: 12.19 5v: N/A 3.3v: 3.25 vbat: N/A 
Info:      Processes: 373 Uptime: 4d 4h 51m Memory: 5.79 GiB used: 4.13 GiB (71.3%) Init: systemd runlevel: 5 Compilers: 
           gcc: 11.2.0 Packages: 2218 Shell: Bash v: 5.1.8 inxi: 3.3.06

I gave it a try and things didn’t go so well. Basically after 25 minutes I gave up. Here is what I did just so we are all in sync. First a shutdown and reboot. Firefox deb is still installed. Here are the snaps installed at the start of this;

paul@p6t:~$ snap list
Name                               Version                      Rev    Tracking          Publisher     Notes
bare                               1.0                          5      latest/stable     canonical✓    base
bashtop                            0.9.25                       350    latest/stable     kz6fittycent  -
canonical-livepatch                9.8.0                        114    latest/stable     canonical✓    -
chromium                           95.0.4638.54                 1801   latest/stable     canonical✓    -
code                               6cba118a                     78     latest/stable     vscode✓       classic
core                               16-2.52.1                    11993  latest/stable     canonical✓    core
core18                             20210722                     2128   latest/stable     canonical✓    base
core20                             20210928                     1169   latest/stable     canonical✓    base
glimpse-editor                     0.2.0                        204    latest/stable     trechnex      -
gnome-3-28-1804                    3.28.0-19-g98f9e67.98f9e67   161    latest/stable     canonical✓    -
gnome-3-34-1804                    0+git.3556cb3                72     latest/stable/…   canonical✓    -
gnome-3-38-2004                    0+git.6ba6040                76     latest/stable     canonical✓    -
gnome-system-monitor               40.1-2-ga819fb4b55           163    latest/stable     canonical✓    -
gtk-common-themes                  0.1-59-g7bca6ae              1519   latest/stable/…   canonical✓    -
gtk2-common-themes                 0.1                          13     latest/stable     canonical✓    -
inkscape                           1.1.1-eb90963e84-2021-10-02  9256   latest/stable     inkscape✓     -
kde-frameworks-5-qt-5-15-3-core20  5.85.0                       5      latest/stable     kde✓          -
kde-frameworks-5-qt-5-15-core20    5.79.0                       14     latest/stable     kde✓          -
kmahjongg                          0.9.21080                    57     latest/candidate  kde✓          -
rpi-imager                         1.6.2                        184    latest/stable     popey         -
snap-store                         3.38.0-66-gbd5b8f7           557    latest/stable/…   canonical✓    -
snapd                              2.52.1                       13640  latest/stable     canonical✓    snapd
solitaire                          1.1                          5      latest/stable     1bsyl         -
sublime-text                       4113                         109    latest/stable     snapcrafters  classic
whatsapp-for-linux                 1.3.0                        27     latest/stable     nshecan       -

Checking to see if firefox is running:

paul@p6t:~$ ps -ef | grep firefox
paul        8822    7007  0 21:11 pts/1    00:00:00 grep --color=auto firefox

verifying that the firefox snap isn’t installed

paul@p6t:~$ snap run firefox -version
error: cannot find current revision for snap firefox: readlink /snap/firefox/current: no such file or directory

Installing the firefox snap

paul@p6t:~$ snap install firefox firefox 93.0-1 from Mozilla✓ installed

Trying to verify the firefox snap version

> paul@p6t:~$ snap run firefox -version
> Importing existing firefox profiles from /home/paul/.mozilla/firefox

After 25 minutes I checked in on HTOP to see if it was still running;

I closed the terminal and opened a new one

paul@p6t:~$ snap run firefox -version
Mozilla Firefox 93.0

Looks promising;

paul@p6t:~$ snap run firefox
Gtk-Message: 21:33:15.199: Failed to load module "canberra-gtk-module"
Gtk-Message: 21:33:15.221: Failed to load module "canberra-gtk-module"
[GFX1-]: glxtest: libEGL missing
[GFX1-]: glxtest: libEGL missing

###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost

It sounds like the profile import wasn’t done yet. 25 minutes sounds a lot to copy a profile directory though. Can you share the output of du -sh ~/.mozilla/firefox ?

Regarding the glxtest: libEGL missing error, given the details you shared, it is very likely the problem that @jamesh mentioned with EGL-using snaps on Ubuntu 21.10 with NVIDIA.

@oSoMoN Here you go

paul@p6t:~$ du -sh ~/.mozilla/firefox 
329M	/home/paul/.mozilla/firefox

329M should definitely not take that long to copy over. Would you mind retrying that? You’d need to rm -rf ~/snap/firefox/common/.mozilla, then launch the snap again from the command line and report how it goes.

@oSoMoN, I did what you suggested. I had to reinstall the firefox snap as I’d removed it after the last failed try. The import this time was on the order of 5 minutes. I didn’t actually watch it :slight_smile:

paul@p6t:~$ du -sh ~/.mozilla/firefox 
329M	/home/paul/.mozilla/firefox
paul@p6t:~$ rm -rf ~/snap/firefox/common/.mozilla
paul@p6t:~$ snap install firefox
firefox 93.0-1 from Mozilla✓ installed
paul@p6t:~$ snap run firefox
Importing existing firefox profiles from /home/paul/.mozilla/firefox
Found default profile: r2lxv19d.default-release
Import done in 64.117 s
Gtk-Message: 15:13:23.229: Failed to load module "canberra-gtk-module"
Gtk-Message: 15:13:23.281: Failed to load module "canberra-gtk-module"
[GFX1-]: glxtest: libEGL missing
[GFX1-]: glxtest: libEGL missing

###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost

###!!! [Parent][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
paul@p6t:~$ 

Now, just before the two !!![Parent] messages, a Firefox popup window that says:

`

Firefox is already running, but is not responding. To use Firefox, you must first close the existing Firefox process, restart your device, or use a different profile.

I did shut the system down, and restarted it. After login I tried the Firefox snap again and got the same results.

According to that log, the import took just over a minute. That’s still quite long to copy over 329MB, but at least it didn’t stall forever. Is this a mechanical hard drive?

No, the OS and home directories are on an SSD. Not a terribly fast one …

/dev/sda vendor: Mushkin model: MKNSSDRE1TB size: 931.51

So, I guess we are out of ideas on why the Firefox snap won’t run on my system. How do I go about writing up a bug report?

Sorry for the late reply. Seeing that this is most likely the issue mentioned by James that affects other snaps, not just firefox, I’d suggest filing a bug against snapd (don’t forget to reference this post and the other, more general one). Thanks!

For anyone having this problem on an Nvidia system, could you give the following a try? I don’t have such a system, so I’d be interested to see the results.

In a terminal, run snap run --shell firefox. This should drop you at a bash shell prompt within firefox’s confinement. In that shell, run the following commands:

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH/"${SNAP_LIBRARY_PATH}:"/}
exec $SNAP/firefox.launcher

If Firefox starts up correctly, could you try opening about:support in a tab, and check to see whether it looks like the Nvidia drivers are being used in the Graphics section.

This will remove the LD_LIBRARY_PATH elements added by $SNAP/snap/command-chain/snapcraft-runner related to host system OpenGL drivers. The drivers should still be available later on in the library path, since $SNAP/snap/command-chain/desktop-launch also adds /var/lib/snapd/lib/gl to the end.

This will hopefully let the copy of the libEGL driver multiplexer (aka libglvnd) from the gnome-3-38-2004 shadow the copy from the host system, while still making the actual Nvidia driver library available on the search path.

I have the Nvidia issues with other snaps, but do not have any such issues with the Firefox snap (all on Impish). I’m not sure whether that’s the same problem.

You could try adapting the instructions I’ve listed above. Basically change the snap run --shell invocation to match your snap, and the final exec line to match whatever is listed on the command: line of the snap’s $SNAP/meta/snap.yaml file. I’m not sure how well it will work for snaps not using the desktop extension, since their launch script could be quite different.

Yes, that works for other snaps. Firefox has never had problems like in EGL-using snaps on impish seem to be broken when using the Nvidia proprietary driver for me.

I had removed the Firefox snap and so first I installed it again (leaving the Firefox deb installed)

paul@p6t:~$ sudo snap list [sudo] password for paul: Name Version Rev Tracking Publisher Notes firefox 94.0.1-1 701 latest/stable mozilla✓ -

paul@p6t:~$ firefox

###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost

paul@p6t:~$

I waited for a few moments and tried it a second time. This time firefox launched. But I wasn’t sure which one was running; the deb or snap. I also didn’t have a command prompt so I opened a second terminal window and got an unexpected error message

paul@p6t:/home/paul$ sudo snap run --shell firefox bash: /usr/bin/sudo: Permission denied paul@p6t:/home/paul$

So I tried it a different way;

paul@p6t:~$ /snap/bin/firefox Gtk-Message: 10:07:48.117: Failed to load module “canberra-gtk-module” Gtk-Message: 10:07:48.144: Failed to load module “canberra-gtk-module” [GFX1-]: glxtest: libEGL missing [GFX1-]: glxtest: libEGL missing

###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost

I got a popup window saying that “Firefox is already running, but is not responding. To use Firefox, you must first close the existing Firefox process, restart your device, or use a different profile.”

Launching firefox from the GUI gives the same popup message

In general, you shouldn’t run snap commands as sudo, but as a regular user.

To know which version of firefox will be run when simply invoking firefox, you can run which firefox (if /usr/bin/firefox is output, it’s the deb, otherwise you will get /snap/bin/firefox).

Can you test again @jamesh’s suggestion without sudo?