Bug 451797 - Invalid KPackage 'kcm_kwinrules
Summary: Invalid KPackage 'kcm_kwinrules
Status: RESOLVED NOT A BUG
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_kwinrules (show other bugs)
Version: 5.24.3
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-22 16:02 UTC by SP
Modified: 2022-09-19 16:47 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: q


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SP 2022-03-22 16:02:30 UTC
SUMMARY

Invalid KPackage 'kcm_kwinrules

STEPS TO REPRODUCE
1.  Open System Settings /Window Management/Window Rules
2. 
3. 

OBSERVED RESULT
"Error loading QML file. Invalid Kpackage 'kcm_kwinrules'". 
kcm_kwinrules exists in the directory "usr/local/share/kpackage/kcms/".  It is installed by kwin_common.  Reinstalling kwin-common does not solve the problem.  Possibly a wrong path statement somewhere?


EXPECTED RESULT
kwin rules should be available in under Window Management in System Settings


SOFTWARE/OS VERSIONS

Linux/KDE Plasma:  Fedora 35
Kernel Version: 5.16.15-201.fc35.x86_64
KDE Plasma Version: 5.24.3
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.2
Comment 1 Ismael Asensio 2022-03-22 16:09:03 UTC
Thanks for your bug report!

Can you try running "kcmshell5 kcm_kwinrules" and also opening it from the application menu (Alt+F3 -> More options -> Open specific window properties) to see it the error persist there? This may help debugging the issue.
Comment 2 SP 2022-03-22 17:40:22 UTC
(In reply to Ismael Asensio from comment #1)
> Thanks for your bug report!
> 
> Can you try running "kcmshell5 kcm_kwinrules" and also opening it from the
> application menu (Alt+F3 -> More options -> Open specific window properties)
> to see it the error persist there? This may help debugging the issue.

"kcmshell5 kcm_kwinrules" 
Result:

QObject::startTimer: Timers can only be used with threads started with QThread
kf.coreaddons: "Could not load plugin from kcm_kwinrules: The shared library was not found."
Error loading the module "kcm_kwinrules" : invalid KPackage

Popup: Window Rules - System Settings Module / Window Rules "Error Loading QML file.  Invalid KPackage 'kcm_kwinrules'"

Alt F3 More Actions/Configure Special Window Settings - or -  More Actions/Configure Special Application Settings produces the same Popup
Comment 3 SP 2022-03-22 19:00:01 UTC
(In reply to SP from comment #2)
> (In reply to Ismael Asensio from comment #1)
> > Thanks for your bug report!
> > 
> > Can you try running "kcmshell5 kcm_kwinrules" and also opening it from the
> > application menu (Alt+F3 -> More options -> Open specific window properties)
> > to see it the error persist there? This may help debugging the issue.
> 
> "kcmshell5 kcm_kwinrules" 
> Result:
> 
> QObject::startTimer: Timers can only be used with threads started with
> QThread
> kf.coreaddons: "Could not load plugin from kcm_kwinrules: The shared library
> was not found."
> Error loading the module "kcm_kwinrules" : invalid KPackage
> 
> Popup: Window Rules - System Settings Module / Window Rules "Error Loading
> QML file.  Invalid KPackage 'kcm_kwinrules'"
> 
> Alt F3 More Actions/Configure Special Window Settings - or -  More
> Actions/Configure Special Application Settings produces the same Popup

But the shared library it is looking for "kcm_kwinrules.so" is there in /usr/lib64/qt5/plugins/kcms  This may not be a bug but some misconfiguration of some config file that happened in an upgrade?  Where would the path to that library be configured?
Comment 4 Alexander Lohnau 2022-03-26 09:06:45 UTC
>> kf.coreaddons: "Could not load plugin from kcm_kwinrules: The shared library was not found."

That might not be an issue at all, because the KWin KCMs are not ported to the new install location and thus KCMUtils has to guess if the plugin is is "kcm_kwinrules" or "kcms/kcm_kwinrules".

See https://invent.kde.org/frameworks/kcmutils/-/blob/master/src/kcmoduleloader.cpp#L65 for the relevant code.
Comment 5 Alexander Lohnau 2022-03-26 13:42:38 UTC
Please check if /usr/share/kpackage/kcms/kcm_kwinrules/ exists and list the containing files
Comment 6 SP 2022-03-26 19:14:59 UTC
(In reply to Alexander Lohnau from comment #5)
> Please check if /usr/share/kpackage/kcms/kcm_kwinrules/ exists and list the
> containing files

Yes - as I mentioned in my earlier report that directory does exist. "/usr/share/kpackage/kcms/kcm_kwinrules/" contains:
contents  metadata.desktop  metadata.json

"/usr/share/kpackage/kcms/kcm_kwinrules/contents" contains:
"/ui" which contains:
FileDialogLoader.qml  OptionsComboBox.qml  RuleItemDelegate.qml  RulesEditor.qml  RulesList.qml  ValueEditor.qml

"/usr/lib64/qt5/plugins/kcms" contains:
kcm_kaccounts.so  kcm_kwindecoration.so  kcm_kwinrules.so             kcm_pulseaudio.so    kcm_virtualkeyboard.so
kcm_kscreen.so    kcm_kwin_effects.so    kcm_kwin_virtualdesktops.so  kcm_screenlocker.so
Comment 7 SP 2022-03-26 19:37:57 UTC
(In reply to SP from comment #6)
> (In reply to Alexander Lohnau from comment #5)
> > Please check if /usr/share/kpackage/kcms/kcm_kwinrules/ exists and list the
> > containing files
> 
> Yes - as I mentioned in my earlier report that directory does exist.
> "/usr/share/kpackage/kcms/kcm_kwinrules/" contains:
> contents  metadata.desktop  metadata.json
> 
> "/usr/share/kpackage/kcms/kcm_kwinrules/contents" contains:
> "/ui" which contains:
> FileDialogLoader.qml  OptionsComboBox.qml  RuleItemDelegate.qml 
> RulesEditor.qml  RulesList.qml  ValueEditor.qml
> 
> "/usr/lib64/qt5/plugins/kcms" contains:
> kcm_kaccounts.so  kcm_kwindecoration.so  kcm_kwinrules.so            
> kcm_pulseaudio.so    kcm_virtualkeyboard.so
> kcm_kscreen.so    kcm_kwin_effects.so    kcm_kwin_virtualdesktops.so 
> kcm_screenlocker.so

Should there not be a "main.qml" in the kwin_rules directory?  It is not there  - nor is it in my other desktop.
Comment 8 Alexander Lohnau 2022-03-27 09:33:35 UTC
>Should there not be a "main.qml" in the kwin_rules directory?  It is not there  - nor is it in my other desktop.

In the metadata we have the following line defined, which overrides the entrypoint file:
"X-Plasma-MainScript": "ui/RulesList.qml"
Comment 9 Alexander Lohnau 2022-09-18 12:14:41 UTC
Is this still reproducible?
Comment 10 SP 2022-09-18 18:22:25 UTC
(In reply to Alexander Lohnau from comment #9)
> Is this still reproducible?

Yes I still get a Popup: "Window Rules - System Settings Module / Window Rules "Error Loading QML file.  Invalid KPackage 'kcm_kwinrules'" "
But the preceding verbiage in the terminal is brief:
"Error loading the module "kdm_kwinrules" : invalid KPackage "
Comment 11 SP 2022-09-18 18:24:40 UTC
Currently running FC 26 with KDE Plasma 5.25.5 under Wayland
Comment 12 SP 2022-09-18 18:25:31 UTC
Currently running FC 36 with KDE Plasma 5.25.5 under Wayland
Comment 13 SP 2022-09-18 19:07:02 UTC
(In reply to SP from comment #10)
> (In reply to Alexander Lohnau from comment #9)
> > Is this still reproducible?
> 
> Yes I still get a Popup: "Window Rules - System Settings Module / Window
> Rules "Error Loading QML file.  Invalid KPackage 'kcm_kwinrules'" "
> But the preceding verbiage in the terminal is brief:
> "Error loading the module "kdm_kwinrules" : invalid KPackage "

I appear to have fixed the error.  I realized that I had a duplicate kpackage in /usr/local/share/kpackage as well as /usr/share/kpackage.  Removed the directory from /usr/local/share and now the error no longer presents. So I will mark this as resolved.  Thanks for following up.
Comment 14 Alexander Lohnau 2022-09-19 05:38:21 UTC
> I realized that I had a duplicate kpackage in /usr/local/share/kpackage as well as /usr/share/kpackage.  Removed the directory from /usr/local/share and now the error no longer presents. 

Do you know why the /usr/local folder existed?
Comment 15 SP 2022-09-19 16:47:42 UTC
(In reply to Alexander Lohnau from comment #14)
> > I realized that I had a duplicate kpackage in /usr/local/share/kpackage as well as /usr/share/kpackage.  Removed the directory from /usr/local/share and now the error no longer presents. 
> 
> Do you know why the /usr/local folder existed?

I am unsure but it is possible that when the problem initially occurred I may have reinstalled packages in an attempt to resolve this - which, of course, it did not.