flathub / com.discordapp.Discord

https://flathub.org/apps/details/com.discordapp.Discord
126 stars 41 forks source link

Discord doesn't quit properly on Rocky Linux 9.4 #462

Closed guihkx closed 5 days ago

guihkx commented 5 days ago

Steps to reproduce:

  1. Run Discord in the terminal (flatpak run com.discordapp.Discord)
  2. Attempt to quit Discord (using the GUI)

After that, Discord will hang indefinitely, and we'll have to terminate it with Ctrl+C.

Doing that, however, causes the following output to show up in the terminal:

[6:1005/151212.286019:FATAL:bus.cc(1246)] D-Bus connection was disconnected. Aborting.
notificationScreen.webContentsSend: win is invalid undefined.
[6 preload-host-spawn-strategy] Dropping 0x3d6800108d80 (3) because of connection closed
blackbox: 2024-10-05T18:12:12.287Z 12 before-quit
[user@livecd ~]$ /app/bin/com.discordapp.Discord: line 27:     6 Trace/breakpoint trap   (core dumped) env TMPDIR=$XDG_CACHE_HOME zypak-wrapper /app/discord/Discord --enable-speech-dispatcher "${FLAGS[@]}" "$@"
/app/bin/com.discordapp.Discord: line 28: kill: (4) - No such process

Full log:

