Bug 55004 - backup copy fails when using share / samba (if nobrl cifs mount option not used)
Summary: backup copy fails when using share / samba (if nobrl cifs mount option not used)
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: high normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: haveBacktrace
: 62556 67827 80539 136592 (view as bug list)
Depends on:
Blocks: AutoSave-AutoRecovery-Backup Network
  Show dependency treegraph
 
Reported: 2012-09-17 10:07 UTC by marting
Modified: 2022-07-12 14:47 UTC (History)
13 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
bt with debug symbols (13.21 KB, text/plain)
2022-07-01 11:54 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description marting 2012-09-17 10:07:10 UTC
Hi! 

I think I found a bug:

Working with a file from samba and option "Always create backup copy" (tools -> options -> Load/Save -> General) always leads to the error: 

Error saving the document <file>: 
Error creating object.
Could not create backup copy.

the backup file _is_ created but zero bytes:

ls -l ~/.config/libreoffice/3/user/backup/

-rw-r----- 1 <user> <group> 0 Sep 17 12:02 <file>.bak


Option disbled: works
local file instead of samba file: works


thanks!

 greets,

 Martin
Comment 1 Thomas Hackert 2013-06-28 13:22:15 UTC
Hello Martin, *,
have you tried a newer version of LO than 3.6.0.4? Does your problem occurs there, too? I have no samba here to test, so this is only a little reminder ... ;)

If you error still occur:
1. Could you give us some more details like with distro on what archtecture are you using?
2. How do you connect your samba client to the server? And which samba version on the client and server are you using?
3. Which OS do you want to use via samba?
4. Would you be so kind to start LO from commandline to see, if there is any error message, please? And maybe with "soffice --backtrace" and attach the backtrace log to this bug?

Sorry for the inconvenience
Thomas.
Comment 2 marting 2013-06-28 14:50:46 UTC
(In reply to comment #1)
> Hello Martin, *,
> have you tried a newer version of LO than 3.6.0.4? Does your problem occurs
> there, too? I have no samba here to test, so this is only a little reminder
> ... ;)

Same error using Version 3.6.6.2 (Build ID: 3.6.6.2-9.fc18)

> 
> If you error still occur:
> 1. Could you give us some more details like with distro on what archtecture
> are you using?

Ubuntu when I reported the bug, fc18 now.

> 2. How do you connect your samba client to the server? And which samba
> version on the client and server are you using?

cifs mount (replaced some private parts with '*'):

//samba.*****.de/home on /samba type cifs (rw,nosuid,nodev,noexec,relatime,vers=1.0,sec=ntlmssp,cache=strict,unc=\\samba.***domain****\home,username=****,domain=****,uid=1000,forceuid,gid=0,noforcegid,addr=***IP***,file_mode=0644,dir_mode=0755,nounix,rsize=61440,wsize=65536,actimeo=1)

> 3. Which OS do you want to use via samba?
? Don't get it: client is Linux fc18, server is Red Hat Enterprise Linux Server release 6.1 (Santiago)
samba-3.5.6-86.el6_1.4.x86_64

> 4. Would you be so kind to start LO from commandline to see, if there is any
> error message, please? And maybe with "soffice --backtrace" and attach the
> backtrace log to this bug?

soffice --backtrace
GNU gdb (GDB) Fedora (7.5.1-38.fc18)
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/lib64/libreoffice/program/soffice.bin...Reading symbols from /usr/lib/debug/usr/lib64/libreoffice/program/soffice.bin.debug...done.
done.
log will be saved as gdbtrace.log, this will take some time, patience...
(gdb) 

