Issues encountered setting up KDE on Fedora 31

Contents

As has been noted many times on this blog, my primary computer sparrow is running a now positively ancient Fedora 23 from 2015. One downside of Linux is the ecosystem moves forward at a rapid pace, so things get outdated and then obsolete within an uncomfortably short span of years.

Last week I embarked on a project to install Fedora 31. Because a lot has changed between 23 and 31, I decided to rebuild my KDE environment from scratch. Here are some issues I encountered along the way.

kglobalaccel5 crashing

Many times the KDE environmemt failed to start because kglobalaccel5, which provides global shortcut keys for KDE, crashed. This is especially noticable when the X server is killed using Ctrl-Alt-Backspace.

My first attempt to fix the problem–by uninstalling the kf5-kglobalaccel package–failed spectacularly by taking out most of KDE with it!

Here’s a detailed trace of the interaction between KDE login/logout, the kglobalaccel5 program and systemd service, and an X server abort:

----- BEGIN KDE LOGIN -----
Nov 22 04:06:03 haremya2 systemd[1283]: Created slice dbus\x2d:1.2\x2dorg.kde.kglobalaccel.slice.
Nov 22 04:06:03 haremya2 systemd[1283]: Started dbus-:1.2-org.kde.kglobalaccel@0.service.
----- END KDE LOGIN -----
----- BEGIN KDE LOGOUT -----
Nov 22 04:07:03 haremya2 kglobalaccel5[1389]: The X11 connection broke (error 1). Did the X11 server die?
Nov 22 04:07:03 haremya2 systemd[1283]: dbus-:1.2-org.kde.kglobalaccel@0.service: Succeeded.
----- END KDE LOGOUT -----
----- BEGIN KDE LOGIN -----
Nov 22 04:08:45 haremya2 systemd[1283]: Started dbus-:1.2-org.kde.kglobalaccel@1.service.
----- END KDE LOGIN -----
----- BEGIN X SERVER ABORT -----
Nov 22 04:09:30 haremya2 kglobalaccel5[2129]: The X11 connection broke (error 1). Did the X11 server die?
Nov 22 04:09:30 haremya2 systemd[1283]: dbus-:1.2-org.kde.kglobalaccel@1.service: Succeeded.
Nov 22 04:09:30 haremya2 systemd[1283]: Started dbus-:1.2-org.kde.kglobalaccel@2.service.
Nov 22 04:09:30 haremya2 kglobalaccel5[2583]: qt.qpa.xcb: could not connect to display :0
Nov 22 04:09:30 haremya2 audit[2583]: ANOM_ABEND auid=1000 uid=1000 gid=1000 ses=5 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=2583
Nov 22 04:09:30 haremya2 kglobalaccel5[2583]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
Nov 22 04:09:30 haremya2 kglobalaccel5[2583]: This application failed to start because no Qt platform plugin could be initialized.
Nov 22 04:09:30 haremya2 systemd[1283]: dbus-:1.2-org.kde.kglobalaccel@2.service: Succeeded.
Nov 22 04:09:30 haremya2 systemd-coredump[2601]: Process 2583 (kglobalaccel5) of user 1000 dumped core.
Nov 22 04:09:32 haremya2 abrt-notification[2682]: Process 3686 (kglobalaccel5) crashed in qt_message_output
----- END X SERVER ABORT -----
----- BEGIN FAILED KDE LOGIN -----
Nov 22 04:10:24 haremya2 ksmserver[2788]: Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.NoReply")
Nov 22 04:10:24 haremya2 kdeinit5[2768]: Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.NoReply")
Nov 22 04:10:24 haremya2 kaccess[2774]: Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.NoReply")
----- END FAILED KDE LOGIN -----
Nov 22 04:12:54 haremya2 kwin_x11[2814]: Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.NoReply")
Nov 22 04:12:54 haremya2 plasmashell[2824]: Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.NoReply")
Nov 22 04:12:54 haremya2 kactivitymanagerd[3032]: Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.NoReply")
Nov 22 04:12:55 haremya2 org_kde_powerdevil[3006]: Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.NoReply")

kglobalaccel5 is started by systemd in response to something. The problem isn’t so much that kglobalaccel5 is crashing, but that once it does systemd flags the program as being non-startable and doesn’t attempt to start it again.

An intital search of files in /etc/systemd and /usr/lib/systemd turned up no hits for kglobalaccel5 or kglobalaccel. However, thanks to a question on StackExchange I found it in /usr/share/dbus-1/services/org.kde.kglobalaccel.service:

Name=org.kde.kglobalaccel
Exec=/usr/bin/kglobalaccel5

The fix there was to disable the service altogether:

cd /usr/share/dbus-1/services
mv org.kde.kglobalaccel.service org.kde.kglobalaccel.service.DISABLED
systemctl daemon-reload

While that worked–I could now kill the X server using Ctrl-Alt-Backspace and successfully restart the KDE session–it also disabled Alt-F2 for krunner and Ctrl-F1/F2/F3/F3 to switch virtual desktops.

I tried the following to reset systemd so it would restart kglobalaccess5 after it crashed, but none were successful:

  • Reloading using systemctl daemon-reload
  • Restarting using systemctl daemon-reexec
  • Restarting using kill -TERM 1

The solution came when I realised systemd was actually a red herring: the real issue was with D-Bus. When kglobalaccess5 aborted it left the user session in an inconsistent state. The fix is in order to get KDE to restart, most user processes must be shut down. This can be done by switching to a different virtual console, logging in as the user, and running the following command:

ps -ef | awk "/$USER/{print \$2}" | xargs kill

The issue is being tracked here: Bug 1701485 - [abrt] kf5-kglobalaccel: qt_message_fatal(): kglobalaccel5 killed by SIGABRT.

KMail2 bug: unable to add an arbitrary account

KMail2 has two ways to add an account:

  1. Settings > Configure KMail > Accounts > Receiving > Add > Mail Account
  2. Settings > Configure KMail > Accounts > Receiving > Add > Custom Account

The first method starts a “wizard” process that guides the user through the process of setting up the user name, password, and transport settings for various types of proiders: IMAP, KMail Mail Folder, Kolab Groupware Server, Maildir, Mbox, Misrosoft Exchange, or POP3.

The second methos does the same, except the user is ecpcted to know the account details in advance and supply them.

When I set up additional accounts using the second method, they were not available to KMail when I completed the setup. The fix was to restart akonadi after completing the setup:

akonadictl restart &>/dev/null &

KMail2: missing Spam and Anti-virus tools

When I went to set the rules for KMail, I noticed my original setup had sone rules for checking messages for spam using spamassassin. The KMail docs showed these could be set up using Tools > Ant-Spam Wizard. But when I went to the Tools menu the wizard wasn’t there.

The fix was to enable the pluigin using Settings > Configure KMail > Plugin.