Discord closes after few seconds

Good evening! I’m having some issues here that are way over my skills, maybe we can tackle this together and I may learn something in the process…

Discord from Flatpack stopped working on August 13th. It was fine until then.
I was in a voice chat while playing Cities skylines. I did download some mods to the game from steam workshop. One mod needed mono-devel packege to be installed, so I did that and everything was still fine after that. Some time later I noticed that sound stopped working so I quit the game and saw that discord app is no longer open.

When I run it, it will open and work for a few seconds before quitting.
-I removed the mono-devel package ran dnf autoremove → same thing.
-Reverted to a two day old system restore point using timeshift rsync → same thing.
-Removed and reinstalled discord flatpack → same thing.
-Installed Armcord → same thing, but it shows a crash message.
-Tried to log into a X11 session to test if it made any difference, but as I do so my screen says no signal and goes to sleep.

My system specs:
Operating System: Fedora Linux 38
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Kernel Version: 6.5.6-200.fc38.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen 9 7950X 16-Core Processor
Memory: 30.5 GiB of RAM
Graphics Processor: AMD Radeon RX 6900 XT
Manufacturer: ASUS

Here is journald log output when running discord:

15.10.2023 22.48	plasmashell	QString::arg: 2 argument(s) missing in com.discordapp.Discord
15.10.2023 22.48	systemd	Started app-com.discordapp.Discord-f4358f99074946739db1ad9abc619c08.scope - Discord - Internet Messenger.
15.10.2023 22.48	systemd	Started app-flatpak-com.discordapp.Discord-7640.scope.
15.10.2023 22.48	plasmashell	2023/10/15 22:48:19 socat[3] E "/run/user/1000/app/com.discordapp.Discord/discord-ipc-0" exists
15.10.2023 22.48	plasmashell	Disabling updates already done
15.10.2023 22.48	systemd	Starting flatpak-portal.service - flatpak portal...
15.10.2023 22.48	systemd	Started flatpak-portal.service - flatpak portal.
15.10.2023 22.48	systemd	Started app-flatpak-com.discordapp.Discord-7675.scope.
15.10.2023 22.48	plasmashell	Discord 0.0.31
15.10.2023 22.48	plasmashell	[5:1015/224820.026601:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: Tiedostoa tai hakemistoa ei ole
15.10.2023 22.48	plasmashell	[5:1015/224820.026651:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: Tiedostoa tai hakemistoa ei ole
15.10.2023 22.48	plasmashell	Starting app.
15.10.2023 22.48	plasmashell	Starting updater.
15.10.2023 22.48	plasmashell	2023-10-15T19:48:20.041Z [Modules] Modules initializing
15.10.2023 22.48	plasmashell	2023-10-15T19:48:20.041Z [Modules] Distribution: remote
15.10.2023 22.48	plasmashell	2023-10-15T19:48:20.041Z [Modules] Host updates: disabled
15.10.2023 22.48	plasmashell	2023-10-15T19:48:20.041Z [Modules] Module updates: enabled
15.10.2023 22.48	plasmashell	2023-10-15T19:48:20.042Z [Modules] Module install path: /home/jani/.var/app/com.discordapp.Discord/config/discord/0.0.31/modules
15.10.2023 22.48	plasmashell	2023-10-15T19:48:20.042Z [Modules] Module installed file path: /home/jani/.var/app/com.discordapp.Discord/config/discord/0.0.31/modules/installed.json
15.10.2023 22.48	plasmashell	2023-10-15T19:48:20.042Z [Modules] Module download path: /home/jani/.var/app/com.discordapp.Discord/config/discord/0.0.31/modules/pending
15.10.2023 22.48	plasmashell	splashScreen.initSplash(false)
15.10.2023 22.48	plasmashell	blackbox: 2023-10-15T19:48:20.051Z 0
15.10.2023 22.48	plasmashell	----------------------------------------------
15.10.2023 22.48	plasmashell	blackbox: 2023-10-15T19:48:20.066Z 1 Discord starting: {"releaseChannel":"stable","version":"0.0.31"}, modulepath: /home/jani/.var/app/com.discordapp.Discord/config/discord/0.0.31/modules
15.10.2023 22.48	plasmashell	blackbox: 2023-10-15T19:48:20.069Z 2 ✅ webContents.created web1 ""
15.10.2023 22.48	plasmashell	blackbox: 2023-10-15T19:48:20.073Z 3 ✅ window.created win1 "discord"
15.10.2023 22.48	plasmashell	splashScreen: SPLASH_SCREEN_READY
15.10.2023 22.48	plasmashell	2023-10-15T19:48:20.122Z [Modules] No updates to install
15.10.2023 22.48	plasmashell	splashScreen: no-pending-updates
15.10.2023 22.48	plasmashell	2023-10-15T19:48:20.123Z [Modules] Host is up to date.
15.10.2023 22.48	plasmashell	2023-10-15T19:48:20.123Z [Modules] Checking for module updates at https://discord.com/api/modules/stable/versions.json
15.10.2023 22.48	plasmashell	splashScreen: checking-for-updates
15.10.2023 22.48	plasmashell	splashScreen.updateSplashState checking-for-updates checking-for-updates {}
15.10.2023 22.48	plasmashell	splashScreen.webContentsSend: SPLASH_UPDATE_STATE SPLASH_UPDATE_STATE [ { status: 'checking-for-updates' } ]
15.10.2023 22.48	plasmashell	blackbox: 2023-10-15T19:48:20.151Z 4 ✅ webContents.did-finish-load web1
15.10.2023 22.48	plasmashell	[55:1015/224820.151566:ERROR:shared_image_factory.cc(575)] Could not find SharedImageBackingFactory with params: usage: Gles2|Raster|DisplayRead|Scanout, format: BGRA_8888, share_between_threads: 0, gmb_type: shared_memory
15.10.2023 22.48	plasmashell	[55:1015/224820.151643:ERROR:shared_image_factory.cc(575)] Could not find SharedImageBackingFactory with params: usage: Gles2|Raster|DisplayRead|Scanout, format: BGRA_8888, share_between_threads: 0, gmb_type: shared_memory
15.10.2023 22.48	plasmashell	[55:1015/224820.151690:ERROR:shared_image_factory.cc(575)] Could not find SharedImageBackingFactory with params: usage: Gles2|Raster|DisplayRead|Scanout, format: BGRA_8888, share_between_threads: 0, gmb_type: shared_memory
15.10.2023 22.48	plasmashell	[55:1015/224820.151733:ERROR:shared_image_factory.cc(575)] Could not find SharedImageBackingFactory with params: usage: Gles2|Raster|DisplayRead|Scanout, format: BGRA_8888, share_between_threads: 0, gmb_type: shared_memory
15.10.2023 22.48	plasmashell	[55:1015/224820.151773:ERROR:shared_image_factory.cc(575)] Could not find SharedImageBackingFactory with params: usage: Gles2|Raster|DisplayRead|Scanout, format: BGRA_8888, share_between_threads: 0, gmb_type: shared_memory
15.10.2023 22.48	plasmashell	[55:1015/224820.197497:ERROR:shared_image_factory.cc(575)] Could not find SharedImageBackingFactory with params: usage: Gles2|Raster|DisplayRead|Scanout, format: BGRA_8888, share_between_threads: 0, gmb_type: shared_memory
15.10.2023 22.48	plasmashell	[55:1015/224820.198256:ERROR:shared_image_factory.cc(575)] Could not find SharedImageBackingFactory with params: usage: Gles2|Raster|DisplayRead|Scanout, format: BGRA_8888, share_between_threads: 0, gmb_type: shared_memory
15.10.2023 22.48	plasmashell	[55:1015/224820.198986:ERROR:shared_image_factory.cc(575)] Could not find SharedImageBackingFactory with params: usage: Gles2|Raster|DisplayRead|Scanout, format: BGRA_8888, share_between_threads: 0, gmb_type: shared_memory
15.10.2023 22.48	plasmashell	2023-10-15T19:48:20.289Z [Modules] No module updates available.
15.10.2023 22.48	plasmashell	splashScreen: update-check-finished true 0 false
15.10.2023 22.48	plasmashell	splashScreen.launchMainWindow: false
15.10.2023 22.48	plasmashell	Optional module ./ElectronTestRpc was not included.
15.10.2023 22.48	plasmashell	splashScreen.updateSplashState launching launching {}
15.10.2023 22.48	plasmashell	splashScreen.webContentsSend: SPLASH_UPDATE_STATE SPLASH_UPDATE_STATE [ { status: 'launching' } ]
15.10.2023 22.48	plasmashell	[5:1015/224820.331864:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: Tiedostoa tai hakemistoa ei ole
15.10.2023 22.48	plasmashell	[5:1015/224820.331888:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: Tiedostoa tai hakemistoa ei ole
15.10.2023 22.48	plasmashell	blackbox: 2023-10-15T19:48:20.331Z 5 ✅ webContents.created web2 ""
15.10.2023 22.48	plasmashell	[5:1015/224820.331902:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: Tiedostoa tai hakemistoa ei ole
15.10.2023 22.48	plasmashell	blackbox: 2023-10-15T19:48:20.341Z 6 ✅ window.created win2 "Discord"
15.10.2023 22.48	plasmashell	legacyModuleUpdater: installed-module discord_krisp 1 1 true
15.10.2023 22.48	plasmashell	legacyModuleUpdater: installed-module discord_game_utils 1 1 true
15.10.2023 22.48	plasmashell	mainScreen.UpdaterEvents: UPDATER_HISTORY_QUERY_AND_TRUNCATE
15.10.2023 22.48	plasmashell	WEIGHT /home/jani/.var/app/com.discordapp.Discord/config/discord/0.0.31/modules/discord_krisp/NC_small_8k.thw
15.10.2023 22.48	plasmashell	WEIGHT /home/jani/.var/app/com.discordapp.Discord/config/discord/0.0.31/modules/discord_krisp/NC_small_16k.thw
15.10.2023 22.48	plasmashell	WEIGHT /home/jani/.var/app/com.discordapp.Discord/config/discord/0.0.31/modules/discord_krisp/c6.f.s.ced125.thw
15.10.2023 22.48	plasmashell	WEIGHT /home/jani/.var/app/com.discordapp.Discord/config/discord/0.0.31/modules/discord_krisp/VAD_weight.thw
15.10.2023 22.48	plasmashell	Error occurred in handler for 'DISCORD_SPELLCHECK_SET_LOCALE': Error: Invalid language code provided: "fi-FI" is not a valid language code
15.10.2023 22.48	plasmashell	    at DiscordMainIPC.<anonymous> (/home/jani/.var/app/com.discordapp.Discord/config/discord/0.0.31/modules/discord_desktop_core/core.asar/app/discord_native/browser/spellCheck.js:15:35)
15.10.2023 22.48	plasmashell	    at /home/jani/.var/app/com.discordapp.Discord/config/discord/0.0.31/modules/discord_desktop_core/core.asar/app/discord_native/common/DiscordIPC.js:24:23
15.10.2023 22.48	plasmashell	    at node:electron/js2c/browser_init:2:97909
15.10.2023 22.48	plasmashell	    at EventEmitter.<anonymous> (node:electron/js2c/browser_init:2:81422)
15.10.2023 22.48	plasmashell	    at EventEmitter.emit (node:events:513:28)
15.10.2023 22.48	plasmashell	    at EventEmitter.emit (node:domain:489:12)
15.10.2023 22.48	plasmashell	    at emitter.emit (/app/discord/resources/app.asar/node_modules/@sentry/electron/main/integrations/electron-breadcrumbs.js:116:20)
15.10.2023 22.48	plasmashell	mainScreen.UpdaterEvents: UPDATER_HISTORY_QUERY_AND_TRUNCATE
15.10.2023 22.48	plasmashell	mainScreen.UpdaterEvents: UPDATER_HISTORY_QUERY_AND_TRUNCATE
15.10.2023 22.48	plasmashell	mainScreen.UpdaterEvents: CHECK_FOR_UPDATES UPDATE_NOT_AVAILABLE
15.10.2023 22.48	plasmashell	2023-10-15T19:48:21.415Z [Modules] Host is up to date.
15.10.2023 22.48	plasmashell	2023-10-15T19:48:21.415Z [Modules] Checking for module updates at https://discord.com/api/modules/stable/versions.json
15.10.2023 22.48	plasmashell	2023-10-15T19:48:21.417Z [Modules] No module updates available.
15.10.2023 22.48	plasmashell	legacyModuleUpdater: update-check-finished
15.10.2023 22.48	plasmashell	legacyModuleUpdater: installed-module discord_rpc 1 1 true
15.10.2023 22.48	plasmashell	mainScreen.on(did-finish-load) false false
15.10.2023 22.48	plasmashell	splashScreen.pageReady
15.10.2023 22.48	plasmashell	blackbox: 2023-10-15T19:48:21.562Z 7 ✅ webContents.did-finish-load web2
15.10.2023 22.48	plasmashell	[55:1015/224821.563683:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
15.10.2023 22.48	plasmashell	[55:1015/224821.568600:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
15.10.2023 22.48	plasmashell	mainScreen.UpdaterEvents: UPDATER_HISTORY_QUERY_AND_TRUNCATE
15.10.2023 22.48	systemd	Started dbus-:1.2-org.freedesktop.portal.IBus@1.service.
15.10.2023 22.48	ibus-portal	Not connected to the ibus bus
15.10.2023 22.48	systemd	dbus-:1.2-org.freedesktop.portal.IBus@1.service: Main process exited, code=exited, status=1/FAILURE
15.10.2023 22.48	systemd	dbus-:1.2-org.freedesktop.portal.IBus@1.service: Failed with result 'exit-code'.
15.10.2023 22.48	plasmashell	blackbox: 2023-10-15T19:48:21.662Z 8 window.close win1
15.10.2023 22.48	plasmashell	blackbox: 2023-10-15T19:48:21.706Z 9 webContents.destroyed web1
15.10.2023 22.48	plasmashell	blackbox: 2023-10-15T19:48:21.709Z 10 window.closed win1
15.10.2023 22.48	systemd	fprintd.service: Deactivated successfully.
15.10.2023 22.48	audit	SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=fprintd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
15.10.2023 22.48	audit	BPF prog-id=103 op=UNLOAD
15.10.2023 22.48	systemd	app-flatpak-com.discordapp.Discord-7640.scope: Consumed 3.973s CPU time.

I see the log is partly in finnish, “Tiedostoa tai hakemistoa ei ole” means File or folder does not exist.

Try granting Discord the ‘Background’ permission in Flatseal. (KDE has no native UI for this; they implemented the wrong half of Flatseal.)

There seem to be some issues with background app detection, especially on KDE.

The next release of xdg-desktop-portal will at least log visibly when it kills an app.

Thank you sir. That worked!
However Armcord crashes with the same permissions.
I’ll just keep using discord for now.