Bug 442721 - kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
Summary: kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kservice
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 443319 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-09-20 05:32 UTC by shenlebantongying
Modified: 2022-08-19 14:48 UTC (History)
14 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.96


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description shenlebantongying 2021-09-20 05:32:20 UTC
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found

I always get this message when some application open by mine type.

How can I add this mime type to somewhere? Is there a registry for this?
Comment 1 flan_suse 2021-10-05 19:08:15 UTC
Maybe we're seeing the same thing?

https://bugs.kde.org/show_bug.cgi?id=443319
Comment 2 Mladen Milinkovic, Max 2021-10-08 13:43:26 UTC
Can confirm this on kf5 5.86.0.

Hope following snippet is helpful.

Before, below code would open the example.js file in text editor.
Now it fails with:
```
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
Could not launch external editor.
```

```
	const QUrl script = QUrl::fromLocalFile("..../scripts/example.js");
	KIO::OpenUrlJob *job = new KIO::OpenUrlJob(script);
	job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, app()->mainWindow()));
	if(!job->exec()) {
		qDebug() << job->errorString();
		if(!QDesktopServices::openUrl(script))
			qDebug() << "Could not launch external editor.";
	}
```
Comment 3 flan_suse 2021-10-08 15:10:11 UTC
*** Bug 443319 has been marked as a duplicate of this bug. ***
Comment 4 Mladen Milinkovic, Max 2021-10-10 21:00:11 UTC
Looks like it's fixed in 5.87.0
Comment 5 petrk 2021-10-21 22:34:00 UTC
Present with 5.87 for me.
Comment 6 shenlebantongying 2021-12-13 10:18:16 UTC
This bug can be triggered by both "xdg-open" and "kde-open5".

I think I just find the related code is here:

It bypasses "x-scheme-handler" but didn't bypass "x-scheme-handler/file",

https://invent.kde.org/frameworks/kservice/-/blob/v5.89.0/src/services/kapplicationtrader.cpp#L26
Comment 7 shenlebantongying 2021-12-13 11:32:08 UTC
The last comment is wrong, but I cannot edit it. The code was submitted here.

https://phabricator.kde.org/D25698
Comment 8 AlexDeLorenzo.dev 2022-02-07 04:17:57 UTC
I'm encountering this issue on kf5 5.90.0:

    $ xdg-open .
    kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found

KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Graphics Platform: Wayland
Comment 9 imad 2022-02-25 20:36:32 UTC
I'm encountering this on an up-to-date Arch Linux system.

Plasma Desktop: 5.24.2
KDE Frameworks: 5.91.0
Qt: 5.15.2
Platform: X11
Hardware: Nvidia

The bug can be reproduced consistently on my multi-monitor setup:

1. Open "Display Configuration" in System Settings
2. Disable primary monitor
3. Enable primary monitor after some time

The above steps are sufficient to reproduce the problem. Restarting kwin/plasmadesktop does not help. The problem does not occur on a fresh restart though. The monitor needs to be disabled to reproduce it.

Examining with Journalctl, I see :


kwin_x11[2736]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 16715, resource id: 138412039, major code: 18 (ChangeProperty), minor code: 0
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
kioclient5[196052]: kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
kwin_x11[2736]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 8651, resource id: 142606341, major code: 18 (ChangeProperty), minor code: 0
kwin_x11[2736]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 8656, resource id: 142606342, major code: 18 (ChangeProperty), minor code: 0
kwin_x11[2736]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 8660, resource id: 142606343, major code: 18 (ChangeProperty), minor code: 0
Comment 10 pridoorok 2022-03-14 17:56:25 UTC
a workaround has been found - you need to:

enable hidden files in dolphin then go to your home dir (/home/username) then go to hidden .config dir in there you need to find file named mimeapps.list edit it,  add this string (x-scheme-handler/file=org.kde.dolphin.desktop;) to all sub strings for example:

[Added Associations]
.....
.....
x-scheme-handler/file=org.kde.dolphin.desktop;

[Default Applications]
.....
.....
x-scheme-handler/file=org.kde.dolphin.desktop;

then execute this command in the terminal:  update-mime-database ~/.local/share/mime

it's worked for me, after that system links has became open in dolphin

more info:
https://wiki.archlinux.org/title/XDG_MIME_Applications
https://bugzilla.redhat.com/show_bug.cgi?id=674321
Comment 11 flan_suse 2022-03-14 18:41:06 UTC
(In reply to pridoorok from comment #10)
> a workaround has been found - you need to:

Wow! That worked perfectly! Thank you so much. :)

I wonder why this is even needed for KDE? Why doesn't it "just work" as expected by default?
Comment 12 Rajeesh K V 2022-04-28 08:45:01 UTC
(In reply to pridoorok from comment #10)
> a workaround has been found - you need to:
> 
> (x-scheme-handler/file=org.kde.dolphin.desktop;) to all sub strings for

This work around gets rid of the warning for me; but it also unnecessary opens dolphin when I do
`xdg-open /some/file.pdf`.

I'm on Wayland, Frameworks 5.91, Plasma 5.24.4, Fedora 35.
Comment 13 Apoorv Potnis 2022-06-08 14:16:23 UTC
I get the following message when I open any PDF file in Okular 22.04.1 (KDE 5.24.5) via Konsole.

    kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
    kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
    qt.xkb.compose: failed to create compose table
Comment 15 Ahmad Samir 2022-08-19 14:48:34 UTC
Git commit a4c404603bbf43fda2d60c82c814527bde0a8352 by Ahmad Samir.
Committed on 19/08/2022 at 14:31.
Pushed by ahmadsamir into branch 'master'.

DesktopExecParser: don't kioexec if there is a handler for scheme

This fixes an issue where the code called
KApplicationTrader::queryByMimeType("x-scheme-handler/file"), which would
trigger a warning in KApplicationTrader, because there is no
x-scheme-handler/file mimtype.
FIXED-IN: 5.96

M  +24   -12   src/core/desktopexecparser.cpp

https://invent.kde.org/frameworks/kio/commit/a4c404603bbf43fda2d60c82c814527bde0a8352