Score:0

Snap can't refresh firefox

vn flag

I got a popup saying something along the lines of "There's an update for Firefox. Please make sure it's not running". So I make sure Firefox is not running and do:

Wizard Earth:snap refresh firefox
error: cannot perform the following tasks:
- Run configure hook of "firefox" snap if present (run hook "configure": /snap/firefox/1993/snap/command-chain/hooks-configure-desktop: line 34: cannot create temp file for here-document: No such file or directory)
Wizard Earth:

So I start poking around:

Wizard Earth:ll /snap/firefox/
total 8
drwxr-xr-x  3 root root 4096 Oct 24 06:21 ./
drwxr-xr-x 21 root root 4096 Oct 14 11:16 ../
drwxr-xr-x  7 root root  201 Oct  7 13:20 1943/
lrwxrwxrwx  1 root root    4 Oct 24 06:21 current -> 1943/
Wizard Earth:

OK so there is no 1993, but there is a hooks-configure-desktop under 1943!

Wizard Earth:ls /snap/firefox/1943/snap/command-chain/hooks-configure-desktop 
/snap/firefox/1943/snap/command-chain/hooks-configure-desktop*
Wizard Earth:/snap/firefox/1943/snap/command-chain/hooks-configure-desktop
/usr/share/fonts: caching, new cache contents: 0 fonts, 6 dirs
/usr/share/fonts/X11: caching, new cache contents: 0 fonts, 6 dirs
/usr/share/fonts/X11/100dpi: caching, new cache contents: 358 fonts, 0 dirs
/usr/share/fonts/X11/75dpi: caching, new cache contents: 358 fonts, 0 dirs
/usr/share/fonts/X11/Type1: caching, new cache contents: 127 fonts, 0 dirs
/usr/share/fonts/X11/encodings: caching, new cache contents: 0 fonts, 1 dirs
/usr/share/fonts/X11/encodings/large: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/X11/misc: caching, new cache contents: 90 fonts, 0 dirs
/usr/share/fonts/X11/util: caching, new cache contents: 0 fonts, 0 dirs
...
/usr/share/fonts/truetype/roboto/unhinted: skipping, looped directory detected
/usr/share/fonts/truetype/roboto/unhinted/RobotoTTF: skipping, looped directory detected
/fontconfig: cleaning cache directory
/var/cache/fontconfig: cleaning cache directory
/usr/bin/fc-cache: succeeded
Wizard Earth:

And it runs, but the problem remains.

Since the script exists in 1943 and there is no 1993 I figured I'd try to symlink it:

Wizard Earth:ln -s 1943 1993
Wizard Earth:snap refresh firefox
error: cannot perform the following tasks:
- Mount snap "firefox" (1993) (systemctl command [start snap-firefox-1993.mount] failed with exit status 1: Job failed. See "journalctl -xe" for details.
)
Wizard Earth:ll
total 8
drwxr-xr-x  3 root root 4096 Oct 24 06:34 ./
drwxr-xr-x 21 root root 4096 Oct 14 11:16 ../
drwxr-xr-x  7 root root  201 Oct  7 13:20 1943/
lrwxrwxrwx  1 root root    4 Oct 24 06:28 current -> 1943/
Wizard Earth:

So it's not able to start the snap-firefox-1993.mount because somewhere in the process it removed 1993! Does Firefox need a mount anyway?

So then I think, "I wonder what happens if I mv 1943 -> 1993". This is where it gets weird:

Wizard Earth:mv 1943 1993
mv: cannot move '1943' to '1993': Device or resource busy
Wizard Earth:lsof 1943
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
lsof: WARNING: can't stat() fuse.portal file system /run/user/1000/doc
      Output information may be incomplete.
Wizard Earth:

Copy perhaps?

Wizard Earth:cp -rp 1943 1993
Wizard Earth:snap refresh firefox
error: cannot perform the following tasks:
- Run configure hook of "firefox" snap if present (run hook "configure": /snap/firefox/1993/snap/command-chain/hooks-configure-desktop: line 34: cannot create temp file for here-document: No such file or directory)
Wizard Earth:ls
1943/  current@
Wizard Earth:

OK How about a remove and reinstall?

Wizard Earth:snap remove firefox
error: cannot perform the following tasks:
- Disconnect firefox:x11 from snapd:x11 (cannot update mount namespace of snap "firefox": cannot update preserved namespace of snap "firefox": 
-----
update.go:85: cannot change mount namespace according to change mount (/snap/gtk-common-themes/1535/share/themes/Adwaita-dark /snap/firefox/1943/data-dir/themes/Adwaita-dark none bind,ro 0 0): cannot create writable mimic over "/snap/firefox/1943/data-dir/themes": cannot create directory "/tmp/.snap": no such file or directory
update.go:85: cannot change mount namespace according to change mount (/snap/gtk-common-themes/1535/share/themes/Adwaita /snap/firefox/1943/data-dir/themes/Adwaita none bind,ro 0 0): cannot create writable mimic over "/snap/firefox/1943/data-dir/themes": cannot create directory "/tmp/.snap": no such file or directory
update.go:85: cannot change mount namespace according to change mount (/snap/gtk-common-themes/1535/share/themes/Ambiance /snap/firefox/1943/data-dir/themes/Ambiance none bind,ro 0 0): cannot create writable mimic over "/snap/firefox/1943/data-dir/themes": cannot create directory "/tmp/.snap": no such file or directory
...
update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/tmp/.X11-unix /tmp/.X11-unix none bind,ro 0 0): cannot create directory "/tmp/.X11-unix": no such file or directory
cannot update snap namespace: cannot create writable mimic over "/usr/share": cannot create directory "/tmp/.snap": no such file or directory
-----)

Hmmm... Did it remove it?

Earth:firefox
update.go:85: cannot change mount namespace according to change mount (/run/user/1000/doc/by-app/snap.firefox /run/user/1000/doc none bind,rw,x-snapd.ignore-missing 0 0): permission denied
/snap/firefox/1943/snap/command-chain/desktop-launch: line 52: /home/andrew/.config/user-dirs.dirs: Permission denied
ERROR: not connected to the gnome-3-38-2004 content interface.
Earth:ll .config/user-dirs.dirs 
-rw-r--r-- 1 andrew defaria 725 Mar  1  2022 .config/user-dirs.dirs
Earth:

Great! Now I can't run Firefox anymore! Maybe reinstall?

Wizard Earth:snap refresh firefox
error: cannot perform the following tasks:
- Setup snap "firefox" (1993) security profiles (cannot update mount namespace of snap "firefox": cannot update preserved namespace of snap "firefox": cannot update snap namespace: cannot create writable mimic over "/snap/firefox/1993/gnome-platform": cannot create directory "/tmp/.snap": no such file or directory)
Wizard Earth:mkdir /tmp/.snap
Wizard Earth:snap refresh firefox
error: cannot perform the following tasks:
- Setup snap "firefox" (1993) security profiles (cannot update mount namespace of snap "firefox": cannot update preserved namespace of snap "firefox": cannot update snap namespace: cannot create writable mimic over "/snap/firefox/1993/gnome-platform": cannot create directory "/tmp/.snap": no such file or directory)
Wizard Earth:
us flag
Workaround: Switch to the apt version. https://askubuntu.com/questions/1399383/how-to-install-firefox-as-a-traditional-deb-package-without-snap-in-ubuntu-22
ru flag
I'm assuming you used `sudo` with your `snap refresh firefox` call or are on the root account, yes?
cc flag
@thomas-ward snap will pop up a window for priv escalation, but seems like the 1993 directory got corrupted.
Andrew DeFaria avatar
vn flag
The "Wizard" part of the prompt was a clue. Yes, I was root. The 1993 directory didn't get corrupted rather was never there! I had no idea you could go back to an apt-based install! So far snap has left a bad taste in my mouth but I wonder if is it inevitable that such apps would be snap only. You did see that I am unable to remove the snap version of firefox... Still, I seem to have been able to install and use the apt-based version. Still think snap sucks...
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.