Document is locked for editing by: Unknown User

I just upgraded to Libreoffice 7.2.0 from 6.4.6, although I don’t think that matters in this case. While creating a document my desktop crashed. After restarting and logging back in I could not edit/save that document. I kept getting the message “Document is locked for editing by: Unknown User”. Saving or copying to a different directory didn’t help. If I told Writer to “Open Copy”, I could edit and save that copy to a different file name, but if I tried to edit that new document I had the same problem. This problem has persisted through re-logins and power downs.

Pretty much all of the “solutions” I have read about are related to Windows and removing .lock files. This is Linux, not Windows. There are no .lock files in any of the directories to which I have copied these documents. I had to complete editing my document in MS Word.

How can I fix this?

Tried resetting profile to factory. Same problem.

Tried restoring profile from before I updated LibreOffice and before I created the document(s). Same problem.

karolus: from $HOME
$ ls ./.~*
/bin/ls: cannot access ‘./.~*’: No such file or directory

same results in the directory in which the doc resides.

I’m having a lot of downtime with this issue so I need to move on. I’ve restored back to version 6.4.6.2 and the problem is gone. I can open these files without the “locked” issue. There must have been something wrong with my distro’s version 7.2.0. If I run into this problem in the future I’ll repost. FWIW I dislike posting all my comments to the OP. There is no sense of to whom or to which comment I am responding.
Also, I don’t see a button on my screen to mark this issue as closed.

I don’t know, if you are aware of this:
With linux/bash all fules starting with a dot are usually hidden. Windows used an attribute, Unix soecial file-names.

So I have to ask: Have you set your file-manager to show hidden files?
(Then you will find several files and directories starting with . in your home-directory - and may review your point on non existing .lock-files.)

To fix - I would try first to start with a new profile.
Try starting in safe-mode / without profile, creating a new file and checking, if you can edit this new file after saving.
As you system crashed there may be a problem in the profile, not in the file…

For specific help please tell your distribution, desktop and how you installed brand new 7.2.0 as all this may be related…

The description that one may edit and save to a different file name, but then that new document starts behaving the same way; and that the files are locked by “Unknown User”, - may indicate some filesystem special permissions (e.g., allowing to save, but setting owner of files to another user/group? Not an expert in Linux filesystems.) Anyway, lockfiles would specify the user (it’s what is stored inside them).

1 Like

Wanderer: without bothering with a file-manager, I am using ‘ls -a’ at the command line and there are no files beginning with a dot. Also, moving that file to a completely new (newly created) directory didn’t help and no lock file could have followed it.

What do you mean by “create a new profile”? What kind of a profile? This is Linux and I don’t know of a “safe mode” in which Linux can be started. Distribution is Slackware-Current and I installed it from the “Alien Bob” Slackware repository – a pretty authorative repository for Slackware.

mikekaganski: no special permissions:

$ ls -la
total 1600
drwxrws— 2 mfoley develop 4096 2021-08-30 23:06 ./
drwxr-sr-x 7 mfoley develop 4096 2021-08-30 22:48 …/
-rw-r----- 1 mfoley develop 607912 2021-08-30 22:38 HW3NewsletterJulAug2021.docx

The user is me: “mfoley” and this user has rw permission on this file. Note that I used ‘ls -la’ which would show any files with a leading dot.

Why did you use a “Suggest a solution” feature to clarify your question (i.e., the intended was that you edit the question and add missing information/clarifying details there, so anyone reading your question sees the whole picture, instead of the need to read through the thread (and even in unexpected “answers” section)).

https://wiki.documentfoundation.org/UserProfile

Your Profile for LibreOffice where your settings are stored, not Linux.

Fun fact: profile is also in hidden directories, starting with a dot Multiple hidden folders are usually found in any home-folder.

Follow the link MikeKaganski has given to find out more.

If you don’t have a profile for LibreOffice it will start to get interesting…

No special permissions?

Well, certainly these are not normal permissions. The current directory ./ appears to have the SETGID BIT set on group permissions (see man 1 chmod). The parent directory ../ doesn’t have write permissions for that group but also has the SGID bit set. Which shouldn’t affect directory modification of the current directory but looks odd so I’d say something may have gone awry on your file permissions unless it serves the purpose that any file created in the current directory gets the develop group assigned to be readable by any member of that group.

However, that alone does not explain why LibreOffice would think the file would be locked, but maybe points you into some direction how your system is set up. If your directory happens to be on NFS or some other network file system then also system filelocking may be involved. Or samba/smb? Davs? Cloud?

mikeaganski: thanks for the link. Not sure what you’re saying with the “Suggest a solution” comment. I’ve not posted much to this forum (and it’s been a while). I post to about a dozen forums and none have you edit the original question; all have you post following the last comment. No howto comment to that effect is listed on this page and I think that would be a bit confusing since it would be difficult to correlate a reply to a response.

Wanderer: Followed mikeaganski’s link and reset profile to factory. Problem did not go away. Still have “locked for editing.” How does LibreOffice decide if a file is locked for editing other than a .lock file?

Even if you follow the “Alternatively” part (worse), you should use comments, not answers.

This is not a forum: this is a Q&A site. Its essence is having a question and answers; any discussion happens only to improve both question and answers. The ideal final state is a nice question with all required details, and one or several answers, each of which attempt to resolve the problem, with one marked as a solution (showing that it had helped OP), and all answers being voted according to the number of users who were helped by those - hence a new asker may find such a question and have it all at hands, without trying to dig through all the discussions.

“Tomaeto” “Tomahto” … I’ve always called things like linuxquestions.org, answers.microsoft.com, serverfault.com, etc. “forums”. If you prefer “Q&A” site, OK.

If the “Comment” button had been down by the “Suggest a Solution” button, instead of being a faint gray icon above the text, I’d have used it. Again, no other “Q&A” site I’ve been to has the poster continuously modify the OP, but I can do so here.

Please do; and please refrain from posting things that sound like you are doing favor to people here who try to help you, by agreeing to follow the rules of this site.

The comments are also available as the icons shown in my screenshot above.

And while those sites that you cite indeed are (or look like) forums, sites like stackoverflow or ask ubuntu are not. This one is expected to be more like the latter.

I will stop posting here, hoping that it’s enough of describing how to use the site, and that you will get more relevant answers from other people.

What prints:

ls ./.~* 

if there is some output:

rm ./.~*