Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux Snap desktop app crashes and then won't launch #2577

Closed
a-meet opened this issue Oct 24, 2023 · 10 comments
Closed

Linux Snap desktop app crashes and then won't launch #2577

a-meet opened this issue Oct 24, 2023 · 10 comments
Labels
Fixed Internally Issue has been fixed, but fix has not yet been released

Comments

@a-meet
Copy link

a-meet commented Oct 24, 2023

Lately, I've been having a problem where the Linux desktop app will crash. Not sure exactly what triggers it but it is usually after sending or receiving a message (i.e., it doesn't seem to just happen out of nowhere when there is no activity). Then, when I try to relaunch, it will immediately crash again, and the only way I can seem to get it to launch again is by removing the app via snap and reinstalling/reconfiguring the app. Below is the information I get when launching it from a terminal that seems most relevant, leading right up to the crash (there are a bunch of debug messages that precede this that I left out, since they include phone numbers, etc., and hopefully aren't related to the problem). Running on Ubuntu 23.04. The Android app seems to work fine, and I don't see any errors on my Mac (Ventura) desktop with BlueBubbles 1.80.

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.13892" (uid=1000 pid=36107 comm="/snap/bluebubbles/27/bin/bluebubbles" label="snap.bluebubbles.bluebubbles (enforce)") interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" error name="(unset)" requested_reply="0" destination="org.freedesktop.NetworkManager" (uid=0 pid=912 comm="/usr/sbin/NetworkManager --no-daemon" label="unconfined")
#0 DBusClient._callMethod (package:dbus/src/dbus_client.dart:1124)

#1 DBusClient.callMethod (package:dbus/src/dbus_client.dart:608)

#2 DBusRemoteObjectManager.getManagedObjects (package:dbus/src/dbus_remote_object_manager.dart:80)

#3 NetworkManagerClient.connect (package:nm/src/network_manager_client.dart:2351)

#4 ConnectivityPlusLinuxPlugin.checkConnectivity (package:connectivity_plus/src/connectivity_plus_linux.dart:24)

#5 NetworkTasks.detectLocalhost (package:bluebubbles/helpers/network/network_tasks.dart:52)

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.13893" (uid=1000 pid=36107 comm="/snap/bluebubbles/27/bin/bluebubbles" label="snap.bluebubbles.bluebubbles (enforce)") interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" error name="(unset)" requested_reply="0" destination="org.freedesktop.NetworkManager" (uid=0 pid=912 comm="/usr/sbin/NetworkManager --no-daemon" label="unconfined")
#0 DBusClient._callMethod (package:dbus/src/dbus_client.dart:1124)

#1 DBusClient.callMethod (package:dbus/src/dbus_client.dart:608)

#2 DBusRemoteObjectManager.getManagedObjects (package:dbus/src/dbus_remote_object_manager.dart:80)

#3 NetworkManagerClient.connect (package:nm/src/network_manager_client.dart:2351)

#4 ConnectivityPlusLinuxPlugin._startListenConnectivity (package:connectivity_plus/src/connectivity_plus_linux.dart:64)

ALSA lib conf.c:4553:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
media_kit: VideoOutput: video_output_new: 139914398444400
Cannot load libcuda.so.1
media_kit: VideoOutput: Using H/W rendering.
Segmentation fault (core dumped)

@silijon
Copy link

silijon commented Nov 5, 2023

I have the same issue with 1.12.4.0 running out of a snap on ubuntu. Seems to have broken after the latest update. I've got 1.12.2.1 running on debian with flatpak and that still works great. A little afraid to upgrade that now though.

@jjoelj
Copy link
Member

jjoelj commented Nov 5, 2023

This issue is not present on the flatpak afaik. I have not had time to figure out what the issue with the snap is, though.

@silijon
Copy link

silijon commented Nov 6, 2023

fwiw I uninstalled the snap and installed it on the same machine via flatpak and it works fine for me too doing that. Seems likely a problem with the snap.

@a-meet
Copy link
Author

a-meet commented Nov 7, 2023

I asked on the Discord and someone suggested trying one of the non-snap installation methods as well. I've been running with the flatpak version on Ubuntu like some of the people above and it seems to be fine so far for me, too.

@jjoelj jjoelj changed the title Linux desktop app crashes and then won't launch Linux Snap desktop app crashes and then won't launch Nov 8, 2023
@jjoelj
Copy link
Member

jjoelj commented Nov 8, 2023

@jdn3343
Copy link

jdn3343 commented Nov 11, 2023

I'm having this problem too. What I'm noticing is every time I receive a video and open the conversation to view it, it crashes. I have to remove --purge bluebubbles and try again. But it will continue to crash if there are more videos present.

OS: Ubuntu Desktop 23.10.1 (also tested and happens on 22.04)
BlueBubbles v1.12.4.0

In case it helps, I found this in journalctl right after it crashed:

`Nov 10 16:37:16 jdn3343 gnome-shell[121246]: JS ERROR: 76df6e00-802a-11ee-8d84-bd5f508c5ae8 unable to update icon: TypeError: oldIcon.equals is not a function
add@file:///usr/share/gnome-shell/extensions/[email protected]/iconCache.js:52:34
_cacheOrCreateIconByName@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:1074:37
async*_createIcon@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:1440:38
_createAndSetIcon@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:1400:32
_updateIconByType@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:1392:24
_updateIcon@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:1469:24
_invalidateIcon@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:1524:14
_invalidateIconWhenFullyReady@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:1507:18
async*_init/<@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:915:24
_callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
reset@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:698:14
_ensureItemRegistered@file:///usr/share/gnome-shell/extensions/[email protected]/statusNotifierWatcher.js:136:18
RegisterStatusNotifierItemAsync@file:///usr/share/gnome-shell/extensions/[email protected]/statusNotifierWatcher.js:205:24
_handleMethodCall@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:373:35
_wrapJSObject/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:408:34
@resource:///org/gnome/shell/ui/init.js:21:20

Nov 10 16:37:16 jdn3343 systemd[2172]: snap.bluebubbles.bluebubbles-90c38f66-d716-402d-81b5-289df3b98f9d.scope: Consumed 1.065s CPU time.`

@a-meet
Copy link
Author

a-meet commented Nov 21, 2023

I'm having this problem too. What I'm noticing is every time I receive a video and open the conversation to view it, it crashes. I have to remove --purge bluebubbles and try again. But it will continue to crash if there are more videos present.

OS: Ubuntu Desktop 23.10.1 (also tested and happens on 22.04) BlueBubbles v1.12.4.0

In case it helps, I found this in journalctl right after it crashed:

`Nov 10 16:37:16 jdn3343 gnome-shell[121246]: JS ERROR: 76df6e00-802a-11ee-8d84-bd5f508c5ae8 unable to update icon: TypeError: oldIcon.equals is not a function add@file:///usr/share/gnome-shell/extensions/[email protected]/iconCache.js:52:34 _cacheOrCreateIconByName@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:1074:37 async*_createIcon@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:1440:38 _createAndSetIcon@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:1400:32 _updateIconByType@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:1392:24 _updateIcon@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:1469:24 _invalidateIcon@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:1524:14 _invalidateIconWhenFullyReady@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:1507:18 async*_init/<@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:915:24 _callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42 _emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10 reset@file:///usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:698:14 _ensureItemRegistered@file:///usr/share/gnome-shell/extensions/[email protected]/statusNotifierWatcher.js:136:18 RegisterStatusNotifierItemAsync@file:///usr/share/gnome-shell/extensions/[email protected]/statusNotifierWatcher.js:205:24 _handleMethodCall@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:373:35 _wrapJSObject/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:408:34 @resource:///org/gnome/shell/ui/init.js:21:20

Nov 10 16:37:16 jdn3343 systemd[2172]: snap.bluebubbles.bluebubbles-90c38f66-d716-402d-81b5-289df3b98f9d.scope: Consumed 1.065s CPU time.`

Messages with videos attached seemed to be a trigger for me, too, and I have the same setup as you. Using the flatpak version as some here suggested has been stable for me.

@jdn3343
Copy link

jdn3343 commented Nov 21, 2023

I'm having this problem too. What I'm noticing is every time I receive a video and open the conversation to view it, it crashes. I have to remove --purge bluebubbles and try again. But it will continue to crash if there are more videos present.
OS: Ubuntu Desktop 23.10.1 (also tested and happens on 22.04) BlueBubbles v1.12.4.0
In case it helps, I found this in journalctl right after it crashed:
Nov 10 16:37:16 jdn3343 gnome-shell[121246]: JS ERROR: 76df6e00-802a-11ee-8d84-bd5f508c5ae8 unable to update icon: TypeError: oldIcon.equals is not a function add@file:///usr/share/gnome-shell/extensions/[[email protected]](mailto:[email protected])/iconCache.js:52:34 _cacheOrCreateIconByName@file:///usr/share/gnome-shell/extensions/[[email protected]](mailto:[email protected])/appIndicator.js:1074:37 async*_createIcon@file:///usr/share/gnome-shell/extensions/[[email protected]](mailto:[email protected])/appIndicator.js:1440:38 _createAndSetIcon@file:///usr/share/gnome-shell/extensions/[[email protected]](mailto:[email protected])/appIndicator.js:1400:32 _updateIconByType@file:///usr/share/gnome-shell/extensions/[[email protected]](mailto:[email protected])/appIndicator.js:1392:24 _updateIcon@file:///usr/share/gnome-shell/extensions/[[email protected]](mailto:[email protected])/appIndicator.js:1469:24 _invalidateIcon@file:///usr/share/gnome-shell/extensions/[[email protected]](mailto:[email protected])/appIndicator.js:1524:14 _invalidateIconWhenFullyReady@file:///usr/share/gnome-shell/extensions/[[email protected]](mailto:[email protected])/appIndicator.js:1507:18 async*_init/<@file:///usr/share/gnome-shell/extensions/[[email protected]](mailto:[email protected])/appIndicator.js:915:24 _callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42 _emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10 reset@file:///usr/share/gnome-shell/extensions/[[email protected]](mailto:[email protected])/appIndicator.js:698:14 _ensureItemRegistered@file:///usr/share/gnome-shell/extensions/[[email protected]](mailto:[email protected])/statusNotifierWatcher.js:136:18 RegisterStatusNotifierItemAsync@file:///usr/share/gnome-shell/extensions/[[email protected]](mailto:[email protected])/statusNotifierWatcher.js:205:24 _handleMethodCall@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:373:35 _wrapJSObject/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:408:34 @resource:///org/gnome/shell/ui/init.js:21:20 Nov 10 16:37:16 jdn3343 systemd[2172]: snap.bluebubbles.bluebubbles-90c38f66-d716-402d-81b5-289df3b98f9d.scope: Consumed 1.065s CPU time.

Messages with videos attached seemed to be a trigger for me, too, and I have the same setup as you. Using the flatpak version as some here suggested has been stable for me.

I'm glad the flatpak version works better. It hasn't crashed due to media issues but it does seem to have a major memory leak issue 😂, for me at least. After it filled up swap and 16G memory, computer of course crashed.
Thankfully, there is a doable systemd solution by specifying resource limits.
Interestingly, the app has not crashed once with the configuration below.

If anyone has trouble with that, take a look here for systemd flatpak/flatpak#3439 (credits and sincere thanks)
and https://www.freedesktop.org/software/systemd/man/latest/systemd.resource-control.html

In case it saves somebody time...
Basically, you find the scope name of bluebubbles with something like systemctl --user.
Press "/" and search for bluebubbles. As of now, the name is app-flatpak-app.bluebubbles.BlueBubbles-<####>.scope
Note the PID number so you can check if your parameters applied correctly with the modification.
Now create an override file to forcibly apply parameters to the general scope of the app (without the PID number).
systemctl --user --force edit app-flatpak-app.bluebubbles.BlueBubbles-.scope
A text editor opens and you can add settings there.
All I had to add was:
[Scope]
MemoryMax=300M

Save and quit.

You can check if that worked out with systemctl --user status app-flatpak-app.bluebubbles.BlueBubbles-<####>.scope

You should see something like `Memory: 97.0M (max: 300.0M available: 202.9M)

The app seems to figure itself out without crashing and, more importantly, crippling the computer.
Good luck!

@jjoelj
Copy link
Member

jjoelj commented Nov 22, 2023

I looked into the snap issues and was unable to find a fix. There are also issues because of strict confinement for things like the webview for Google login not working. I'll have to investigate if these issues can be resolved by switching to classic confinement.

And @jdn3343 I'm fairly certain the memory issues are fixed internally, but could you open a separate github ticket to track that.

@jjoelj
Copy link
Member

jjoelj commented Nov 28, 2023

For now I'm going to fix this by removing the in-app video playback functionality if the app detects it is running as a snap. The videos can be opened with the system video viewer. Sign in with Google on the snap client will also be disabled because communication between a webview window and a snap doesn't seem to work in strict confinement. However, after manually entering the url/password, the firebase configuration will still be fetched and everything will work normally.

To avoid these inconveniences, please switch to the flatpak version. These drawbacks will be mentioned in the snap store listing beginning with the 1.12.5 release.

Relevant commit: 5f1031b

@jjoelj jjoelj added the Fixed Internally Issue has been fixed, but fix has not yet been released label Nov 28, 2023
@tneotia tneotia closed this as completed Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed Internally Issue has been fixed, but fix has not yet been released
Projects
None yet
Development

No branches or pull requests

5 participants