Bug 406518

Summary: Rebuilding the system configuration cache with empty menu file leads to "Malformed URL trash:/"
Product: [Frameworks and Libraries] frameworks-kservice Reporter: nsane457
Component: generalAssignee: KIO Bugs <kio-bugs-null>
Status: REPORTED ---    
Severity: normal CC: kdelibs-bugs-null, nsane457
Priority: NOR    
Version First Reported In: 5.56.0   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description nsane457 2019-04-14 04:04:35 UTC
I was trying to troubleshoot why opening the trash folder or running "kioclient5 exec 'trash:/'" was resulting in "Malformed URL trash:/" error.  Running "kbuildsycoca5 --noincremental" would result in

> kf5.kservice.sycoca: Parse error in  "/home/peter/.config/menus/applications-merged/xdg-desktop-menu-dummy.menu" , line  1 , col  1 :  "unexpected end of file"

The offending file xdg-desktop-menu-dummy.menu was empty.  After inserting

> <!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
> "http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
> <Menu>
> </Menu>

and running "kbuildsycoca5 --noincremental", the trash folder opens as expected.


STEPS TO REPRODUCE
1. Create an empty file with no newline in "~/.config/menus/applications-merged/xdg-desktop-menu-dummy.menu".

2. Run "kbuildsycoca5 --noincremental".

3. Run "kioclient5 exec 'trash:/'" or open Trash from home's Desktop folder in dolphin.


OBSERVED RESULT

An "Error - KIOExec" titled window pops up with "Malformed URL trash:/" message.


EXPECTED RESULT

An opened trash folder.

SOFTWARE/OS VERSIONS

Operating System: Gentoo Linux 
KDE Plasma Version: 5.15.3
KDE Frameworks Version: 5.56.0
Qt Version: 5.12.2
Kernel Version: 5.0.5-gentoo
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-7700HQ CPU @ 2.80GHz
Memory: 7.7 GiB of RAM
Comment 1 nsane457 2019-04-17 03:55:48 UTC
The problem came back after waking up from sleep, but for some reason editing the file "/home/peter/.config/menus/applications-merged/xdg-desktop-menu-dummy.menu" and running "kbuildsycoca5 --noincremental" seems to fix it again. Strange.