Bug 428373 - "Examining (Failed)" notifications some times when trying to save in folders with many files.
Summary: "Examining (Failed)" notifications some times when trying to save in folders ...
Status: RESOLVED FIXED
Alias: None
Product: xdg-desktop-portal-kde
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: Archlinux Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Jan Grulich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-28 03:32 UTC by Bharadwaj Raju
Modified: 2022-08-14 15:23 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.26


Attachments
Screenshot (14.33 KB, image/png)
2020-10-28 03:32 UTC, Bharadwaj Raju
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bharadwaj Raju 2020-10-28 03:32:16 UTC
Created attachment 132824 [details]
Screenshot

SUMMARY
I get "Examining (Failed)" notifications sometimes when I try to save a file from Firefox into a folder with many images (1k+).


STEPS TO REPRODUCE
1. Have a folder with 1k+ images
2. Save an image into this folder in Firefox
3. Try to save another image (so it opens that folder by default)


OBSERVED RESULT
Notification about "Examining (Failed)", and my preferences about this folder (show previews etc) are not remembered by the save dialog (I am not sure if this bit about preferences is related).


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.20.1
KDE Plasma Version: 5.20.1
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1


ADDITIONAL INFORMATION
I managed to get 3 log files from xdg-desktop-portal-kde (one when the problem did not occur, and two where it did. They are here: https://invent.kde.org/-/snippets/1318

Someone on reddit /r/kde had this problem 6 months ago too: https://old.reddit.com/r/kde/comments/ft6rsb/warning_xdgdesktopportalkde_message_on_firefox/, and they say the problem still persists. Creating a fresh user doesn't fix it.

Based on my experience and the reddit user's, it seems that this problem occurs most often with folders with large number of files. When I moved my files into a backup folder, I stopped getting the notification in the original folder but got it in the backup folder.

Before the "Examining (Failed)" notification, for a split second there is an "Examining" notification with a bouncing progress bar.
Comment 1 Bharadwaj Raju 2020-10-28 03:57:25 UTC
Examining the system log, it appears that:

- whenever I open a save dialog (even from Kate, which I think doesn't use the portal), I get errors:
  - kdeinit5: kf.kio.slaves.tags: tag fetch failed: "Failed to open the database"
  - kdeinit5: kf.kio.slaves.tags: "tags:/" list() invalid url

- when I get the error (via portal from Firefox), I get this:

28/10/20 8:59 AM xdg-desktop-portal-kde xdp-kde-file-chooser: SaveFile called with parameters:
28/10/20 8:59 AM xdg-desktop-portal-kde xdp-kde-file-chooser:     handle:  "/org/freedesktop/portal/desktop/request/1_122/gtk671620236"
28/10/20 8:59 AM xdg-desktop-portal-kde xdp-kde-file-chooser:     parent_window:  "x11:3400003"
28/10/20 8:59 AM xdg-desktop-portal-kde xdp-kde-file-chooser:     title:  "Save Image"
28/10/20 8:59 AM xdg-desktop-portal-kde xdp-kde-file-chooser:     options:  QMap(("current_filter", QVariant(QDBusArgument, ))("current_folder", QVariant(QByteArray, "/home/bharadwaj/imgbackup\x00"))("current_name", QVariant(QString, "Screenshot_20201024_011859.png"))("filters", QVariant(QDBusArgument, ))("modal", QVariant(bool, true)))
28/10/20 8:59 AM kdeinit5 kf.kio.slaves.tags: tag fetch failed: "Failed to open the database"
28/10/20 8:59 AM kdeinit5 kf.kio.slaves.tags: "tags:/" list() invalid url
28/10/20 8:59 AM xdg-desktop-portal-kde kf.kio.core: "Could not enter folder tags:/."
28/10/20 8:59 AM plasmashell org.kde.plasma.notifications: Failed to generate job text for job with following properties:
28/10/20 8:59 AM plasmashell org.kde.plasma.notifications:   processedFiles = 0 , totalFiles = 0 , current file name = "imgbackup" , destination url string = ""
28/10/20 8:59 AM plasmashell org.kde.plasma.notifications: label1 = "File" , value1 = "file:/home/bharadwaj/imgbackup" , label2 = "" , value2 = ""
28/10/20 8:59 AM xdg-desktop-portal-kde kf.notifications: Audio notification requested, but sound file from notifyrc file was not found, aborting audio notification
28/10/20 8:59 AM xdg-desktop-portal-kde qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 6490, resource id: 16814652, major code: 40 (TranslateCoords), minor code: 0
28/10/20 8:59 AM xdg-desktop-portal-kde qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 6750, resource id: 16814497, major code: 40 (TranslateCoords), minor code: 0

The bit about "Failed to generate job text" seems interesting.
Comment 2 flan_suse 2021-10-13 16:41:12 UTC
Issue still exists, on the latest versions:

Operating System: Manjaro Linux
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.2
Kernel Version: 5.14.10-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 8 × 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics

Notable slowdown if folder contains many files. Previews are disable (in KDailog).

Every time I go to save a file to the directory, there's a delay as it "generates" the listing of folders/files. The location in question has 8,800+ files.

Always abruptly notified with:

> xdg-desktop-portal-kde
> Examining (Failed)
Comment 3 flan_suse 2022-03-21 23:09:17 UTC
This is still an issue with folders containing many files, even today with KDialog (i.e, saving a file or downloading an image from a website).

Even today, with updated specs:

Operating System: Manjaro Linux
KDE Plasma Version: 5.24.3
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.3
Kernel Version: 5.15.28-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 8 × 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Comment 4 Daniel Kraus 2022-04-20 05:15:56 UTC
I think I have the same issue. My system started to notify me about "Examining (failed)" recently, and my syslog looks the same. It also happens with folders that do *not* contain many files.

Operating System: KDE neon 5.24
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.3
Kernel Version: 5.13.0-40-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i5-8250U CPU @ 1.60GHz
Memory: 23,4 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Comment 5 bugs.kde 2022-05-19 15:54:17 UTC
Similar problem, but the directory only contains 356 files.
Comment 6 flan_suse 2022-05-25 15:17:48 UTC
So the question is... what *is* KDialog even doing?

Does it inspect / examine every file in the navigated directory?

For comparison:
* Dolphin loads a folder with 14,000 files very quickly
* GTK file selector loads a folder with 14,000 files very quickly
* Qt file selector loads a folder with 14,000 files very quickly
* Windows Explorer loads a folder with 14,000 files almost instantly

This is true of a network share or a local folder.

I believe the error message people are seeing is inter-related to some sort of bloat of KDialog. It's doing too much. A directory listing, even of thousands of files, should simply... list the contents. That's why we experience, even on fast computers, the "loading" phenomenon when browsing large folders with KDialog. Even on repeat visits!

What is KDialog doing under the hood for this long-standing issue that has never been addressed or streamlined?
Comment 7 Harald Sitter 2022-07-12 09:56:08 UTC
Is this still a problem with 5.25?
Comment 8 Daniel Kraus 2022-07-18 13:17:32 UTC
Yes I still do encounter this message with 5.25. I do save a lot of PDF files from the internet, and the message does not occur as often as it did previously (at least that's my impression), but I do still see it every now and then. Also with other file types, JPG for example.


Operating System: KDE neon 5.25
KDE Plasma Version: 5.25.3
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.5
Kernel Version: 5.13.0-52-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i5-8250U CPU @ 1.60GHz
Memory: 23,4 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Manufacturer: LENOVO
Product Name: 20L8S02D00
System Version: ThinkPad T480s
Comment 9 Harald Sitter 2022-07-18 14:48:34 UTC
What appears to be happening is that the portal constructs a bogus path and that then fails to examine (i.e. fails to stat) on account of it being bogus.
Comment 10 Bug Janitor Service 2022-07-18 14:57:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/122
Comment 11 Harald Sitter 2022-07-18 19:40:44 UTC
Git commit 3f0268306ed3d29405a74e2e562f4a391d3763c0 by Harald Sitter.
Committed on 18/07/2022 at 14:51.
Pushed by sitter into branch 'master'.

don't construct invalid paths

tear this logic apart a bit to make it easier to comprehend. previously
it was trying to be too smart for its own good.

the previous code would url.todisplaystring (this returns a url if the
input was an url - e.g. file:///foo) but then used that with
fromLocalFile (which prepends file:/) ultimately ending up with
file:file://foo.

instead let's manipulate the path proper-like. append to the path(),
then simply pass along the url, no localfile conversion necessary at all

M  +9    -2    src/filechooser.cpp

https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/3f0268306ed3d29405a74e2e562f4a391d3763c0