Closed Bug 1897907 Opened 2 years ago Closed 2 years ago

"Firefox is already running ..." Version=128 OS=ubuntu24.04

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 128
defect

Tracking

()

VERIFIED FIXED
128 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox126 --- unaffected
firefox127 --- unaffected
firefox128 --- verified

People

(Reporter: maxzhenzhera, Assigned: gerard-majax)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(6 files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0

Steps to reproduce:

  • open the terminal and run firefox google.com
  • open another terminal tab and run firefox google.com

Actual results:

On the first try, Firefox opens the "google.com" page.

On the second try, Firefox shows a pop-up:

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.

Expected results:

On the second try - it should have opened the second "google.com" page.


The bug is present (specifically !!!) under:

  • nightly Firefox (Version=128)
  • ubuntu 24.04 (maybe other versions also)

I easily reproduced it on a fresh Ubuntu install in VM.

No issues on stable (Version=125) or beta (Version=127).
The bug started to appear just in the latest nightly updates (Version=128).


Notes:

  • not related to flag --no-remote
  • not related to problems with any kind of profile locks
  • not related to env variable DBUS_SESSION_BUS_ADDRESS

typo:
stable (Version=125) -> stable (Version=126)

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

So is that Nightly issue only, right?

Flags: needinfo?(maxzhenzhera)

Can you run firefox on terminal as:

MOZ_LOG="nsDBusRemoteClient:5" firefox google.com

and attach the log here?
Thanks.

(In reply to Martin Stránský [:stransky] (ni? me) from comment #4)

Can you run firefox on terminal as:

MOZ_LOG="nsDBusRemoteClient:5" firefox google.com

and attach the log here?
Thanks.

update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/usr/local/share/doc /usr/local/share/doc none bind,ro 0 0): cannot open directory "/usr/local/share": permission denied
update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/usr/share/gimp/2.0/help /usr/share/gimp/2.0/help none bind,ro 0 0): cannot open directory "/var/lib": permission denied
update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/usr/share/gtk-doc /usr/share/gtk-doc none bind,ro 0 0): cannot open directory "/var/lib": permission denied
update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/usr/share/javascript/jquery /usr/share/javascript/jquery none bind,ro 0 0): cannot open directory "/var/lib": permission denied
update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/usr/share/javascript/sphinxdoc /usr/share/javascript/sphinxdoc none bind,ro 0 0): cannot open directory "/var/lib": permission denied
update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/usr/share/libreoffice/help /usr/share/libreoffice/help none bind,ro 0 0): cannot open directory "/var/lib": permission denied
update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/usr/share/sphinx_rtd_theme /usr/share/sphinx_rtd_theme none bind,ro 0 0): cannot open directory "/var/lib": permission denied
update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/usr/share/xubuntu-docs /usr/share/xubuntu-docs none bind,ro 0 0): cannot open directory "/var/lib": permission denied
Gtk-Message: 09:12:07.788: Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
[(null) 4185: Main Thread]: D/nsDBusRemoteClient nsDBusRemoteClient::nsDBusRemoteClient
[(null) 4185: Main Thread]: D/nsDBusRemoteClient nsDBusRemoteClient::SendCommandLine
[(null) 4185: Main Thread]: D/nsDBusRemoteClient nsDBusRemoteClient::DoSendDBusCommandLine()
[(null) 4185: Main Thread]: D/nsDBusRemoteClient   DBus destination: org.mozilla.firefox.ZGVmYXVsdA__
[(null) 4185: Main Thread]: D/nsDBusRemoteClient   DBus path: /org/mozilla/firefox/Remote
[(null) 4185: Main Thread]: D/nsDBusRemoteClient   DBus interface: org.mozilla.firefox
[(null) 4185: Main Thread]: D/nsDBusRemoteClient   failed to OpenURL: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.mozilla.firefox.ZGVmYXVsdA__ was not provided by any .service files
[(null) 4185: Main Thread]: D/nsDBusRemoteClient DoSendDBusCommandLine FAILED
[(null) 4185: Main Thread]: D/nsDBusRemoteClient nsDBusRemoteClient::~nsDBusRemoteClient

