Ask Your Question
1

Ho to solve "The lock file could not be created for exclusive access by libreoffice ..." problem?

asked 2020-02-18 14:16:20 +0200

pac gravatar image

updated 2020-02-18 14:17:26 +0200

When opening a calc file in LO 6.3, following message appears: "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."

Using LO 5.4 the file can be opened, edited and saved without any issues.

I suppose this problem is related to some into LO newly implemented security/privacy policy but haven't found any clue how to solve it yet. (I don't want to add write permission to everybody for the directory where the file is stored)

  • opensuse leap 15.1
  • LibreOffice 6.3.3.2.0 30(Build:2) (currently installed, but the same problem persists since LO 6 appeared)
  • the file is accessed by nfs in LAN
  • file permissions are -rw-rw---- 1 root users (file is owned by root to prevent accidental deletion by a user, users attempting the file belong to group "users")
  • permissions of the directory where the file is located: drwxr-x--- 8 root users (users are not allowed to write to this dir)
  • there is enough free disk space
edit retag flag offensive close merge delete

Comments

When I set the UseLocking to False, the file opens but can not be saved after modification. Why? "Error saving the document: Write Error. The file could not be written."

pac gravatar imagepac ( 2020-02-19 08:30:00 +0200 )edit

Because save procedure tries to create a temporary file named similiar to lu14312t4sj0k.tmp and you have set no permission to write (Don't ask me about the purpose of this temporary file, which obviously is not created on LibreOffice 5.4 and earlier). This got nothing to do with the UseLocking setting.

Opaque gravatar imageOpaque ( 2020-02-19 11:00:32 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2020-02-18 15:40:08 +0200

Opaque gravatar image

updated 2020-02-19 13:22:16 +0200

Hello,

in fact you wrote the solution into parenthesis, when stating:

permissions of the directory where the file is located: drwxr-x--- 8 root users (users are not allowed to write to this dir)

The lock file .~lock.<fname># needs to be created within the same directory where the file to be opened/edited is located. If group users has no write permission then members of that group cannot create files within that directory, lock file cannot be created and finally you get what you get. Thus chmod g+w <dir_where_file_is_located> will solve your issue.

Your claim in your question Using LO 5.4 the file can be opened, edited and saved without any issues is true, since LibreOffice 5.4 silently suppresses the error, that it can't create the lock file and starts over without a lock file.

(I don't want to add write permission to everybody for the directory where the file is stored)

If you don't want to do this, your only choice is to disable locking at all (Go toTools -> Options -> LibreOffice -> Advanced -> Button: Open Expert Configuration -> Search: UseLocking and set org.openoffice.Office.Common\Misc\UseLocking to false )

Update It just turned out that the solution eliminates the warning on opening the file, but you still won't be able to save the file using LibreOffice version 6.x (not sure when this starts) since - contrary to LibreOffice 5.4 and earlier - the save procedure tries to create a temporary file within the write-disabled directory (luxxxxxxxxx.tmp). Thus the save fails due to the permission.

Hope that helps.

If the answer helped to solve your problem, please click the check mark (✔) next to the answer.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-02-18 14:16:20 +0200

Seen: 2,174 times

Last updated: Feb 19 '20