firefox remote on wayland/dbus does not work

Bug #1925392 reported by Paul Collins
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
firefox (Ubuntu)
Fix Released
High
Olivier Tilloy

Bug Description

[agnew(~)] lsb_release -rc
Release: 21.04
Codename: hirsute
[agnew(~)] dpkg-query -W firefox
firefox 87.0+build3-0ubuntu4
[agnew(~)]

Attempting to open links with `firefox $URL` times out and gives me the old familiar profile-locked error dialog.

As far as I can tell, all of the ducks are lined up correctly (thanks to the fix for LP:1921931)

[agnew(~)] tr \\0 \\n < /proc/$(pgrep -x firefox)/environ | egrep -i 'dbus|wayland'
XDG_SESSION_TYPE=wayland
MOZ_ENABLE_WAYLAND=1
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
MOZ_DBUS_REMOTE=1
WAYLAND_DISPLAY=wayland-0
XAUTHORITY=/run/user/1000/.mutter-Xwaylandauth.QKTZ10
[agnew(~)] sh -x $(which firefox) https://ubuntu.com/
+ set -e
+ MOZ_LIBDIR=/usr/lib/firefox
+ which /usr/bin/firefox
+ MOZ_APP_LAUNCHER=/usr/bin/firefox
+ MOZ_APP_NAME=firefox
+ export MOZ_APP_LAUNCHER
+ [ wayland = wayland ]
+ export MOZ_ENABLE_WAYLAND=1
+ export MOZ_DBUS_REMOTE=1
+ [ ! -x /usr/lib/firefox/firefox ]
+ moz_debug=0
+ moz_debugger_args=
+ moz_debugger=gdb
+ [ 1 -gt 0 ]
+ break
+ [ 0 -eq 1 ]
+ exec /usr/lib/firefox/firefox https://ubuntu.com/
[GFX1-]: No GPUs detected via PCI
[GFX1-]: glxtest: process failed (received signal 11)

(firefox:60063): Gtk-WARNING **: 10:09:52.171: Loading IM context type 'xim' failed

(firefox:60063): Gtk-WARNING **: 10:09:52.174: Loading IM context type 'xim' failed

(firefox:60063): Gtk-WARNING **: 10:09:52.179: Loading IM context type 'xim' failed

(firefox:60063): Gtk-WARNING **: 10:09:52.179: Loading IM context type 'xim' failed

(firefox:60063): Gtk-WARNING **: 10:09:52.197: Loading IM context type 'xim' failed

(firefox:60063): Gtk-WARNING **: 10:09:52.199: Loading IM context type 'xim' failed

###!!! [Parent][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost

[agnew(~)]

However, on dbus-monitor, I see:

method call time=1619043038.755430 sender=:1.392 -> destination=org.mozilla.firefox.ZGVmYXVsdA__ serial=2 path=/org/mozilla/firefox/Remote; interface=org.mozilla.firefox; member=OpenURL
   array of bytes [
      02 00 00 00 17 00 00 00 30 00 00 00 2f 68 6f 6d 65 2f 70 61 75 6c 00 2f
      75 73 72 2f 6c 69 62 2f 66 69 72 65 66 6f 78 2f 66 69 72 65 66 6f 78 00
      68 74 74 70 73 3a 2f 2f 75 62 75 6e 74 75 2e 63 6f 6d 2f 00
   ]
error time=1619043038.755479 sender=org.freedesktop.DBus -> destination=:1.392 error_name=org.freedesktop.DBus.Error.ServiceUnknown reply_serial=2
   string "The name org.mozilla.firefox.ZGVmYXVsdA__ was not provided by any .service files"

And, indeed, firefox is not listening on that name (which is correct for my profile, "default") or indeed any other such name:

[agnew(~)] busctl --user | grep -i firefox
:1.162 54607 firefox paul :1.162 user@1000.service - -
:1.163 54607 firefox paul :1.163 user@1000.service - -
[agnew(~)] _
---
ProblemType: Bug
AddonCompatCheckDisabled: False
ApportVersion: 2.20.11-0ubuntu65
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: paul 3311 F.... pulseaudio
 /dev/snd/controlC1: paul 3311 F.... pulseaudio
BuildID: 20210318103112
CasperMD5CheckResult: unknown
Channel: Unavailable
CurrentDesktop: GNOME
DefaultProfileIncompatibleExtensions: Default - {972ce4c6-7e08-4474-a285-3208198ce6fd}
DefaultProfilePrefErrors: Unexpected character ',' before close parenthesis @ /usr/lib/firefox/omni.ja:greprefs.js:352
DefaultProfilePrefSources:
 /usr/lib/firefox/defaults/pref/all-ubuntu-gnome.js
 prefs.js
DistroRelease: Ubuntu 21.04
ForcedLayersAccel: False
InstallationDate: Installed on 2011-11-06 (3454 days ago)
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111011)
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
Package: firefox 87.0+build3-0ubuntu4
PackageArchitecture: amd64
ProcCmdline: BOOT_IMAGE=/vmlinuz-5.11.0-16-generic root=UUID=617752e9-3054-4928-881c-0e0651a839b0 ro splash quiet vt.handoff=7
ProcVersionSignature: Ubuntu 5.11.0-16.17-generic 5.11.12
Profile1Extensions: extensions.sqlite corrupt or missing
Profile1IncompatibleExtensions: Unavailable (corrupt or non-existant compatibility.ini or extensions.sqlite)
Profile1Locales: extensions.sqlite corrupt or missing
Profile1PrefErrors: Unexpected character ',' before close parenthesis @ /usr/lib/firefox/omni.ja:greprefs.js:352
Profile1PrefSources:
 /usr/lib/firefox/defaults/pref/all-ubuntu-gnome.js
 prefs.js
