9

Since I installed ubuntu 22.04 I have the following error message after clicking on a link in thunderbird if firefox is already running (instead of opening the link in a new tab):

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.

If firefox isn't running, clicking on the link opens a new firefox instance and displays the corresponding web page.

The helper app for opening links in thunderbird points to /snap/bin/firefox.

The same problem occurs if I try to open a website (in a new tab) from command line for example firefox www.google.com.

I guess it has something to do with the fact that firefox is installed as snap now, but I am not sure.

What can I do, to solve the problem?

  • 2
    There seems to be a similar issue with the snap version of thunderbird, see here. – student Sep 03 '22 at 07:56
  • Were you able to find a solution to this? – MadPhysicist Sep 20 '22 at 05:26
  • 1
    This occurs most commonly when there is a delay loading the profile, delay drawing firefox on the screen, or after firefox has crashed. It is not snap-specific. Run ps -aux | grep firefox. Note the PID of the firefox process. If firefox still has not started after a few seconds, kill the process and then restart firefox. – user535733 Oct 03 '22 at 14:29
  • 1
    I think we're on to something here: https://discourse.ubuntu.com/t/call-for-testing-native-messaging-support-in-the-firefox-snap/29759/95. cc @MadPhysicist – Sebastian Oct 05 '22 at 11:29
  • Check what DBUS_SESSION_BUS_ADDRESS is set to in your terminal app. That was the problem for me. Which terminal app are you using? – Sebastian Oct 10 '22 at 07:57

3 Answers3

1

I can reproduce your issue in a virtual machine when I unset the DBUS_SESSION_BUS_ADDRESS environmental variable. This prevents the "firefox" command from correctly connecting to the running window of Firefox. In a default Ubuntu install, the variable is set. In my main machine, which is an upgrade, the variable is not set. Also see this bug report.

As a quick fix, add

export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"

to your ~/.profile file, and log out then back in for the variable to take effect.

If after this, the issue still exists, then uninstall and reinstall the snap package.

vanadium
  • 88,010
  • Just as a hint where to look: for me, the problem was that I had overridden DBUS_SESSION_BUS_ADDRESS to empty for my terminal application, to solve https://askubuntu.com/questions/1189243/why-is-terminator-sending-double-characters-to-terminals-that-arent-selected-in some years ago. – Sebastian Oct 10 '22 at 08:00
  • I have this problem with the snap version of Firefox 113 on Ubuntu 22.04, despite my DBUS_SESSION_BUS_ADDRESS envar being set correctly. I cannot open new tabs or windows to a Firefox profile if it is already running in an open session. I did not have this problem when working with Firefox installed from repositories. – markling May 30 '23 at 08:03
0

I don't believe there is a workaround for this, assuming you'll keep using the snap version from inside Thunderbird.

One idea would be to set up an instance of Firefox non-snap somewhere.

Try this:

cd ~/bin ( or wherever you keep your binaries )

wget https://download-installer.cdn.mozilla.net/pub/firefox/releases/105.0.1/linux-x86_64/en-US/firefox-105.0.1.tar.bz2

tar -xf firefox-105.0.1.tar.bz2

This will download the latest ( at this time ) version and extract it, you will have a ready executable ./firefox in the extraction directory.

Now you can change the helper app pointer to ~/yourdir/firefox-105.0.1/firefox

This instance will self-update as well.

Good luck :)

  • 1
    I have the same problem as the one asked the question. I tried to install a clean Ubuntu 22.04 in a VM, and there everything worked fine. So something is clearly off somewhere in my (and the OPs) current installation, that has been upgraded from 16.04 -> 18.04, 18.04 -> 20.04 and now 20.04 -> 22.04. – Sebastian Oct 04 '22 at 05:39
  • for me, using the mozilla binary and removing the snap does not resolve the problem. I am using the wayland session of the mozilla binary. Ubuntu 22.10 – Tim Richardson Mar 12 '23 at 00:16
0

Look in /usr/share/applications/ for the Firefox.desktop.

you can then open with a text editor look at the commands you can use for Firefox at the bottom of the file.

you should see some "desktop actions"

for your use case,for terminal, you need to type

firefox --newtab https//:www.yourwebadresshere.netcomdotfun

for thunderbird, it needs to be pointing at /usr/bin/firefox. That's where the symbolic link is stored so you can run firefox as a command on most systems. go to /usr/bin/ and find firefox in there before you change anything. I don't know how to change that, I don't use thunderbird. However, it might be pointing to /snap/bin/firefox because it was installed through snap, and that's where its symbolic link is stored. If the symbolic link is in /snap/bin/, and not usr/bin/, it might not open links at all if you change that(if you can change that), unless you make another symbolic link to /usr/bin/ or /snap/bin/

Make sure you go into the Firefox settings and make sure "open links in new tabs" is on, that should help.

If you ever get the: "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." - Error again, open up terminal and type "killall firefox"- that'll close it even if it's frozen. also, a straight logout to the greeter should also kill all the programs running.

Good luck.