update.go logs appear only on the very first launch of Firefox right after boot.
(Looks like it is not related, snap logs. Kept it. Perhaps, it won't be superfluous.)

Flags: needinfo?(maxzhenzhera)

(In reply to Martin Stránský [:stransky] (ni? me) from comment #3)

So is that Nightly issue only, right?

Absolutely.

I'm sorry - I forgot to indicate that I'm using the snap version of Firefox.

Please install d-feet DBus monitor and check if there's org.mozilla.firefox.ZGVmYXVsdA__ session bus interface - that's Firefox remote instance.

Also can you check plain Mozilla binaries?
https://fedoraproject.org/wiki/How_to_debug_Firefox_problems#Testing_Mozilla_binaries

Thanks.

Flags: needinfo?(maxzhenzhera)
Blocks: snap
Priority: -- → P3

Do you have an idea of the range of builds that may have started? You might want to give a try to downloading builds from https://treeherder.mozilla.org/jobs?repo=mozilla-central&searchStr=linux64-snap-amd64-nightly (click on a green B then a panel should open, Artifacts and debugging tools and then you pick the .snap fiile). You can install with sudo snap install --name firefox --dangerous ./path/to/firefox.snap. You should be able to revert later to snap store version with sudo snap refresh --amend firefox.

I'm seeing some AppArmor error:

[(null) 3253726: Main Thread]: D/nsDBusRemoteClient   failed to OpenURL: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.391" (uid=1000 pid=3253726 comm="/snap/firefox/4259/usr/lib/firefox/firefox google." label="snap.firefox.firefox (enforce)") interface="org.mozilla.firefox" member="OpenURL" error name="(unset)" requested_reply="0" destination=":1.114" (uid=1000 pid=331954 comm="/home/alex/bin/firefox/firefox-bin" label="firefox (unconfined)")

(it might be a false positive, the target comm= is my non snap firefox nightly)

d-feet shows me the good instance name on DBus session bus, but it's actually not my running Snap.

Flags: needinfo?(stransky)

Also seeing:

alex@portable-alex:~$ sudo snappy-debug
INFO: Following '/var/log/syslog'. If have dropped messages, use:
INFO: $ sudo journalctl --output=short --follow --all | sudo snappy-debug
kernel.printk_ratelimit = 0
= AppArmor =
Time: 2024-05-22T12:5
Log: apparmor="DENIED" operation="dbus_method_call"  bus="session" path="/org/mozilla/firefox/Remote" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.114" pid=3262006 label="snap.firefox.firefox" peer_pid=331954 peer_label="firefox"
DBus access

= AppArmor =
Time: 2024-05-22T12:5
Log: apparmor="DENIED" operation="dbus_method_call"  bus="session" path="/org/mozilla/firefox/Remote" interface="org.mozilla.firefox" member="OpenURL" mask="send" name=":1.114" pid=3262006 label="snap.firefox.firefox" peer_pid=331954 peer_label="firefox"
DBus access

Ok not sure if I am reproducing the same issue, the dbus name of firefox is the same between snap and non snap, this might be a bug we want to fix?

ok i reproduce on snap nightly only as well, and i can confirm there's no dbus publication in that case

we compute the name from the profile name, in my case they share the same default name but the path are different, maybe we should use the complete path ?

(In reply to Martin Stránský [:stransky] (ni? me) from comment #7)

Please install d-feet DBus monitor and check if there's org.mozilla.firefox.ZGVmYXVsdA__ session bus interface - that's Firefox remote instance.

Also can you check plain Mozilla binaries?
https://fedoraproject.org/wiki/How_to_debug_Firefox_problems#Testing_Mozilla_binaries

Thanks.

SNAP

NO session bus interface for snap.


Plain Mozilla binaries Mozilla Firefox 128.0a1

Session bus interface exists when using plain Mozzila binary.
My initial issue does not repeat - I can perform firefox google.com twice from different terminal tabs without any problems.

But, maybe it is interesting, on the first launch firefox logging the same DoSendDBusCommandLine FAILED.
When I use firefox in the second terminal tab - it logs DoSendDBusCommandLine OK.
As I said, works without problems.

Flags: needinfo?(maxzhenzhera)

(In reply to :gerard-majax from comment #13)

Ok not sure if I am reproducing the same issue, the dbus name of firefox is the same between snap and non snap, this might be a bug we want to fix?

If I understand correctly, then:
In my case, names are different.

snap:
org.mozilla.firefox.ZGVmYXVsdA__
binary:
org.mozilla.firefox.ZGVmYXVsdC1uaWdodGx5

Can you try with snappy-debug ? (sudo snap install snappy-debug)

Flags: needinfo?(maxzhenzhera)
Attached file snappy-debug.log
Flags: needinfo?(maxzhenzhera)

(In reply to :gerard-majax from comment #18)

Can you try with snappy-debug ? (sudo snap install snappy-debug)

Attached above.

I'm sorry.
Haven't used Bugzilla before.
Didn't see where to attach log)

I'm wondering if it's not a regression from bug 1896846 ; last snap build without it was from https://hg.mozilla.org/mozilla-central/pushloghtml?changeset=1a3eb3733a05c61fee90fbd2325013c0b6672817 (yes there's a slight delta, you need to check build log to verify which head was pulled during the build), and the first next build including it is https://hg.mozilla.org/mozilla-central/pushloghtml?changeset=87127891d2401aaf9f6aa65bff25f9f6952131a2. There's your DBus change in the middle. Unfortunately, until https://bugzilla.mozilla.org/show_bug.cgi?id=1841370 or https://bugzilla.mozilla.org/show_bug.cgi?id=1763188 lands it's a bit tedious to bisect :(

Build that should be broken:

$ wget https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/LjVnpWjfTqGpGB4askZCPg/runs/0/artifacts/public/build/firefox_128.0a1_amd64.snap -O firefox_128.0a1_87127891d2401aaf9f6aa65bff25f9f6952131a2_amd64.snap
$ sudo snap install --name firefox_try --dangerous ./firefox_128.0a1_87127891d2401aaf9f6aa65bff25f9f6952131a2_amd64.snap

Build that should work

$ wget https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/UKWOvQMlTEiPhemPELMpGQ/runs/0/artifacts/public/build/firefox_128.0a1_amd64.snap -O firefox_128.0a1_1a3eb3733a05c61fee90fbd2325013c0b6672817_amd64.snap
$ sudo snap install --name firefox_try --dangerous ./firefox_128.0a1_1a3eb3733a05c61fee90fbd2325013c0b6672817_amd64.snap

Can you confirm that firefox_128.0a1_1a3eb3733a05c61fee90fbd2325013c0b6672817_amd64.snap works and firefox_128.0a1_87127891d2401aaf9f6aa65bff25f9f6952131a2_amd64.snap does not? Make sure you run with snap run firefox_try. From my experience, the build 87127891d2401aaf9f6aa65bff25f9f6952131a2 does not publish anything to DBus session

Flags: needinfo?(maxzhenzhera)

(In reply to :gerard-majax from comment #22)

Build that should be broken:

$ wget https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/LjVnpWjfTqGpGB4askZCPg/runs/0/artifacts/public/build/firefox_128.0a1_amd64.snap -O firefox_128.0a1_87127891d2401aaf9f6aa65bff25f9f6952131a2_amd64.snap
$ sudo snap install --name firefox_try --dangerous ./firefox_128.0a1_87127891d2401aaf9f6aa65bff25f9f6952131a2_amd64.snap

Build that should work

$ wget https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/UKWOvQMlTEiPhemPELMpGQ/runs/0/artifacts/public/build/firefox_128.0a1_amd64.snap -O firefox_128.0a1_1a3eb3733a05c61fee90fbd2325013c0b6672817_amd64.snap
$ sudo snap install --name firefox_try --dangerous ./firefox_128.0a1_1a3eb3733a05c61fee90fbd2325013c0b6672817_amd64.snap

Can you confirm that firefox_128.0a1_1a3eb3733a05c61fee90fbd2325013c0b6672817_amd64.snap works and firefox_128.0a1_87127891d2401aaf9f6aa65bff25f9f6952131a2_amd64.snap does not? Make sure you run with snap run firefox_try. From my experience, the build 87127891d2401aaf9f6aa65bff25f9f6952131a2 does not publish anything to DBus session

Yes, I do confirm that.

Flags: needinfo?(maxzhenzhera)

(In reply to :gerard-majax from comment #24)

https://github.com/canonical/firefox-snap/blob/76667e7c33349f3584fa0e0c17f14172c7aa6ca0/snapcraft.yaml#L618

Yes, setting MOZ_DBUS_APP_NAME=firefox_nightly unbreaks. I'm not sure how it should be correctly fixed? Should we set that env from snapcraft.yaml ?

Flags: needinfo?(bandali)

I suspect the Snapcraft definition was based on our use of RemotingName, so we should maybe fix directly packaging?

Attached file GitHub Pull Request
Assignee: nobody → lissyx+mozillians
See Also: → 1754951
Keywords: regression
Regressed by: 1896846
See Also: → 1898283
Flags: needinfo?(stransky)

So we are fine moving away from using the RemotingName ? And we need to update the snapcraft definitions?

Flags: needinfo?(stransky)
Duplicate of this bug: 1898320

(In reply to :gerard-majax from comment #29)

So we are fine moving away from using the RemotingName ? And we need to update the snapcraft definitions?

Yes. RemotingName depends on desktop file which is not reliable. Please use MOZ_DBUS_APP_NAME if you change application name.

Flags: needinfo?(stransky)

alternative PR with usage of the env var, up to upstream to decide

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED

Set release status flags based on info from the regressing bug 1896846

Target Milestone: --- → 128 Branch

Reproduced the initial issue from comment 0 using an affected Nightly build (from comment 22), verified that using latest Nightly 129.0a1 snap build and latest Beta 128.0b9 snap build the issue is no longer reproducible, the google pages open in the same browser in the same session. Tested on Ubuntu 24.04 and 22.04.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Flags: needinfo?(bandali)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: