Bug 354092 - something breaks ~/.local/share/applications/mimeapps.list every few hours
Summary: something breaks ~/.local/share/applications/mimeapps.list every few hours
Status: RESOLVED WORKSFORME
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_filetypes (other bugs)
Version First Reported In: 4.11.9
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-19 16:21 UTC by kolAflash
Modified: 2020-12-19 04:35 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kolAflash 2015-10-19 16:21:45 UTC
Every few hours my ~/.local/share/applications/mimeapps.list becomes corrupted. Before and after the "=" (equals) symbols in that file, spaces become inserted. E.g.:

Before:
text/plain=kde4-kwrite.desktop;kde4-kate.desktop;

After:
text/plain = kde4-kwrite.desktop;kde4-kate.desktop;kde4-calligrawords_ascii.desktop;

Because of this, in the "Open With" menu (in Dolphin) the uppermost, default entry becomes the lowest. And the second entry becomes the default.

The order doesn't changes in the mimeapps.list
It's just, that KDE/Dolphin seems to interpret it differently if there are spaces around the equals " = " sign.

I really don't know what could cause this. This bug is appearing to me since a few weeks (max. 1 month). I currently have no idea how to find out, what process modifies mimeapps.list
So for the beginning, let's just see if there are other people out there, having the same problem.

Reproducible: Sometimes
Comment 1 kolAflash 2015-10-19 16:54:06 UTC
Yeah! Found a way to watch which process is writing mimeapps.list
Linux is great!

https://en.wikipedia.org/wiki/Inotify#FANOTIFY
https://www.piware.de/2012/02/fatrace-report-system-wide-file-access-events/

So I'm doing:
sudo fatrace --filter=W ~/.local/share/applications/ | grep '/.local/share/applications/mimeapps.list'

Now I'll have to wait. I'll tell you if I found out which process is the bad one!
Comment 2 kolAflash 2015-10-19 21:16:10 UTC
Looks like the file modification is caused by Mono. I'm running a program called CKAN, which helps me to update and install mods for Kerbal Space Program (a game).

20:18:15.394252 mono(15313): W /home/user/.local/share/applications/mimeapps.list

https://github.com/KSP-CKAN/CKAN

I send a bug report with that to the guys behind the CKAN program. Nevertheless I guess having spaces in the mimeapps.list file should be OK. So it's more like a problem of KDE, because it can't correctly read the file when there are spaces.

https://github.com/KSP-CKAN/CKAN/issues/1498

Just to ensure you: It's not the game (Kerbal Space Program, which is also written with Mono), but the CKAN program which messes around with the mimeapps.list file.
Comment 3 kolAflash 2015-10-20 13:23:29 UTC
Thought about it. I guess KDE does everything correctly because mimeapps.list can have lines likes this:

application/MySQL Workbench=mysql workbench.desktop;

So spaces can really have a meaning.
Nevertheless I'm really not an expert on this...
Comment 4 Justin Zobel 2020-11-19 05:29:38 UTC
(In reply to kolAflash from comment #2)
> Looks like the file modification is caused by Mono. I'm running a program
> called CKAN, which helps me to update and install mods for Kerbal Space
> Program (a game).
> 
> 20:18:15.394252 mono(15313): W
> /home/user/.local/share/applications/mimeapps.list
> 
> https://github.com/KSP-CKAN/CKAN
> 
> I send a bug report with that to the guys behind the CKAN program.
> Nevertheless I guess having spaces in the mimeapps.list file should be OK.
> So it's more like a problem of KDE, because it can't correctly read the file
> when there are spaces.
> 
> https://github.com/KSP-CKAN/CKAN/issues/1498
> 
> Just to ensure you: It's not the game (Kerbal Space Program, which is also
> written with Mono), but the CKAN program which messes around with the
> mimeapps.list file.

Sounds like you identified and found the issue!

Can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved. I'm setting status to "needsinfo" pending your response, please change back to "reported" or "resolved" when you respond, thanks.
Comment 5 Bug Janitor Service 2020-12-04 04:34:01 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Bug Janitor Service 2020-12-19 04:35:33 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!