Firefox will not open files in /tmp

Asked by Kjell Rönnmark

Running
Ubuntu Relesese 22.04.4 LTS (Jammy Jellyfish) 64-bit
Kernel Linux 5.15.0.107-generic x86_64
Mate 1.26.0

yessika:~> firefox --version
Mozilla Firefox 126.0
yessika:~> ls ~/tmp
img--69166.htm img--71450.htm img--78130.htm img--92574.htm
img--69366.htm img--74147.htm img--86626.htm netplan.html
yessika:/> firefox file:///home/ronnmark/tmp/netplan.html
Gtk-Message: 13:48:12.859: Failed to load module "appmenu-gtk-module"
Gtk-Message: 13:48:12.859: Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
[154186, Main Thread] WARNING: GTK+ module /snap/firefox/4259/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded.
GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.: 'glib warning', file /build/firefox/parts/firefox/build/toolkit/xre/nsSigHandlers.cpp:187

(firefox:154186): Gtk-WARNING **: 13:48:12.862: GTK+ module /snap/firefox/4259/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded.
GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.
Gtk-Message: 13:48:12.862: Failed to load module "canberra-gtk-module"

      After the messages about GTK modules, firefox opens a tab with the netplan page as expected.

yessika:~/bin> cp ~/tmp/netplan.html /tmp
yessika:~> ls /tmp
config-err-l2iSdE
config-err-RP1QYD
dock-replace.log
netplan.html
snap-private-tmp
systemd-private-8b0058bf37c74a35a64c698c5736094c-bluetooth.service-MNZt1u
systemd-private-8b0058bf37c74a35a64c698c5736094c-colord.service-2sIqLA
systemd-private-8b0058bf37c74a35a64c698c5736094c-ModemManager.service-qsrdhv
systemd-private-8b0058bf37c74a35a64c698c5736094c-systemd-logind.service-j8Gja7
systemd-private-8b0058bf37c74a35a64c698c5736094c-systemd-resolved.service-drjK5L
systemd-private-8b0058bf37c74a35a64c698c5736094c-systemd-timesyncd.service-YKe8Cj
systemd-private-8b0058bf37c74a35a64c698c5736094c-ubuntu-advantage-desktop-daemon.service-U2W2tx
systemd-private-8b0058bf37c74a35a64c698c5736094c-upower.service-osRZZ8
tmpqk3cdwyh
yessika:/> firefox file:///tmp/netplan.html
Gtk-Message: 13:48:50.902: Failed to load module "appmenu-gtk-module"
Gtk-Message: 13:48:50.902: Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
[154372, Main Thread] WARNING: GTK+ module /snap/firefox/4259/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded.
GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.: 'glib warning', file /build/firefox/parts/firefox/build/toolkit/xre/nsSigHandlers.cpp:187

(firefox:154372): Gtk-WARNING **: 13:48:50.907: GTK+ module /snap/firefox/4259/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded.
GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.
Gtk-Message: 13:48:50.907: Failed to load module "canberra-gtk-module"

      After the Gtk-Messages, firefox opens a tab with address file:///tmp/netplan.html, containing:

File not found

Firefox can’t find the file at /tmp/netplan.html.

 Clicking the Try again-button doesn’t help.

 Can someone explain why /tmp and ~/tmp are treated so differently by firefox?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Do you have /tmp mounted noexec? This is a good idea for security but could be the cause of your issue

Revision history for this message
Kjell Rönnmark (ronnmark) said :
#2

Interesting question, but
yessika:~> ls -l / | grep tmp
drwxrwxrwt 17 root root 12288 maj 26 04:35 tmp

Anyway, firefox should just read and display the .html-file.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

That's the folder. If you run:

sudo mount -o remount,exec /tmp

Is it OK? Why are you using /tmp anyway?

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#4

I assume that the firefox program that you run is provided in form of a snap package, and there is no access to /tmp from snaps, see https://forum.snapcraft.io/t/firefox-snap-no-access-to-gvfs-and-tmp/27253

Revision history for this message
Kjell Rönnmark (ronnmark) said :
#5

I am confused - is /tmp no just a directory in the ext4 file system mounted on /?
Looking at the output of mount I see nothing mounted on /tmp, and trying what you suggested results in
yessika:/etc> sudo mount -o remount,exec /tmp
mount: /tmp: mount point not mounted or bad option.
which is consistent with that.

I can execute binaries placed in /tmp, so I don't think that exec-permisssion is relevant.

I can easily work around opening files in /tmp with firefox - I just want to be less confused.

Revision history for this message
Kjell Rönnmark (ronnmark) said :
#6

Thanks Manfred,
now I understand that it was just another well know snap-problem.

Revision history for this message
Kjell Rönnmark (ronnmark) said :
#7

Thanks Manfred Hampl, that solved my question.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#8

It can be, or you can have /tmp as a mount point for a file system. You can use nearly any folder as a mount point for a file system. Windows uses "drives" (which they aren't, they're file systems) and recently they've implemented this