less gdbtrace.log 
warning: Currently logging to gdbtrace.log.  Turn the logging off and on to make the new setting effective.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
warning: "/usr/lib/debug/usr/lib64/libicudata.so.49.1.1.debug": separate debug info file has no debug info
[New Thread 0x7ffff7fa3700 (LWP 6496)]
[New Thread 0x7fffedb44700 (LWP 6497)]
[New Thread 0x7fffed343700 (LWP 6498)]
[New Thread 0x7fffe6c56700 (LWP 6501)]
[New Thread 0x7fffe5ad9700 (LWP 6502)]
[New Thread 0x7fffe5217700 (LWP 6503)]
Detaching after fork from child process 6504.
[New Thread 0x7fffd3fff700 (LWP 6506)]
[Thread 0x7fffd3fff700 (LWP 6506) exited]
[Thread 0x7fffedb44700 (LWP 6497) exited]
[New Thread 0x7fffedb44700 (LWP 6525)]
[New Thread 0x7fffd3fff700 (LWP 6526)]
[New Thread 0x7fffd1483700 (LWP 6527)]
[Thread 0x7fffd3fff700 (LWP 6526) exited]
[Thread 0x7fffd1483700 (LWP 6527) exited]
[New Thread 0x7fffd1483700 (LWP 6528)]
[New Thread 0x7fffd3fff700 (LWP 6529)]
[Thread 0x7fffd1483700 (LWP 6528) exited]
[New Thread 0x7fffd1483700 (LWP 6538)]
[Thread 0x7fffd3fff700 (LWP 6529) exited]
[Thread 0x7fffd1483700 (LWP 6538) exited]
[New Thread 0x7fffd1483700 (LWP 6539)]
[New Thread 0x7fffd3fff700 (LWP 6540)]
[Thread 0x7fffd3fff700 (LWP 6540) exited]
[New Thread 0x7fffd3fff700 (LWP 6541)]
[Thread 0x7fffd3fff700 (LWP 6541) exited]
[Thread 0x7fffd1483700 (LWP 6539) exited]
[New Thread 0x7fffd1483700 (LWP 6542)]
[Thread 0x7fffd1483700 (LWP 6542) exited]
[New Thread 0x7fffd1483700 (LWP 6545)]
[New Thread 0x7fffd3fff700 (LWP 6546)]
[Thread 0x7fffd3fff700 (LWP 6546) exited]
[Thread 0x7fffd1483700 (LWP 6545) exited]
[New Thread 0x7fffd1483700 (LWP 6547)]
[Thread 0x7fffd1483700 (LWP 6547) exited]
[Thread 0x7fffe6c56700 (LWP 6501) exited]
[New Thread 0x7fffe6c56700 (LWP 6548)]
[Thread 0x7fffe6c56700 (LWP 6548) exited]
[New Thread 0x7fffe6c56700 (LWP 6549)]
[Thread 0x7fffe6c56700 (LWP 6549) exited]
[Thread 0x7fffed343700 (LWP 6498) exited]
[Thread 0x7fffe5217700 (LWP 6503) exited]
[Thread 0x7ffff7fa3700 (LWP 6496) exited]
[Thread 0x7fffe5ad9700 (LWP 6502) exited]
[Thread 0x7ffff7fb4980 (LWP 6492) exited]
[Inferior 1 (process 6492) exited normally]
/usr/lib64/libreoffice/program/gdbtrace:8: Error in sourced command file:
No stack.
Missing separate debuginfos, use: debuginfo-install gtk2-2.24.18-1.fc18.x86_64
quit

unfortunately this seems to be not available:

~>sudo debuginfo-install gtk2-2.24.18-1.fc18.x86_64
[...]
No debuginfo packages available to install
Comment 3 Thomas Hackert 2013-07-03 16:06:55 UTC Comment hidden (obsolete)
Comment 4 marting 2013-07-04 11:35:34 UTC Comment hidden (obsolete)
Comment 5 Jacques Guilleron 2013-07-04 12:59:59 UTC
Hi marting,

We met same issue on Windows, but this has been fixed recenntly. Directory for backup was mssing. Please see:
Bug 65501 - FILESAVE Can not save a modified document with backups enabled

Thank you,

Jacques
Comment 6 Uwe Dippel 2013-08-06 13:00:05 UTC
It is a bit of a disappointment, that this bug has been creeping around since 2006. </rant>