Profile1Themes: extensions.sqlite corrupt or missing
Profile2IncompatibleExtensions: Default - {972ce4c6-7e08-4474-a285-3208198ce6fd}
Profile2PrefErrors: Unexpected character ',' before close parenthesis @ /usr/lib/firefox/omni.ja:greprefs.js:352
Profile2PrefSources:
 /usr/lib/firefox/defaults/pref/all-ubuntu-gnome.js
 prefs.js
Profiles:
 Profile2 - LastVersion=87.0/20210318103112
 Profile1 - LastVersion=87.0/20210318103112
 Profile0 (Default) - LastVersion=87.0/20210318103112 (In use)
RunningIncompatibleAddons: True
Tags: wayland-session hirsute
Uname: Linux 5.11.0-16-generic x86_64
UpgradeStatus: Upgraded to hirsute on 2021-04-21 (0 days ago)
UserGroups: adm admin cdrom dialout docker libvirt lpadmin lxd microk8s plugdev sambashare sudo
_MarkForUpload: True
dmi.bios.date: 03/21/2018
dmi.bios.release: 1.35
dmi.bios.vendor: LENOVO
dmi.bios.version: M1AKT35A
dmi.board.name: 3111
dmi.board.vendor: LENOVO
dmi.board.version: SDK0J40700 WIN 3258011708158
dmi.chassis.type: 3
dmi.chassis.vendor: LENOVO
dmi.chassis.version: None
dmi.ec.firmware.release: 1.9
dmi.modalias: dmi:bvnLENOVO:bvrM1AKT35A:bd03/21/2018:br1.35:efr1.9:svnLENOVO:pn10MRCTO1WW:pvrThinkCentreM710q:rvnLENOVO:rn3111:rvrSDK0J40700WIN3258011708158:cvnLENOVO:ct3:cvrNone:
dmi.product.family: ThinkCentre M710q
dmi.product.name: 10MRCTO1WW
dmi.product.sku: LENOVO_MT_10MR_BU_LENOVO_FM_ThinkCentre M710q
dmi.product.version: ThinkCentre M710q
dmi.sys.vendor: LENOVO
modified.conffile..etc.cron.daily.apport: [deleted]

Revision history for this message
Paul Collins (pjdc) wrote : AlsaInfo.txt

apport information

tags: added: apport-collected hirsute wayland-session
description: updated
Revision history for this message
Paul Collins (pjdc) wrote : AuditLog.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : DefaultProfileExtensions.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : DefaultProfilePrefs.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : DefaultProfileThemes.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : Dependencies.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : IfupdownConfig.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : IpAddr.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : IpRoute.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : KernLog.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : Lspci.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : PaInfo.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : PciNetwork.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : ProcEnviron.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : Profile1Prefs.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : Profile2Extensions.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : Profile2Prefs.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : Profile2Themes.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : PulseList.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote : RelatedPackageVersions.txt

apport information

Revision history for this message
Paul Collins (pjdc) wrote :

Possibly related:

[agnew(~)] journalctl -e --user | grep firefox | grep RequestName
Apr 22 09:34:20 agnew dbus-daemon[3337]: apparmor="DENIED" operation="dbus_method_call" bus="session" path="/org/freedesktop/DBus" interface="org.freedesktop.DBus" member="RequestName" mask="send" name="org.freedesktop.DBus" pid=54607 label="firefox" peer_label="unconfined"
Apr 22 10:02:52 agnew dbus-daemon[3337]: apparmor="DENIED" operation="dbus_method_call" bus="session" path="/org/freedesktop/DBus" interface="org.freedesktop.DBus" member="RequestName" mask="send" name="org.freedesktop.DBus" pid=58433 label="firefox" peer_label="unconfined"
[agnew(alacritty)] ps uf -C firefox
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
paul 54607 3.0 1.2 3473164 406708 ? Sl 09:34 4:02 /usr/lib/firefox/firefox
[agnew(~)] _

Revision history for this message
Paul Collins (pjdc) wrote :

I dropped the following into /etc/apparmor.d/local/usr.bin.firefox and after running `sudo apparmor_parser -r < /etc/apparmor.d/usr.bin.firefox` and restarting Firefox (so that it can bind to the name) it seems to work.

  dbus send
       bus=session
       path=/org/freedesktop/DBus
       interface=org.freedesktop.DBus
       member=RequestName
       peer=(name=org.freedesktop.DBus),

  dbus bind
       bus=session
       name=org.mozilla.firefox.*,

  dbus (send, receive)
       bus=session
       path=/org/mozilla/firefox/Remote
       interface=org.mozilla.firefox
       member=OpenURL
       peer=(label=firefox),

Revision history for this message
Olivier Tilloy (osomon) wrote :

Very good catch, thank you Paul!

Changed in firefox (Ubuntu):
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Olivier Tilloy (osomon)
Revision history for this message
Olivier Tilloy (osomon) wrote :
Changed in firefox (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package firefox - 88.0.1+build1-0ubuntu2

---------------
firefox (88.0.1+build1-0ubuntu2) impish; urgency=medium

  * Update a test expectation, following
    https://github.com/mozilla-partners/canonical/commit/9d38e19
    - debian/tests/search-engines

 -- Olivier Tilloy <email address hidden> Thu, 06 May 2021 12:38:08 +0200

Changed in firefox (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.