Cannot create lock file on ubuntu

I cannot open ods files to write - every one comes up with a write lock. I am on a newly loaded (2 days ago) ubuntu 24.4, libreoffice 24.2.5.2. Existing ods files will not open and new ones cannot be saved because of the lock file write error. I have removed and reinstalled libreoffice, checked that I have write access to all directories in the path to .config/libreoffice, and manually deleted all lock files. The lock files are showing up in a ~/snap subdirectory so I tried adding ~/.config/libreoffice in case it was looking there. I also went through the snap directory tree changing permissions to see if that would work.

Where is the locking taking place? I’ve deleted all .lock files, and the only other things search has turned up is for windows. I’ve spent several hours on this with no progress and lots of frustration. Can file locking be turned off? I’m the only user of this machine so there is little chance of conflict

Usually this files go in the same folder, as the file you open, not “somewhere else”.
I can only guess, but maybe the snap-container has no write-privileges and uses/is redirected to a temporary/safe place instead. But then it would not help to switch off file-locking, if you are not allowed to change any file.

Thanks for the suggestion; I did make sure there were both owner and group permission up the branch to the directory the files were in. I also tried writing in the home directory, and changing all permissions to 777. Originally I was using spreadsheets, but I tried and documents have the same problem.

This may suggest something: when I try writing the error is “Error saving the document test: Object not accessible. The object cannot be accessed due to insufficient user rights”. I looked in the proc file system. The program is running in my home directory:

$ sudo ps auxw | grep ibre
russell   190748  0.0  0.0   4972  3840 pts/0    S+   11:44   0:00 /bin/bash /snap/libreoffice/324/libreoffice.wrapper
russell   190801  1.3  1.7 2023448 514004 pts/0  Sl+  11:44   0:14 /snap/libreoffice/324/lib/libreoffice/program/soffice.bin
russell   191511  0.0  0.0  12372  2432 pts/1    S+   12:02   0:00 grep ibre
$ sudo ls -ld /proc/190801/cwd
lrwxrwxrwx 1 russell russell 0 Jul 30 11:50 /proc/190801/cwd -> /home/russell

and (of course) I have full read and write permissions there. One thing looks like it might be odd: when I look at the open files I see:

$ sudo ls -l /proc/190801/fd
total 0
...
lr-x------ 1 russell russell 64 Jul 30 12:08 53 -> '/home/russell/.local/share/gvfs-metadata/root (deleted)'
lrwx------ 1 russell russell 64 Jul 30 12:08 66 -> '/memfd:pulseaudio (deleted)'
lr-x------ 1 russell russell 64 Jul 30 12:08 90 -> '/home/russell/.local/share/gvfs- metadata/root-791e31ce.log (deleted)'
...
$ 

These files are deleted - I do have read/write privilege in /home/russell/.local/share.

I also looked at proc/…/environ, and found everything looked OK - variables TMPDIR and TEMPDIR both exist and both pointed to writable directories.

This is really frustrating - I actually loaded freeoffice so at least I can work. It is hard to believe that a new, standard ubuntu machine with a new, standard libreoffice can have this problem. I have literally done nothing since the load but apt install a few programs and customize a few user settings.

1 Like