Bitwarden won't launch on KDE Neon

I’m having issues launching Bitwarden on my desktop running on KDE Neon 20.04. It only runs once, but after that it fails.

$ snap run --trace-exec bitwarden
Gtk-Message: 04:18:11.242: Failed to load module "colorreload-gtk-module"
Gtk-Message: 04:18:11.243: Failed to load module "window-decorations-gtk-module"
Gtk-Message: 04:18:11.244: Failed to load module "appmenu-gtk-module"
Error org.freedesktop.DBus.Error.Failed: cannot set "default-url-scheme-handler" setting to invalid value "bitwarden"
** Message: 04:18:17.565: Remote error from secret service: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.secrets was not provided by any .service files
(node:72947) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'setContextMenu' of undefined
    at tray_main_TrayMain.updateContextMenu (/snap/bitwarden/40/resources/app.asar/main.js:19231:23)
    at messaging_main_MessagingMain.updateTrayMenu (/snap/bitwarden/40/resources/app.asar/main.js:18762:28)
    at messaging_main_MessagingMain.onMessage (/snap/bitwarden/40/resources/app.asar/main.js:18703:22)
    at messaging_main_MessagingMain.<anonymous> (/snap/bitwarden/40/resources/app.asar/main.js:18694:154)
    at Generator.next (<anonymous>)
    at /snap/bitwarden/40/resources/app.asar/main.js:18672:71
    at new Promise (<anonymous>)
    at messaging_main_awaiter (/snap/bitwarden/40/resources/app.asar/main.js:18668:12)
    at EventEmitter.<anonymous> (/snap/bitwarden/40/resources/app.asar/main.js:18694:82)
    at EventEmitter.emit (events.js:200:13)
(node:72947) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'setContextMenu' of undefined
    at tray_main_TrayMain.updateContextMenu (/snap/bitwarden/40/resources/app.asar/main.js:19231:23)
    at messaging_main_MessagingMain.updateTrayMenu (/snap/bitwarden/40/resources/app.asar/main.js:18762:28)
    at messaging_main_MessagingMain.onMessage (/snap/bitwarden/40/resources/app.asar/main.js:18703:22)
    at messaging_main_MessagingMain.<anonymous> (/snap/bitwarden/40/resources/app.asar/main.js:18694:154)
    at Generator.next (<anonymous>)
    at /snap/bitwarden/40/resources/app.asar/main.js:18672:71
    at new Promise (<anonymous>)
    at messaging_main_awaiter (/snap/bitwarden/40/resources/app.asar/main.js:18668:12)
    at EventEmitter.<anonymous> (/snap/bitwarden/40/resources/app.asar/main.js:18694:82)
    at EventEmitter.emit (events.js:200:13)
(node:72947) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:72947) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:72947) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:72947) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:72947) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'setContextMenu' of undefined
    at tray_main_TrayMain.updateContextMenu (/snap/bitwarden/40/resources/app.asar/main.js:19231:23)
    at messaging_main_MessagingMain.updateTrayMenu (/snap/bitwarden/40/resources/app.asar/main.js:18762:28)
    at messaging_main_MessagingMain.onMessage (/snap/bitwarden/40/resources/app.asar/main.js:18703:22)
    at messaging_main_MessagingMain.<anonymous> (/snap/bitwarden/40/resources/app.asar/main.js:18694:154)
    at Generator.next (<anonymous>)
    at /snap/bitwarden/40/resources/app.asar/main.js:18672:71
    at new Promise (<anonymous>)
    at messaging_main_awaiter (/snap/bitwarden/40/resources/app.asar/main.js:18668:12)
    at EventEmitter.<anonymous> (/snap/bitwarden/40/resources/app.asar/main.js:18694:82)
    at EventEmitter.emit (events.js:200:13)