Show ``` $ flatpak run com.discordapp.Discord Disabling updates already done Discord 0.0.70 Gtk-Message: 15:11:51.110: Failed to load module "canberra-gtk-module" Gtk-Message: 15:11:51.110: Failed to load module "pk-gtk-module" Gtk-Message: 15:11:51.111: Failed to load module "canberra-gtk-module" Gtk-Message: 15:11:51.111: Failed to load module "pk-gtk-module" Starting app. Starting updater. 2024-10-05T18:11:51.193Z [Modules] Modules initializing 2024-10-05T18:11:51.193Z [Modules] Distribution: remote 2024-10-05T18:11:51.193Z [Modules] Host updates: disabled 2024-10-05T18:11:51.194Z [Modules] Module updates: enabled 2024-10-05T18:11:51.194Z [Modules] Module install path: /home/user/.var/app/com.discordapp.Discord/config/discord/0.0.70/modules 2024-10-05T18:11:51.194Z [Modules] Module installed file path: /home/user/.var/app/com.discordapp.Discord/config/discord/0.0.70/modules/installed.json 2024-10-05T18:11:51.194Z [Modules] Module download path: /home/user/.var/app/com.discordapp.Discord/config/discord/0.0.70/modules/pending splashScreen.initSplash(false) CDM component API found blackbox: 2024-10-05T18:11:51.335Z 0 ---------------------------------------------- CDM completed with status: cdm-ready-success blackbox: 2024-10-05T18:11:51.360Z 1 Discord starting: {"releaseChannel":"stable","version":"0.0.70"}, modulepath: /home/user/.var/app/com.discordapp.Discord/config/discord/0.0.70/modules blackbox: 2024-10-05T18:11:51.373Z 2 ✅ webContents.created web1 "index.html" blackbox: 2024-10-05T18:11:51.375Z 3 ✅ window.created win1 "discord" splashScreen: SPLASH_SCREEN_READY splashScreen.webContentsSend: SPLASH_SCREEN_QUOTE SPLASH_SCREEN_QUOTE [ 'Hold Tight — Loading Discord' ] 2024-10-05T18:11:51.527Z [Modules] No updates to install splashScreen: no-pending-updates 2024-10-05T18:11:51.528Z [Modules] Host is up to date. 2024-10-05T18:11:51.528Z [Modules] Checking for module updates at https://discord.com/api/modules/stable/versions.json splashScreen: checking-for-updates splashScreen.updateSplashState checking-for-updates checking-for-updates {} splashScreen.webContentsSend: SPLASH_UPDATE_STATE SPLASH_UPDATE_STATE [ { status: 'checking-for-updates' } ] blackbox: 2024-10-05T18:11:51.625Z 4 ✅ webContents.did-finish-load web1 2024-10-05T18:11:51.781Z [Modules] No module updates available. splashScreen: update-check-finished true 0 false splashScreen.launchMainWindow: false Optional module ./ElectronTestRpc was not included. splashScreen.updateSplashState launching launching {} splashScreen.webContentsSend: SPLASH_UPDATE_STATE SPLASH_UPDATE_STATE [ { status: 'launching' } ] blackbox: 2024-10-05T18:11:51.878Z 5 ✅ webContents.created web2 "" blackbox: 2024-10-05T18:11:51.915Z 6 ✅ window.created win2 "Discord" legacyModuleUpdater: installed-module discord_krisp 1 1 true legacyModuleUpdater: installed-module discord_game_utils 1 1 true mainScreen.UpdaterEvents: UPDATER_HISTORY_QUERY_AND_TRUNCATE mainScreen.on(did-finish-load) false false blackbox: 2024-10-05T18:11:54.826Z 7 ✅ webContents.did-finish-load web2 splashScreen.pageReady [57:1005/151154.872793:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times! [57:1005/151154.877971:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times! blackbox: 2024-10-05T18:11:54.940Z 8 window.close win1 blackbox: 2024-10-05T18:11:54.995Z 9 webContents.destroyed web1 blackbox: 2024-10-05T18:11:55.013Z 10 window.closed win1 mainScreen.UpdaterEvents: UPDATER_HISTORY_QUERY_AND_TRUNCATE mainScreen.UpdaterEvents: UPDATER_HISTORY_QUERY_AND_TRUNCATE mainScreen.UpdaterEvents: CHECK_FOR_UPDATES UPDATE_NOT_AVAILABLE 2024-10-05T18:11:55.507Z [Modules] Host is up to date. 2024-10-05T18:11:55.507Z [Modules] Checking for module updates at https://discord.com/api/modules/stable/versions.json 2024-10-05T18:11:55.513Z [Modules] No module updates available. legacyModuleUpdater: update-check-finished legacyModuleUpdater: installed-module discord_rpc 1 1 true mainScreen.UpdaterEvents: UPDATER_HISTORY_QUERY_AND_TRUNCATE [57:1005/151157.984739:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times! blackbox: 2024-10-05T18:12:05.984Z 11 window.close win2 ^C [6:1005/151212.286019:FATAL:bus.cc(1246)] D-Bus connection was disconnected. Aborting. notificationScreen.webContentsSend: win is invalid undefined. [6 preload-host-spawn-strategy] Dropping 0x3d6800108d80 (3) because of connection closed blackbox: 2024-10-05T18:12:12.287Z 12 before-quit [user@livecd ~]$ /app/bin/com.discordapp.Discord: line 27: 6 Trace/breakpoint trap (core dumped) env TMPDIR=$XDG_CACHE_HOME zypak-wrapper /app/discord/Discord --enable-speech-dispatcher "${FLAGS[@]}" "$@" /app/bin/com.discordapp.Discord: line 28: kill: (4) - No such process ```

TODO:

Check if this also reproduces outside Flatpak. If it does, report it upstream instead.

System info

Desktop environment: GNOME 40.4.0 (Wayland)

/etc/os-release:

NAME="Rocky Linux"
VERSION="9.4 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.4"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.4 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.4"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.4"
guihkx commented 5 days ago

Got it.

By default, Discord just assumes a system tray (or app indicator) exists, and so by default its "Quit" action just hides Discord to the system tray.

But because such concept doesn't exist anymore on GNOME (a GNOME Shell extension is usually installed for that), Discord appears to hang when exiting...

Luckily, there's an option in Discord's settings so we can disable this behavior: Settings (little cog wheel) > Linux Settings > Minimize to tray (uncheck it).

That option is only accessible once we log in, however. So another option is to edit ~/.var/app/com.discordapp.Discord/config/discord/settings.json manually, and set/add the MINIMIZE_TO_TRAY option to true, i.e.:

{
  "MINIMIZE_TO_TRAY": false,
  "SKIP_HOST_UPDATE": true
}

The reason why zypak crashes when issued Ctrl+C is still unclear to me, but that's a separate issue...