Bug 500965 - Fails to save file on systemd.automount smb3 share
Summary: Fails to save file on systemd.automount smb3 share
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: general (other bugs)
Version First Reported In: 24.12.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-02 16:43 UTC by Paul Worrall
Modified: 2025-03-27 22:15 UTC (History)
1 user (show)

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


Attachments
Screen recording (789.24 KB, video/webm)
2025-03-07 08:25 UTC, Paul Worrall
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Worrall 2025-03-02 16:43:17 UTC
SUMMARY
When trying to save a PDF file that has previously been loaded from an SMB share mounted via fstab with the option x-systemd.automount, Okular reports "Could not open file://<mount point>/<filename>", then closes the file, and the saved file is renamed with the suffix ".part"

STEPS TO REPRODUCE
1. Have an SMB share from another device mounted on your PC with the option "x-systemd.automount" in its fstab entry
2. Navigate to the share using Dolphin and open a PDF file using Okular
3. Make an annotation in Okular
4. Select File=>Save

OBSERVED RESULT
1. Error - Okular: Could not open file file://<mount path>/<filename>
2. The file closes (even though I only commanded save)
3. The file is saved with the annotation I made, but its filename has ".part" appended so it has to be renamed before it can be opened again.

EXPECTED RESULT
File is saved with the annotation using the original filename and is not closed.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.80
KDE Frameworks Version: 6.12.0
Qt Version: 6.9.0
Graphics Platform: Wayland
Graphics Processor: AMD CEDAR

ADDITIONAL INFORMATION
1. Reported against Okular because I could not reproduce this with other KDE apps using the same SMB share
2. If I remove the x-systemd.automount option from the fstab entry and reboot, the expected behaviour is obtained.
Comment 1 Albert Astals Cid 2025-03-06 21:25:59 UTC
Why not open a bug against x-systemd.automount?

Can you please record a video so we can see what's happening?
Comment 2 Paul Worrall 2025-03-07 08:25:39 UTC
Created attachment 179198 [details]
Screen recording

Screen recording is attatched.

I'm not sure it's appropriate to report a bug against x-systemd.automount given that no other application I've tried has issues with opening, editing and saving files on this share.  (I've tried Gwenview, LibreOffice Writer, Kate, KMyMoney, Krita and KolourPaint). Also, I can open and browse the share using Dolphin so it appears to be mounted OK.

The fstab entry looks like this:

//nas.local/shared /remote/shared smb3 credentials=/etc/paul.credentials.nas,uid=1001,gid=5000,file_mode=0664,dir_mode=0775,x-systemd.automount 0 0

... and if I edit it just to remove the `,x-systemd.automount` bit and reboot then no problem with okular either.
Comment 3 Albert Astals Cid 2025-03-27 22:15:40 UTC
Well, reading the code, that is impossible to happen :D

But it clearly happens ...

If you give us very detailed and very easy to follow instructions on how to reproduce your setup (and no "Have an SMB share from another device mounted on your PC with the option "x-systemd.automount" in its fstab entry" is not enough) we may try to reproduce ourselves.