(node:72947) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'setContextMenu' of undefined
    at tray_main_TrayMain.updateContextMenu (/snap/bitwarden/40/resources/app.asar/main.js:19231:23)
    at messaging_main_MessagingMain.updateTrayMenu (/snap/bitwarden/40/resources/app.asar/main.js:18762:28)
    at messaging_main_MessagingMain.onMessage (/snap/bitwarden/40/resources/app.asar/main.js:18703:22)
    at messaging_main_MessagingMain.<anonymous> (/snap/bitwarden/40/resources/app.asar/main.js:18694:154)
    at Generator.next (<anonymous>)
    at /snap/bitwarden/40/resources/app.asar/main.js:18672:71
    at new Promise (<anonymous>)
    at messaging_main_awaiter (/snap/bitwarden/40/resources/app.asar/main.js:18668:12)
    at EventEmitter.<anonymous> (/snap/bitwarden/40/resources/app.asar/main.js:18694:82)
    at EventEmitter.emit (events.js:200:13)
(node:72947) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:72947) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
[04:18:44.109] [info] search indexing: 3.9442143ms
Slowest 10 exec calls during snap run:
  0.105s snap-update-ns
  0.333s /snap/snapd/10707/usr/lib/snapd/snap-confine
  0.063s /snap/bitwarden/40/gnome-platform/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders
  0.058s /snap/bitwarden/40/gnome-platform/usr/bin/gtk-update-icon-cache
  0.065s /snap/bitwarden/40/gnome-platform/usr/sbin/update-icon-caches
  1.244s /snap/bitwarden/40/desktop-common.sh
  0.056s /snap/bitwarden/40/gnome-platform/usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0
  0.093s /snap/bitwarden/40/desktop-gnome-specific.sh
  38.610s /proc/self/exe
  42.176s /snap/bitwarden/40/bitwarden
Total time: 43.920s

After exiting it, here’s the output when I try to launch again:

$ snap run --trace-exec bitwarden
Slowest 10 exec calls during snap run:
  0.083s /snap/snapd/10707/usr/lib/snapd/snap-confine
  0.014s /snap/bitwarden/40/desktop-init.sh
  0.011s /bin/mkdir
  0.008s /usr/bin/head
  0.007s /usr/bin/head
  0.014s /usr/bin/head
  0.017s /usr/bin/head
  0.008s /usr/bin/head
  0.008s /usr/bin/head
  0.023s /bin/mv
Total time: 0.284s
error: exit status 1

Just wanna bump this because I’m still having issues.

Bitwarden support didn’t help much because they said things were fine on their end when they setup a clean KDE Neon system.

Any system journal denials when you do this? journalctl --no-pager -b0 | grep DENIED

Just this:

$ journalctl --no-pager -b0 | grep DENIED
Jun 22 23:23:51 Y4M1-MS-7978 audit[1868]: AVC apparmor="DENIED" operation="capable" profile="/usr/sbin/cups-browsed" pid=1868 comm="cups-browsed" capability=23  capname="sys_nice"
Jun 22 23:23:57 Y4M1-MS-7978 audit[4297]: AVC apparmor="DENIED" operation="ptrace" profile="snap.docker.dockerd" pid=4297 comm="ps" requested_mask="read" denied_mask="read" peer="/usr/sbin/cupsd"
Jun 22 23:23:57 Y4M1-MS-7978 kernel: audit: type=1400 audit(1624418637.629:192): apparmor="DENIED" operation="ptrace" profile="snap.docker.dockerd" pid=4297 comm="ps" requested_mask="read" denied_mask="read" peer="/usr/sbin/cupsd"
Jun 22 23:23:57 Y4M1-MS-7978 audit[4297]: AVC apparmor="DENIED" operation="ptrace" profile="snap.docker.dockerd" pid=4297 comm="ps" requested_mask="read" denied_mask="read" peer="/usr/sbin/cups-browsed"
Jun 22 23:23:57 Y4M1-MS-7978 audit[4297]: AVC apparmor="DENIED" operation="ptrace" profile="snap.docker.dockerd" pid=4297 comm="ps" requested_mask="read" denied_mask="read" peer="system_tor"
Jun 22 23:23:57 Y4M1-MS-7978 kernel: audit: type=1400 audit(1624418637.633:193): apparmor="DENIED" operation="ptrace" profile="snap.docker.dockerd" pid=4297 comm="ps" requested_mask="read" denied_mask="read" peer="/usr/sbin/cups-browsed"
Jun 22 23:23:57 Y4M1-MS-7978 kernel: audit: type=1400 audit(1624418637.633:194): apparmor="DENIED" operation="ptrace" profile="snap.docker.dockerd" pid=4297 comm="ps" requested_mask="read" denied_mask="read" peer="system_tor"
Jun 22 23:25:27 Y4M1-MS-7978 audit[5733]: AVC apparmor="DENIED" operation="capable" profile="/snap/snapd/12159/usr/lib/snapd/snap-confine" pid=5733 comm="snap-confine" capability=4  capname="fsetid"
Jun 22 23:25:27 Y4M1-MS-7978 kernel: audit: type=1400 audit(1624418727.520:221): apparmor="DENIED" operation="capable" profile="/snap/snapd/12159/usr/lib/snapd/snap-confine" pid=5733 comm="snap-confine" capability=4  capname="fsetid"
Jun 22 23:25:28 Y4M1-MS-7978 audit[5923]: AVC apparmor="DENIED" operation="capable" profile="/snap/snapd/12159/usr/lib/snapd/snap-confine" pid=5923 comm="snap-confine" capability=4  capname="fsetid"
Jun 22 23:25:28 Y4M1-MS-7978 kernel: audit: type=1400 audit(1624418728.064:222): apparmor="DENIED" operation="capable" profile="/snap/snapd/12159/usr/lib/snapd/snap-confine" pid=5923 comm="snap-confine" capability=4  capname="fsetid"
Jun 22 23:25:34 Y4M1-MS-7978 audit[1679]: USER_AVC pid=1679 uid=103 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/" interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" mask="send" name="org.bluez" pid=5923 label="snap.discord.discord" peer_pid=1673 peer_label="unconfined"
Jun 22 23:25:34 Y4M1-MS-7978 kernel: audit: type=1107 audit(1624418734.380:223): pid=1679 uid=103 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/" interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" mask="send" name="org.bluez" pid=5923 label="snap.discord.discord" peer_pid=1673 peer_label="unconfined"
Jun 22 23:25:37 Y4M1-MS-7978 audit[6378]: AVC apparmor="DENIED" operation="ptrace" profile="snap.skype.skype" pid=6378 comm="skypeforlinux" requested_mask="read" denied_mask="read" peer="unconfined"
Jun 22 23:25:37 Y4M1-MS-7978 kernel: audit: type=1400 audit(1624418737.176:224): apparmor="DENIED" operation="ptrace" profile="snap.skype.skype" pid=6378 comm="skypeforlinux" requested_mask="read" denied_mask="read" peer="unconfined"
Jun 22 23:25:37 Y4M1-MS-7978 dbus-daemon[5466]: apparmor="DENIED" operation="dbus_method_call"  bus="session" path="/org/freedesktop/PowerManagement/Inhibit" interface="org.freedesktop.PowerManagement.Inhibit" member="Inhibit" mask="send" name="org.freedesktop.PowerManagement" pid=5923 label="snap.discord.discord" peer_pid=5663 peer_label="unconfined"
Jun 22 23:25:37 Y4M1-MS-7978 audit[1679]: USER_AVC pid=1679 uid=103 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.login1.Manager" member="Inhibit" mask="send" name="org.freedesktop.login1" pid=5923 label="snap.discord.discord" peer_pid=1731 peer_label="unconfined"
Jun 22 23:25:37 Y4M1-MS-7978 kernel: audit: type=1107 audit(1624418737.972:225): pid=1679 uid=103 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.login1.Manager" member="Inhibit" mask="send" name="org.freedesktop.login1" pid=5923 label="snap.discord.discord" peer_pid=1731 peer_label="unconfined"
Jun 22 23:25:38 Y4M1-MS-7978 audit[1679]: USER_AVC pid=1679 uid=103 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/" interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" mask="send" name="org.bluez" pid=6378 label="snap.skype.skype" peer_pid=1673 peer_label="unconfined"
Jun 22 23:25:38 Y4M1-MS-7978 kernel: audit: type=1107 audit(1624418738.208:226): pid=1679 uid=103 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/" interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" mask="send" name="org.bluez" pid=6378 label="snap.skype.skype" peer_pid=1673 peer_label="unconfined"
Jun 22 23:25:42 Y4M1-MS-7978 audit[1679]: USER_AVC pid=1679 uid=103 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.login1.Manager" member="Inhibit" mask="send" name="org.freedesktop.login1" pid=6378 label="snap.skype.skype" peer_pid=1731 peer_label="unconfined"
Jun 22 23:25:42 Y4M1-MS-7978 kernel: audit: type=1107 audit(1624418742.136:227): pid=1679 uid=103 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.login1.Manager" member="Inhibit" mask="send" name="org.freedesktop.login1" pid=6378 label="snap.skype.skype" peer_pid=1731 peer_label="unconfined"
Jun 22 23:25:42 Y4M1-MS-7978 audit[1679]: USER_AVC pid=1679 uid=103 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.login1.Manager" member="Inhibit" mask="send" name="org.freedesktop.login1" pid=6378 label="snap.skype.skype" peer_pid=1731 peer_label="unconfined"
Jun 22 23:25:42 Y4M1-MS-7978 kernel: audit: type=1107 audit(1624418742.164:228): pid=1679 uid=103 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.login1.Manager" member="Inhibit" mask="send" name="org.freedesktop.login1" pid=6378 label="snap.skype.skype" peer_pid=1731 peer_label="unconfined"
Jun 22 23:25:43 Y4M1-MS-7978 audit[5923]: AVC apparmor="DENIED" operation="open" profile="snap.discord.discord" name="/proc/6663/clear_refs" pid=5923 comm="MemoryInfra" requested_mask="w" denied_mask="w" fsuid=1000 ouid=1000
Jun 22 23:25:43 Y4M1-MS-7978 kernel: audit: type=1400 audit(1624418743.224:229): apparmor="DENIED" operation="open" profile="snap.discord.discord" name="/proc/6663/clear_refs" pid=5923 comm="MemoryInfra" requested_mask="w" denied_mask="w" fsuid=1000 ouid=1000
Jun 22 23:25:44 Y4M1-MS-7978 audit[6741]: AVC apparmor="DENIED" operation="open" profile="snap.skype.skype" name="/sys/devices/virtual/dmi/id/board_vendor" pid=6741 comm="skypeforlinux" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Jun 22 23:25:44 Y4M1-MS-7978 kernel: audit: type=1400 audit(1624418744.436:230): apparmor="DENIED" operation="open" profile="snap.skype.skype" name="/sys/devices/virtual/dmi/id/board_vendor" pid=6741 comm="skypeforlinux" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Jun 22 23:25:44 Y4M1-MS-7978 dbus-daemon[5466]: apparmor="DENIED" operation="dbus_method_call"  bus="session" path="/org/freedesktop/PowerManagement/Inhibit" interface="org.freedesktop.PowerManagement.Inhibit" member="Inhibit" mask="send" name="org.freedesktop.PowerManagement" pid=5923 label="snap.discord.discord" peer_pid=5663 peer_label="unconfined"
Jun 23 00:00:03 Y4M1-MS-7978 audit[17524]: AVC apparmor="DENIED" operation="capable" profile="/usr/sbin/cups-browsed" pid=17524 comm="cups-browsed" capability=23  capname="sys_nice"
Jun 23 00:00:03 Y4M1-MS-7978 kernel: audit: type=1400 audit(1624420803.488:231): apparmor="DENIED" operation="capable" profile="/usr/sbin/cups-browsed" pid=17524 comm="cups-browsed" capability=23  capname="sys_nice"

No mention of Bitwarden

If you remove the snap with snap remove bitwarden, then re-install it, and before launching it do snap save bitwarden and then launch it does it work? If it works the first time again but doesn’t work the second time same as you currently are seeing, does it work if you do snap restore <id-from-save-cmd-above> ?

Sorry for the late reply. And no. Doesn’t work.

how about:

I tested on a newly installed Kubuntu on T510, and that actually seems to be the case. What’s causing this issue to happen? I mean, I get the why, but not the reason why.

it is likely that apparmor can simply not follow the symlink and apply ACLs to the target location

It seems that disconnecting bitwarden:home will allow the app to launch.

Just can’t help but wonder if there’ll be downsides, but I guess I’ll update this post if I find something.