Bug 453876

Summary: kf.plasma.core: "findInCache with a lastModified timestamp of 0 is deprecated" log warning
Product: [Frameworks and Libraries] frameworks-ksvg Reporter: Timothée Ravier <travier>
Component: GeneralAssignee: Plasma Bugs List <plasma-bugs>
Status: CONFIRMED ---    
Severity: normal CC: aidilzmtsk, hey, jordan, kdelibs-bugs, me, nate, notmart, plasma-bugs, rdieter, robert, sph, yosukematsumura
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Timothée Ravier 2022-05-16 08:46:27 UTC
Clone to track the specific error message from https://api.kde.org/frameworks/plasma-framework/html/theme_8cpp_source.html#l00280

+++ This bug was initially created as a clone of Bug #442011 +++


SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
SUMMARY

In some cases (exact reproducible steps not found yet), Plasma will fail to display any application icon on Fedora Kinoite.

On Fedora Kinoite, all files in /usr are set with the UNIX timestamp of 0.
Running plasmashell in a terminal will show that line repeatedly:

kf.plasma.core: findInCache with a lastModified timestamp of 0 is deprecated

Updating the timestamps on those files and running kbuildsyscoca5 temporarily fixes the issue.

This is most likely due to a confusion in: https://api.kde.org/frameworks/plasma-framework/html/theme_8cpp_source.html#l00280 where lastModified is here truly 0 and not left to the default value.

An option would be to use 1 instead when looking at a file with a 0 timestamp in the calling code but I have not found where this function is called yet.

STEPS TO REPRODUCE
1. Clean icon cache
2. Set an application icon file, desktop entry, etc. timestamp to UNIX time 0
3. plasma-shell --replace

OBSERVED RESULT

Lots of:
kf.plasma.core: findInCache with a lastModified timestamp of 0 is deprecated

Application has no icon.

EXPECTED RESULT

Applications has an icon.

SOFTWARE/OS VERSIONS
Fedora Linux 35 & Rawhide
Linux/KDE Plasma: 5.22.4
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85
Qt Version: 5.15.2

ADDITIONAL INFORMATION
This is similar to https://bugs.kde.org/show_bug.cgi?id=429196 but I could not get this working with the same workaround.
Comment 1 Timothée Ravier 2022-05-16 16:48:53 UTC
This is https://invent.kde.org/ravier/plasma-framework/-/blob/master/src/plasma/theme.cpp#L279.

Essentially we need to keep accepting 0 as a valid value. We can still make the lastModified argument non optional in KF6.
Comment 2 Stephane Travostino 2023-10-23 16:18:02 UTC
Copied from https://bugs.kde.org/show_bug.cgi?id=442011: 

My journal STILL is spammed by "kf.plasma.core: findInCache with a lastModified timestamp of 0 is deprecated" messages.

If it's benign, it has no business being logged. But right now it's being written 50+ times per second, judging from journal logs, which is a bug in and of itself, and makes using the journal an unnecessary pain in the butt.

```
~ % journalctl -b > out.txt
~ % uptime
 17:12:54 up 4 days,  1:04,  2 users,  load average: 4.16, 4.04, 4.00
~ % grep 'kf.plasma.core: findInCache with' out.txt | wc -l
553628
```

Right now it's being written 138,000 times PER DAY on my machine.
Comment 3 Robert Riemann 2024-05-02 19:34:04 UTC
I have the message also over and over in the log.

Operating System: Fedora Linux 40
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Kernel Version: 6.8.7-300.fc40.x86_64 (64-bit)
Comment 4 Jordan Pryde 2024-05-03 20:36:05 UTC
There are now 2 (!) patches for this issue:
https://invent.kde.org/frameworks/ksvg/-/merge_requests/46 by Timothée
https://invent.kde.org/frameworks/ksvg/-/merge_requests/47 by myself

They were submitted within a few hours of each other, I didn't see theirs before submitting mine. They do take different approaches to solving this bug.
Comment 5 aidilzmtsk 2024-05-08 03:52:40 UTC
Heyo, just want to confirm that I'm also experiencing a similar issue.
Namely that fedora plasmashell[1931]: kf.svg: findInCache with a lastModified timestamp of 0 is deprecated
absolutely floods my logs, making it hard for me to troubleshoot other issues.
Everytime the panel pops up (I have Dodge Windows enabled), that specific warning appears between 5 to 10 times and just repeats incessantly.
Comment 6 Stephane Travostino 2024-05-08 07:14:01 UTC
I don't get why that line isn't simply removed as it's been writing gigabytes of logs for 2 years now. 

I get that a better fix is appropriate, but at this point better to do the band-aid fix that literally takes second rather than keep giving headaches to people that might need easy access to their logs (i.e. devs). 

Perfect always is the enemy of good.  

On Wed, 8 May 2024, at 04:52, bugzilla_noreply@kde.org wrote:
> https://bugs.kde.org/show_bug.cgi?id=453876
>
> aidilzmtsk@gmail.com changed:
>
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |aidilzmtsk@gmail.com
>
> --- Comment #5 from aidilzmtsk@gmail.com ---
> Heyo, just want to confirm that I'm also experiencing a similar issue.
> Namely that fedora plasmashell[1931]: kf.svg: findInCache with a lastModified
> timestamp of 0 is deprecated
> absolutely floods my logs, making it hard for me to troubleshoot other issues.
> Everytime the panel pops up (I have Dodge Windows enabled), that specific
> warning appears between 5 to 10 times and just repeats incessantly.
>
> -- 
> You are receiving this mail because:
> You are on the CC list for the bug.
Comment 7 ratijas 2024-05-09 21:58:00 UTC
> I don't get why that line isn't simply removed as it's been writing gigabytes of logs for 2 years now. 

FYI you can disable KSvg logging by turning off its "kf.svg" logging category through KDebugSettings or manually in the ~/.config/QtProject/qtlogging.ini config file.
Comment 8 Robert Riemann 2024-05-15 14:18:29 UTC
Dear ratijas,

I put this in my qtlooging.ini, but still see the debugging messages. Can you please help me to apply the work around?

~~~
[rules]
kf.svg.debug=false
~~~