Bug 498890 - Oversight: "Locations" paths get cut off if path is unreachable during startup
Summary: Oversight: "Locations" paths get cut off if path is unreachable during startup
Status: RESOLVED UPSTREAM
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_desktoppath (other bugs)
Version First Reported In: 6.2.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-19 16:50 UTC by 43615
Modified: 2025-03-05 14:14 UTC (History)
4 users (show)

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


Attachments
config file before issue is triggered (314 bytes, text/plain)
2025-03-05 12:11 UTC, 43615
Details
config file after issue is triggered (574 bytes, text/plain)
2025-03-05 12:11 UTC, 43615
Details

Note You need to log in before you can comment on or make changes to this bug.
Description 43615 2025-01-19 16:50:08 UTC
SUMMARY
I have a local network share that gets mounted on startup by systemd. As I use it for bulk data storage, I have all of my "Locations" paths set to directories on that share. Whenever the server can't be reached during Plasma's startup (network hiccups, maintenance etc.), Plasma will permanently cut off the part of the path that isn't reachable, requiring manual reassignment.

STEPS TO REPRODUCE
1. Configure a network share to be mounted in some directory (like `/home/user/share`) before Plasma starts up (systemd unit with `WantedBy=multi-user.target`)
2. In System Settings > System > Session > Locations, set one or more locations to directories on that share (like `/home/user/share/Desktop`)
3. Reboot and disconnect the network, or make the share mounting process fail in some other way

OBSERVED RESULT
Configured path permanently changes to the furthest it can reach at that moment. For example, `/home/user/share/Desktop` becomes `/home/user`. It remains like that even after another reboot where the mount succeeds, and has to be fixed manually.

EXPECTED RESULT
Configured path should remain the same, but attempting to access the nonexistent directories should fall back on the "cut" version (maybe with a warning message?). The configured paths should not be changed without asking the user.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kernel 6.12.9-arch1-1
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1

ADDITIONAL INFORMATION
My systemd mount file:
```
[Unit]
Description=Mount keepstar/43615
After=nss-lookup.target

[Mount]
What=keepstar:/mnt/sto/43615
Where=/home/aegis/43615
Options=vers=4
Type=nfs
TimeoutSec=90

[Install]
WantedBy=multi-user.target
```
Comment 1 Nate Graham 2025-03-04 21:44:15 UTC
Does this mean that the content of the file ~/.config/user-dirs.dirs is actually being changed after the problem occurs?
Comment 2 43615 2025-03-05 12:10:28 UTC
(In reply to Nate Graham from comment #1)
> Does this mean that the content of the file ~/.config/user-dirs.dirs is
> actually being changed after the problem occurs?

Thank you for letting me know where it's stored. I can now use a simple command to restore it.

Yes, the entries in the file get truncated. Additionally, there's a comment saying that it was changed by "xdg-user-dirs-update".
Comment 3 43615 2025-03-05 12:11:01 UTC
Created attachment 179138 [details]
config file before issue is triggered
Comment 4 43615 2025-03-05 12:11:18 UTC
Created attachment 179139 [details]
config file after issue is triggered
Comment 5 Nate Graham 2025-03-05 14:14:26 UTC
I had a feeling. I investigated this and was unable to find any KDE code that would be doing what you're describing. And indeed, it appears to be upstream software: https://www.freedesktop.org/wiki/Software/xdg-user-dirs/

I would recommend submitting a bug report about this at the project's bug tracker: https://gitlab.freedesktop.org/xdg/xdg-user-dirs/-/issues