I can confirm this. And I fail to have a good workaround. And I can confirm that the backup directory exists. And I can add some remarks:
1. It always works when I save to a new file name on the folder (mounted cifs)
2. It never works when I 'save' to the then existing file name. The .bak is actually created, on the local drive, but with a size of 0. Then it fails to update the file on the shared folder.
3. The best of the worse workarounds: I create two almost identical files on the drive, and 'toggle' to which I store; because if I have file1 open and work on it, I can always save as file2, and when I have file2 open, I can always save as file1. But having file1 open, I cannot save to file1 without the error message coming up; same with file2. Conclusion: it only fails if one wants to store to the same, open, file.
Comment 7 Maxim Monastirsky 2013-08-13 05:11:01 UTC
*** Bug 62556 has been marked as a duplicate of this bug. ***
Comment 8 Maxim Monastirsky 2013-08-13 05:11:40 UTC
*** Bug 67827 has been marked as a duplicate of this bug. ***
Comment 9 Maxim Monastirsky 2013-08-13 05:13:11 UTC
Changed version to oldest known (from bug 62556)
Comment 10 HansPL 2013-10-07 11:58:03 UTC
CONFIRMED here with LO 4.0.3 and LO 4.1.2.3 on Linux Mint Debian Ed.,  also on Win7.  Didn't really notice it with LO 3.x before,  but now it is permanent:  

Editing and saving a writer or calc file on a local ext4 or NTFS disk works;  the backup file on a local NTFS disk is correctly created.  All fine so far.

Editing and saving a writer or calc file on a CIFS mount (our common file server) fails with "Backup could not be created" while the backup file is created with a size of 0 (regardless whether it existed before or not).  Saving with backup disabled works.  

Moving my ~H:/config/libreoffice/4 and /3 away (thus forcing LO to create a  new blank profile) does not help.  

I regard this as a rather severe bug since it effectively blocks the use of the backup feature!  Because of this bug I just upgraded to 4.1.2.3,  but to no avail.  

Hans
Comment 11 HansPL 2013-10-07 12:09:20 UTC
FWIW:  our CIFS server is openSUSE 12.1, Samba version 3.6.3-34.11.1-2788-SUSE-SL12.1-x86_64 with unix extensions = no
Comment 12 ign_christian 2014-06-26 03:46:57 UTC
*** Bug 80539 has been marked as a duplicate of this bug. ***
Comment 13 HansPL 2014-09-16 07:12:01 UTC
Two years now and no response…? 

I'd like to raise Importance to Major, since this bug effectively blocks LO from using backup files in a company environment!  

