Bug 470246

Summary: kf.dbusaddons: Couldn't register name 'local.kleopatra' with DBUS - another process owns it already!
Product: [Applications] kleopatra Reporter: Timothée Ravier <travier>
Component: generalAssignee: Timothée Ravier <travier>
Status: ASSIGNED ---    
Severity: normal CC: kdepim-bugs, mutz
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Timothée Ravier 2023-05-25 10:25:27 UTC
SUMMARY

In a Flatpak, Kleopatra tries to register the `local.kleopatra` name on the session bus instead of the `org.kde.kleopatra` name.

It looks like it comes from https://invent.kde.org/frameworks/kdbusaddons/-/blob/master/src/kdbusservice.cpp#L50 that is reached because kleopatra does not set the organizationDomain: https://invent.kde.org/frameworks/kdbusaddons/-/blob/master/src/kdbusservice.cpp#L45

See: https://github.com/flathub/org.kde.kleopatra/issues/34

STEPS TO REPRODUCE
1.  Run Kleopatra from Flathub

OBSERVED RESULT

```
QIBusPlatformInputContext: invalid portal bus.
QSocketNotifier: Can only be used with threads started with QThread
libEGL warning: wayland-egl: could not open /dev/dri/renderD128 (No such file or directory)
kf.dbusaddons: Couldn't register name 'local.kleopatra' with DBUS - another process owns it already!
```
Kleopatra does not start.

EXPECTED RESULT

Kleopatra starts.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 38
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9
Kernel Version: 6.2.15-300.fc38.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-8665U CPU @ 1.90GHz
Memory: 31,1 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Comment 1 Bug Janitor Service 2023-05-25 10:34:40 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/kleopatra/-/merge_requests/48
Comment 2 Ingo Klöcker 2023-05-30 12:34:42 UTC
Git commit 66753b1e0d306d589f17c5dfd55e51e45d818ec2 by Ingo Klöcker, on behalf of Timothée Ravier.
Committed on 30/05/2023 at 12:31.
Pushed by kloecker into branch 'master'.

Set OrganizationDomain before registering the DBus service

The OrganizationDomain is used by KDBusAddons to generate the service
name used to register on the session bus so we need to set it up before
we try registering on the bus.

See: https://bugs.kde.org/show_bug.cgi?id=470246
See: https://github.com/flathub/org.kde.kleopatra/issues/34

M  +3    -0    src/main.cpp

https://invent.kde.org/pim/kleopatra/-/commit/66753b1e0d306d589f17c5dfd55e51e45d818ec2
Comment 3 Ingo Klöcker 2023-05-30 12:38:47 UTC
Git commit 9557e5ec15997ff0bd712c7d4b7016b98c2e9651 by Ingo Klöcker, on behalf of Timothée Ravier.
Committed on 30/05/2023 at 12:38.
Pushed by kloecker into branch 'release/23.04'.

Set OrganizationDomain before registering the DBus service

The OrganizationDomain is used by KDBusAddons to generate the service
name used to register on the session bus so we need to set it up before
we try registering on the bus.

See: https://bugs.kde.org/show_bug.cgi?id=470246
See: https://github.com/flathub/org.kde.kleopatra/issues/34
(cherry picked from commit 66753b1e0d306d589f17c5dfd55e51e45d818ec2)

M  +3    -0    src/main.cpp

https://invent.kde.org/pim/kleopatra/-/commit/9557e5ec15997ff0bd712c7d4b7016b98c2e9651