Bug 159769 - Can't open ODF files when LibreOffice's lu* subdirectory in system TEMP directory is deleted
Summary: Can't open ODF files when LibreOffice's lu* subdirectory in system TEMP direc...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.4.0.3 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:24.8.0 target:24.2.2
Keywords: bisected, regression
Depends on:
Blocks:
 
Reported: 2024-02-19 04:13 UTC by Mike Kaganski
Modified: 2024-02-20 10:23 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2024-02-19 04:13:00 UTC
1. Start LibreOffice (its Start Center).
2. In a file manager, open system TEMP directory (e.g., on Windows it would typically be C:\Users\<Username>\AppData\Local\Temp), and see the subdirectory created by the running LibreOffice process, named similar to lu147122n54x.tmp. (There might be many such subdirectories there - lingering from previous sessions that weren't terminated properly.)
3. Delete *all* the subdirectories named "lu*.tmp" from the TEMP directory, found at step 2.
4. In the opened LibreOffice, try to open any ODF file.

=> Write Error. The file could not be written.

Was working OK in version 7.3.0.3.
Gives the error in version 7.4.0.3.
Comment 1 Mike Kaganski 2024-02-19 04:31:15 UTC
Regression after commit 4743a32b4f991c57e4b8a66adf035b1808ca793a "only need to create the folder for temp files once", 2022-05-18.
Comment 2 Commit Notification 2024-02-19 07:01:23 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0b58f1a41bf8d58426f16e47f86d313172ad4585

tdf#159769: always make sure that default temporary directory exists

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Mike Kaganski 2024-02-19 07:44:20 UTC
FTR: the problem appears IRL in scenario of an (automated) temporary directory cleanup, which relies on proper file locking, which prevents currently used files from removing. It kind of makes sense on Windows.
Comment 4 Mike Kaganski 2024-02-19 08:51:28 UTC
Note commit c11d92791101e9bebffa6c0f5e53dc531f86e9c4 "#97276#: automatically recreate TempDir", 2002-03-18, which initially introduced ensuredir, and which seems to target the same problem.
Comment 5 Commit Notification 2024-02-20 10:23:38 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/42170a562a60fc878290a4efd5e6f39292e36ca3

tdf#159769: always make sure that default temporary directory exists

It will be available in 24.2.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.