2

On my Devuan GNU/Linux system, I have a newer version of Firefox installed, under /opt/firefox . I also have /usr/local/bin/firefox point to it, indirectly, via Debian's alternatives mechanism (i.e. via /etc/alternatives/firefox).

When I just start firefox and it's not already running - this works fine. But if it is already running, then startup takes a long time, and eventually I get that dreaded error message box:

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.

Now, I don't have _MOZ_NO_REMOTE set; and I don't start firefox with a -no-remote option.

What can I do to prevent the above error (and thus allow opening links with a firefox https://foo.bar/ command)?

Notes:

  • Obviously, I don't want to close the existing running instance.
  • Not a dupe of this, which has MOZ_NO_REMOTE set to 0.
  • Not a dupe of this, which involves specific Thunderbird-Firefox interaction.
  • Not a dupe of this, as I don't seem to have any parent.lock file anywhere.
einpoklum
  • 8,783
  • 20
  • 84
  • 153

2 Answers2

2

The problem was some zombie running instances of the firefox-bin process. The surprising part is that the firefox may run in this situation without complaining, when no other window is open but when some processes are. I have no idea why the mechanisms for bailing out are not uniform, but that's how it is.

So, what I did was:

  1. Close Firefox.
  2. pgrep firefox
  3. kill the processes you found, or kill -KILL them if they don't die.
  4. Double-check for the presence of parent.lock under ~/.mozilla/firefox (delete it if it's there).
  5. Start firefox again.
einpoklum
  • 8,783
  • 20
  • 84
  • 153
1

Ubuntu 20.04 LTS

I ran into this problem myself, but none of the google results could solve my problem. Eventually I figured it out by myself.


Simple Version:

  1. This environment variable was missing from my bash shell.
    DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1003/bus

Exhaustive Version:

  1. My shell is launched from crontab
    */2 * * * * /home/user/start-up.sh
  2. start-up.sh starts a tmux session.
    tmux set -g default-shell /usr/bin/bash
    tmux new-window -t "myservices" -d
  3. Using ssh to connect Console and attach to tmux session by
    tmux a -dt myservices
  4. Launch the first firefox with profile name Proxy with SSH Console. DISPLAY=:10.0 firefox --new-tab "about:blank" -P Proxy &
  5. Do step 4 again, causing the error, "Firefox is already running, but is not responding."
  6. But if I do step 4 inside a Terminal rather than ssh console, firefox opens one more newtab as expected.
  7. After cross comparing between the env of the Terminal and SSH Console, I found if I set this variable into the Console, firefox will do as it should.
    export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1003/bus

Terminal
SSH Console after adding DBUS_SESSION_BUS_ADDRESS

  • I also suspect the issue is DBus related, but the method you write not work for me. I build firefox from source, maybe the dbus intergration is not built in? not likely though. – neoedmund Feb 20 '23 at 06:01
  • I fix the problem, it was a dbus issue. my dbus is not properly installed. `dbus-uuidgen` or `dbus-launch` complains .so linking problems. After I reinstall the dbus, the problem is solved. – neoedmund Feb 20 '23 at 07:23