Bug 475152 - Automatic update of ksycoca5 cache file sometimes breaks file association
Summary: Automatic update of ksycoca5 cache file sometimes breaks file association
Status: REPORTED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 24.02.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-02 20:03 UTC by fulalas
Modified: 2024-05-13 09:11 UTC (History)
2 users (show)

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


Attachments
Empty "Select the program to open this file" box (16.28 KB, image/png)
2024-05-11 17:01 UTC, logistic-bot
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fulalas 2023-10-02 20:03:17 UTC
SUMMARY
When ksycoca5 cache (/root/.cache/ksycoca5*) is manually removed or it's updated automatically, opening dolphin as root fail to make file association work, and 'open with' shows no application.

STEPS TO REPRODUCE
1. remove /root/.cache/ksycoca5* cache file
2. open dolphin as root (not as admin)
3. double click any file that has an application associated with

OBSERVED
1. can't open them as all file associations are gone in this scenario
2. can't even use 'open with' because there is no application available

You might be wondering why I'm removing ksycoca5* cache file. Because that's the fastest way to replicate this issue. When using the system normally, if this cache file is updated automatically (and sometimes it is), the root issue happens anyway. The only way to fix that is to manually run kbuildsycoca5 as root and then running dolphin as root, which, of course, is not reasonable.

I noticed that the root ksycoca5* cache file created/updated automatically is around 100kb smaller than the one created when we manually call kbuildsycoca5 (as root). Also, when we remove ksycoca5* cache file from the normal user folder (non-root), it gets automatically regenerated, so for this non-root user everything just works.

I managed to replicate this issue on pretty much any distro that ships Plasma 5.27.x, including Fedora 38, which uses dolphin 22.12.3.

Please, avoid the discussion on the 'why running dolphin as root blahblahblah' as it won't help, and using admin:// is not a solution either. If you don't consider this a bug or don't want to fix it, I prefer to hear that.

Thanks in advance :)
Comment 1 fulalas 2023-10-02 20:51:03 UTC
BTW, when right clicking on any icon, the output in the terminal shows (regardless if it's root or not):

true
actions!!!
Comment 2 fulalas 2023-10-02 20:51:54 UTC
By 'any icon' I mean any file/folder in dolphin.
Comment 3 logistic-bot 2024-05-11 16:51:23 UTC
I am experiencing a similar issue, not sure if it has the same cause.

- When opening a file using dolphin, no file association is used, and the "open with" window opens every time.
- The "open with" window shows no applications (see attached screenshot).
- Manually specifiying a command in the "open with" window opens the file with the specified program, however no association is saved when ticking the "Remember application association" box.

This happens even as a non-root user (my primary use case).

Running "kbuildsycoca5" or "kbuildsycoca6", both as root and non-root does not seem to solve the issue, even temporarily.

System information:
dolphin 24.02.2
kbuildsycoca5 5.115.0
kbuildsycoca6 6.1.0
Arch Linux 6.8.5-zen1-1-zen
Comment 4 logistic-bot 2024-05-11 16:59:42 UTC
Update: I got it to work with help from this thread: https://bbs.archlinux.org/viewtopic.php?pid=2167377

Here are the steps that worked:
- Install the "archlinux-xdg-menu" package
sudo pacman -S archlinux-xdg-menu
- Update system menus:
update-menus
- Rebuild ksycoca:
XDG_MENU_PREFIX=arch- kbuildsycoca6
- It works!
Comment 5 logistic-bot 2024-05-11 17:01:42 UTC
Created attachment 169386 [details]
Empty "Select the program to open this file" box

Whoops forgot to attach the screenshot
Comment 6 Antonio Rojas 2024-05-11 20:12:20 UTC
(In reply to logistic-bot from comment #3)
> I am experiencing a similar issue, not sure if it has the same cause.
> 
> - When opening a file using dolphin, no file association is used, and the
> "open with" window opens every time.
> - The "open with" window shows no applications (see attached screenshot).
> - Manually specifiying a command in the "open with" window opens the file
> with the specified program, however no association is saved when ticking the
> "Remember application association" box.

That is expected behavior if you're not using a DE, and not related to this bug.
Comment 7 logistic-bot 2024-05-13 09:11:42 UTC
(In reply to Antonio Rojas from comment #6)
> (In reply to logistic-bot from comment #3)
> > I am experiencing a similar issue, not sure if it has the same cause.
> > 
> > - When opening a file using dolphin, no file association is used, and the
> > "open with" window opens every time.
> > - The "open with" window shows no applications (see attached screenshot).
> > - Manually specifiying a command in the "open with" window opens the file
> > with the specified program, however no association is saved when ticking the
> > "Remember application association" box.
> 
> That is expected behavior if you're not using a DE, and not related to this
> bug.

Oh, I see. In that case, I apologize for taking up space here, I'm kind of clueless about how file associations work.