Bug 128526 - Catalina: Can't open attachments in Mail due to Lock File issues
Summary: Catalina: Can't open attachments in Mail due to Lock File issues
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.3.2.2 release
Hardware: All Mac OS X (All)
: high major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: MacOS-Wishlist
  Show dependency treegraph
 
Reported: 2019-11-01 09:09 UTC by bob
Modified: 2020-07-18 05:42 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Error message displayed when opening attachment in Mail.app (24.43 KB, image/png)
2019-11-06 11:43 UTC, Alex Thurgood
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bob 2019-11-01 09:09:34 UTC
Description:
"The lock file could not be created for exclusive access by LibreOffice, due to missing permission to create a lock file on that file location or lack of free disk space."

It would be good to know what the update is on fixing the lock file issue when trying to open attachments to Mac Mail.  Currently it can be resolved by copying the file rather than saving it in the read only mode - but it's still a pain.

Steps to Reproduce:
1.Click on the Attachment in a Mac Mail message, or
2.Save the attachment to a folder
3.

Actual Results:
"The lock file could not be created for exclusive access by LibreOffice, due to missing permission to create a lock file on that file location or lack of free disk space." message

Expected Results:
A fully read/write document


Reproducible: Always


User Profile Reset: No



Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: TextDocument
[Information guessed from browser]
OS: Mac OS X (Catalina)
OS is 64bit: yes
Comment 1 Ahmad Haris 2019-11-05 14:04:50 UTC
Hi Bob,

Thank you for reporting the bug. I can confirm that the bug is present in master.