Hans
Comment 14 Eugene 2014-09-17 08:51:28 UTC
+1
It's huge inconvenience in a corporative environment/
Comment 15 Cor Nouws 2014-09-17 11:30:30 UTC Comment hidden (obsolete)
Comment 16 HansPL 2014-09-17 11:35:35 UTC Comment hidden (obsolete)
Comment 17 Cor Nouws 2014-09-17 12:21:21 UTC Comment hidden (obsolete)
Comment 18 Eugene 2014-09-17 16:12:40 UTC Comment hidden (obsolete)
Comment 19 HansPL 2014-09-17 18:10:09 UTC Comment hidden (obsolete)
Comment 20 Eugene 2014-09-18 08:30:15 UTC Comment hidden (obsolete)
Comment 21 Cor Nouws 2014-09-19 17:39:53 UTC
(In reply to comment #20)

> I just found in my notes that I reported this bug for OOo-2.x

Thanks Eugene
Comment 22 QA Administrators 2015-10-14 19:57:24 UTC Comment hidden (obsolete)
Comment 23 marting 2015-11-06 08:43:48 UTC
Bug still the same on Fedora 23:

libreoffice-*-5.0.3.1-1.fc23.x86_64

backupfile: ~/.config/libreoffice/4/user/backup

though I wonder "4" is still used. I expected "5".

Error message and a zero byte backupfile are still the same.

I tried a different samba server (NAS), mounted:
type cifs (rw,relatime,vers=1.0,sec=ntlm,cache=strict,username=<****>,uid=1000,forceuid,gid=1003,forcegid,addr=<IP>,file_mode=0755,dir_mode=0755,nounix,serverino,mapposix,rsize=61440,wsize=65536,actimeo=1)
Comment 24 Eugene Saenko 2016-02-11 11:46:19 UTC Comment hidden (obsolete)
Comment 25 Eugene Saenko 2016-02-11 12:20:09 UTC
Correction.

Backup file created, but length=0:
[ses@ses-comp backup]$ pwd
/home/ses/.config/libreoffice/4/user/backup
[ses@ses-comp backup]$ ls -l
total 0
-rwxr-xr-x 1 ses ses 0 Feb 11 14:33 qq.bak

Fnd I don't understand why version subdirectory is "4" not "5".
Comment 26 HansPL 2016-05-17 12:09:31 UTC
Still defunct in 5.1.2.2.0+ / Linux!  

I would really wish that the LO team would spend time on fixing all those annoying year-old known bugs instead of just ignoring them and instead unnecessarily adding gimmicks or changing the UI…  

It's four years now and this bug still is a major hindrance in a company environment. 

If you really want LO not to be laughed at by all those MS Office users, please do give care and attention to the details.  I'm a strong advocate for FOSS, but I've ceased recommending LO to people using MS Office.
Comment 27 Carlos Le Mare 2016-11-30 20:46:42 UTC
To us happened the same. Tjhe problem start yesterday when we got a power failure and some files opened over the samba network got size 0, and when we start libreoffice again it didn't ask to restore the file. So we went to the directory where the backups are stored (locally in the PC), but there are no bak files.

Server Ubuntu 14.04.2 LTS
samba [2:4.3.9+dfsg-0ubuntu0.14.04.3]

Client Ubuntu 16.04 LTS
LibreOffice 1:5.1.4-0ubuntu1 (Id. de compilación)
Comment 28 Alex Thurgood 2016-12-01 11:45:58 UTC
I encountered this problem years ago when using OpenOffice.org 2.X saving to a SMB server share on a Linux server at the time with a support contract. It was unsolvable then, and the only workaround was to turn off LibreOffice automatic backups.
Comment 29 HansPL 2016-12-01 13:01:22 UTC Comment hidden (no-value)
Comment 30 Cor Nouws 2016-12-02 13:58:13 UTC Comment hidden (obsolete)
Comment 31 Uwe Dippel 2017-02-14 15:15:04 UTC
"Devs are constantly busy with all kind of bugs and necessary improvement or modernizing stuff."

Who defines necessary improvements and the relevance of 'modernizing stuff'?

To me it sounds like doctors leaving a heart patient on the side in order to operate an ingrowing toe nail. 

My frustration might come from me evangelizing FOSS for the last 20 years, using it throughout. This bug has been creeping around for the last around 9 years now, prevents from backups in cases of shared drives, and gets no attendance. 
Though time is on hand, plenty, to implement a ribbon interface.
Comment 32 Cor Nouws 2017-02-14 15:45:35 UTC
(In reply to Uwe Dippel from comment #31)

> Who defines necessary improvements and the relevance of 'modernizing stuff'?

People working on it. Either voluntary, or because they get paid.

> Though time is on hand, plenty, to implement a ribbon interface.

... and in addition: probably people with different skills and interest.
Comment 33 Cor Nouws 2017-02-14 15:47:26 UTC
(In reply to Uwe Dippel from comment #31)

> My frustration might come from me evangelizing FOSS for the last 20 years,
> using it throughout. This bug has been creeping around for the last around 9
> years now, prevents from backups in cases of shared drives, and gets no
> attendance. 

But I understand your feelings, no doubt.
As FOSS enthusiast you may also know how development works?
Comment 34 Uwe Dippel 2017-02-14 16:47:43 UTC
Yes, thanks for the reminder!
Actually I used to be a developer myself, voluntarily and in some small portions paid. 
With both hats I tried to get priorities right: not niceness over function.
No project that values eye candy higher than debugging showstoppers is sustainable.

And I want LibreOffice to be sustainable, and some day before I die usable completely without having to resort to Microsoft WORD.
Comment 35 tomraymondtom 2018-01-18 21:58:15 UTC
Getting same bug on Windows 10.
LIBREOFFICE 5.4.4.2

Saving the document 
Error creating object
could not create backup copy

Received this message after multiple changes and saves of the same document.
Trying to save backup on a DVD drive.
Comment 36 marting 2018-05-02 07:54:16 UTC
still same issue with:

Version: 6.0.3.2
Build-ID: 6.0.3.2-5.fc28
Comment 37 iwi900 2019-08-30 09:44:54 UTC
Still same issue with 6.3.0.4.

However, there is a 9 year old (!) report (http://blog.gresch.de/2010/06/03/openofficesambacifs-probleme-could-not-create-backup-copy/) that suggests adding the "nobrl" option (no byte range lock) to the cifs mount options.

Given that this bug could not be fixed for a decade, but affects many users and this option bypasses it (at least in my case), wouldn't it make sense to add a hint like "(maybe try mount option nobrl?)" to the error message?
Comment 38 Julien Nabet 2020-09-09 11:46:15 UTC
*** Bug 136592 has been marked as a duplicate of this bug. ***
Comment 39 Alexandre Laurent 2021-03-30 21:11:09 UTC
Hello,

I am encountering this same issue. Here, some details:
- I am using Linux Manjaro (MATE Edition)
- I am using LibreOffice 7.1.1.2
- I have a SAMBA server on Armbian 21.02.3 Buster with Linux 5.10.21-rockchip64
- version SAMBA 4.9.5 (as reported by smdb -V)
- smb.conf is simple as possible (just specifying read only = no)
- on client, the share is mounted using AutoFS.
- the resulting mount is the following: 

//192.168.1.150/Data on /mnt/Data type cifs (rw,relatime,vers=3.1.1,cache=strict,username=alexandre,domain=WORKGROUP,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.1.150,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1,_netdev)
Comment 40 Alexandre Laurent 2021-03-30 21:17:48 UTC
I have noticed something else:
- if I open a file on the samba share with LibreOffice and I copy/paste the file using Caja (MATE file explorer), I have the following error: "Error during "splicing" operation on the file. Permission denied".
Comment 41 Julien Nabet 2022-06-18 13:51:25 UTC
On pc Debian testing x86-64 with LO Debian package 7.3.4.2, I don't reproduce this.

Here what I did:
- created a local samba share
- launched Writer and create a brand new file
- saved it with name "test1.odt" on the local samba share
- enabled option "Always create backup copy"
- relaunched LO Writer
- opened test1.odt
- added some text
- saved it again
=> I got a non null file ~/.config/libreoffice/4/user/backup/test1.bak (8,7K).

Did I miss something or could someone may give a new try with LO 7.3.4?
Comment 42 EricI 2022-06-30 01:27:56 UTC
This is definitely a bug in LO since at least version 7.0
Please see my thread regarding this issue. You might find a few useful information there.

https://ask.libreoffice.org/t/error-while-saving-documents-bugs/79081
Comment 43 marting 2022-07-01 10:30:26 UTC
10 years later :)

Still the same issue with libreoffice 7.3.4.2
Ubuntu 22.04

smb from NAS:
cifs    vers=1.0,x-systemd.automount,noauto,file_mode=0640,dir_mode=0750,credentials= ...

If this is a SMBv1 problem, this issue could be ignored. But I don't think so.
Comment 44 HansPL 2022-07-01 10:58:30 UTC
The "nobrl" (no byte range lock) cifs mount option works for me (see comment 37 https://bugs.documentfoundation.org/show_bug.cgi?id=55004#c37 ).  

From my /etc/fstab:  cifs   vers=3.0,nobrl,users,noauto,credentials=…

Still, I see this as a bug to be fixed.
Comment 45 Julien Nabet 2022-07-01 11:04:11 UTC
Thank you for the feedback, I put it back to NEW since people can reproduce this.

Personnally I can't reproduce this.
In my /etc/samba/smb.conf, there's no line resembling to
systemd.automount,noauto,file_mode=0640,dir_mode=0750,credentials
I suppose it's because I know too little about smb so can't help here=>uncc myself.

Certainly someone may have some idea in the next 10 years :-)
Comment 46 marting 2022-07-01 11:20:57 UTC
Ah, thanks  HansPL!

nobrl is at least a work around!

No error occurs and a (non zero byte) backup file will be created:

tux :: 4/user/backup » ls -altr
insgesamt 20
-rw-r----- 0 Jul  1 12:19 test.bak
-rw-r----- 9175 Jul  1 13:12 test2.bak

I think, if you work with nautilus/etc without /etc/fstab entry, smb is mounted as gvfs and this also works.
Comment 47 Julien Nabet 2022-07-01 11:54:01 UTC
Created attachment 181067 [details]
bt with debug symbols

Re reading about all this, I just remind I use Open/Remote instead of mounting the samba share.

I could reproduce this with master sources updated today and attached a bt at the moment of the throw.