Score:0

Samba share (cifs utils) and Libreoffice: Files get deleted under particular circumstances

sc flag

Our company has experienced a terrible bug when dealing with Libreoffice and samba shared documents and we can reproduce it every time.

What we've got:

Samba share on a windows PC (we tried with linux samba share and it's the same). Just one account to access it, so all PCs use the same login and password to access the share, but it doesn't matter coz the bug happens even when using different samba accounts.

Several Ubuntu 20.04 PCs and several Windows 10 PCs.

Ubuntu 20.04 PCs have access to the share via cifs utils (fstab) : //srv-dc-02/uc /mnt/EDU2022 cifs credentials=/etc/win-credentials-1,uid=1000,gid=1000,dir_mode=0777,file_mode=0777,iocharset=utf8,nobrl,_netdev 0 0

The version of Libreoffice doesn't matter. We tried the default Ubuntu 20.04 LO version and the latest one.

Steps to reproduce this bug:

Ubuntu User1 opens a document and starts working on it.

Ubuntu User2 opens the same document in "read only" or "copy" mode.

Ubuntu User1 tries to save the file and immediately gets "the file is missing" error.

At this point the file is deleted from the samba share.

If Ubuntu User2 closes the read only version of the file, then Ubuntu User1 can actually save the file and restores it on the samba share. if Ubuntu User1 closes the opened file it permanently disappears from the share.

This bug is only experienced when Ubuntu+Ubuntu PCs are interacting with the share. If it's Ubuntu+Windows the bug doesn't happen.

Is there a way to fix this?

David avatar
cn flag
With the multi access at the same time it gets confused and kills the file. Not surprised. Not sure you can do anything about this the way you access the files.
Alexander de Lioncourt avatar
sc flag
This is not how it is supposed to work. No one is asking about a shared file editing. Only one person can edit a file and others can view it in a read-only mode. And it is working properly when it comes to using Linux-Windows PCs.. The issue only arises if we have 2 Linux-Linux users.
Score:0
gi flag

You do not seem to have Samba involved here. You are mounting something from a Windows machine using cifs-utils, which has nothing to do with Samba.

You need to find out how Windows does 'oplocks', these allow the originator to take control of files and 'lock out' others from doing more than reading. You also need to find out how Windows etc opens files in programs like Libreoffice, which tends to go like this: Open file, create temp file, delete original file, work on file, write new file when closing and delete temp file.

Finally, I repeat, none of this has anything to do with Samba, or did you mean SMB ?

Alexander de Lioncourt avatar
sc flag
Yeah I meant smb
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.