Version: 6.4.0.0.alpha1+
Build ID: d2b5ab3498a78c6d164a15b3bf2b947553ea2743
CPU threads: 8; OS: Mac OS X 10.15; UI render: default; VCL: osx; 
Locale: en-ID (en_ID.UTF-8); UI-Language: en-US
Calc: threaded
Comment 2 Xisco Faulí 2019-11-06 10:52:45 UTC
@Alex, do you reproduce this issue ?
Comment 3 Alex Thurgood 2019-11-06 11:07:17 UTC
(In reply to Xisco Faulí from comment #2)
> @Alex, do you reproduce this issue ?

I never use Mac Mail.app as IMHO it is a pile of security-hole ridden sh**

Unable to test, sorry.

The lock file message is probably Catalina's way of telling you that LO is trying to step outside of the allowed jail (secure container) in which apps are now supposed to run. LO creates a lock file (hidden file) of the file to be modified when you load it into memory for the purposes of file recovery in the event of a crash. I'm guessing that LO is attempting to create this lock file in a directory that is now forbidden by Catalina's security policy.
Comment 4 Alex Thurgood 2019-11-06 11:42:36 UTC
So, set up a test account on Mail.app and sent myself an ODT from a different account.

Confirming the reported behaviour with

Version: 6.3.1.2
Build ID: b79626edf0065ac373bd1df5c28bd630b4424273
Threads CPU : 4; OS : Mac OS X 10.15.1; UI Render : par défaut; VCL: osx; 
Locale : fr-FR (fr_FR.UTF-8); Langue IHM : fr-FR
Calc: threaded

Screenshot of message that is displayed attached.
Comment 5 Alex Thurgood 2019-11-06 11:43:51 UTC
Created attachment 155572 [details]
Error message displayed when opening attachment in Mail.app
Comment 6 Alex Thurgood 2019-11-06 11:47:06 UTC
FWIW, this does not happen on macOS 10.14.6 with the same version of LO(6312), so this behaviour is new with Catalina.
Comment 7 bob 2019-11-19 22:26:04 UTC
The bug is resolved if you open Privacy Settings and add LibreOffice to "Allow Full Disk Access"
Comment 8 eisa01 2020-05-09 23:50:51 UTC
Hm.. I guess this sounds like a pretty serious drawback, if you can't open attachments directly from Mail?

I'm bumping the importance

Workaround to grant full disk access
Comment 9 Tor Lillqvist 2020-05-14 07:40:50 UTC
Granting full access is a workaround, but it would be much better if that was not needed. Note that according to the initial bug description, it is the lock file that can't be created. Presumably the file where the actual attached document has been stored by Mail.app has been opened just fine by LibreOffice. So what is needed is some tweaks to make LibreOffice not care if it can't create a lock file, especially if the lock file would be created in some location that can be recognised as "special". Will investigate.
Comment 10 Tor Lillqvist 2020-05-14 08:17:56 UTC
For me, using LibreOffice 6.4.3.2, the "Document Could Not Be Locked" dialog offers the possibility to open the document read-only, which makes sense. (What would it even mean to be editing a document that is actually an attachment to an email message? You wouldn't be modifying the attachment even if you would make changes and save them. You would just pointlessly be modifying a temporary file created by Mail.app) which is a preferable workaround than granting full access, don't you think? If you then do a File > Save As, the document can be edited normally.

Would an acceptable fix be to simply get rid of the "Document Could Not Be Locked" dialog, and instead just open the document read-only?

Bob, if your "Expected Result" is "A fully read/write document", where would that document be stored? Note that the attachment that Mail.app writes to disk is in a scratch location, like /Users/tml/Library/Containers/com.apple.mail/Data/Library/Mail Downloads/DF2EC83C-48C4-4E39-9D56-5FC036385737/AAA1.odt . That folder is not one the users is supposed to be poking into.
Comment 11 Tor Lillqvist 2020-05-14 08:36:24 UTC
(Removed the "full disk access workaround" from the bug summary; this has nothing to do with full disk.)
Comment 12 Tor Lillqvist 2020-05-14 08:43:23 UTC
Maybe instead of showing the dialog, we should just open the document read-only, and the blue "This document is open in read-only mode" notification bar could be made more verbose, perhaps adding something like "If you want to make changes to it, you first need to save it to a folder you have write access to."
Comment 13 Commit Notification 2020-05-15 13:09:49 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6c102b0a12ed911b207d8b1da421f2b916c2bcdf

tdf#128526: Make the read-only notification a bit more verbose

It will be available in 7.0.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 14 janedickler.lebow 2020-05-16 13:33:35 UTC
(In reply to Alex Thurgood from comment #3)
> (In reply to Xisco Faulí from comment #2)
> > @Alex, do you reproduce this issue ?
> 
> I never use Mac Mail.app as IMHO it is a pile of security-hole ridden sh**
> 
> Unable to test, sorry.
> 
> The lock file message is probably Catalina's way of telling you that LO is
> trying to step outside of the allowed jail (secure container) in which apps
> are now supposed to run. LO creates a lock file (hidden file) of the file to
> be modified when you load it into memory for the purposes of file recovery
> in the event of a crash. I'm guessing that LO is attempting to create this
> lock file in a directory that is now forbidden by Catalina's security policy.

This happened to me also when I tried to open several files in Mojave, which I installed only yesterday on my MacBook Pro. Is there some way to disable all this without doing some fancy maneuvers? The files opened just fine before yesterday, and though I know enough about my Mac to handle things, generally, I don't understand other than straightforward instructions for technology, need steps of actions and no scary stuff. (I know I sound like an idiot, but I want to be plain about what kinds of instructions you can send me and expect me to succeed in following them.)

I'm very dismayed. This never happened to me before; I am the only one using the files (not attachments, nor Apple Mail messages but I must open those also), so I shouldn't have to get permission to open them; I don't want to lock anything; and I don't want read/write only nor to have to copy any file that no longer works. Is there something I can do? I'm wishing now that I had never gone to LibreOffice. I have so many .odt files now, so if they won't open, I'll be stuck. I hope you can help me.
Comment 15 Tor Lillqvist 2020-05-16 18:07:43 UTC
Janedicker, are you saying that your comment has nothing to do with opening attachments in the Mail app? If so, then your comment is only confusing matters in this bug report, sorry. Please file a *separate* bug report for your issue, describing in as much detail as you can what you were doing and what happened. Thanks.
Comment 16 Commit Notification 2020-07-09 10:39:25 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/69e3b647d27d4fdb8243d6cca86f9287a5be6026

Revert "tdf#128526: Make the read-only notification a bit more verbose"

It will be available in 7.1.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 17 Commit Notification 2020-07-15 10:27:34 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/9d86d44665a7cc6ecd636fd2b7a817083497d2f8

Revert "tdf#128526: Make the read-only notification a bit more verbose"

It will be available in 7.0.0.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.