Bram Matthys
2014-Mar-17 17:21 UTC
[Samba] 'document has been locked for editing by another user' - medium latency / limited bw connection issues?
Hi, I hope some of you have been in a similar situation and can shed some light on this: I have a VPN connection to a Samba 4.1.4 server and when I use Word 2010 on a W7 client to open an existing file I often get the following error: "document.docx has been locked for editing by another user." I should clarify that the document is not in use by anyone (confirmed by smbstatus), and this happens on several documents.. including ones I just created minutes ago myself. I get this either 1) directly before I see the document (rarely), or 2) after I clicked on 'Enable editing' due to being in 'Secure Display' mode ('this file is from an internet location and is possibly unsafe'). I found out that if I wait long enough after opening the document, say: 10 seconds to be safe, then I can pretty much always click on 'Enable Editing' and edit the document without any errors. I then used tcpdump, and there's indeed still a lot of traffic after I see the document (but before I click 'enable editing'). If I wait for the traffic to settle, then I can open the document with no problems. I disabled the 'Windows Search' (Indexing) service, I temporarily disabled my anti-virus software... because I suspected either of them could be accessing the file and thus causing a locked file, but it all didn't help. The connection itself has a ping of around 20ms (I suppose that isn't high latency, but much higher than LAN, anyway), and a bandwidth of xxx kb/s. The test document is just 13kB, though. Before I realized I simply had to wait, I started playing with 'strict locking = no', 'kernel oplocks = no', 'kernel share modes = no', even to the point of 'locking = no' (but that's dangerous). This all didn't help. Actually disabling oplocks seemingly made the issue even worse, perhaps due to Windows no longer caching the file and thus requiring more bandwidth / packets = longer delay before I can use the file. My question: is there any setting I can tweak to resolve or workaround this issue? Either on the Samba side, or the Windows client side. I can edit .txt files with notepad without any problems, but then again notepad doesn't do any locking.. On a LAN pc I don't have any locking issues. I would be surprised if I were the only one with this issue, VPN to Samba and the use of Microsoft Office should all be quite common :) Thanks, Bram. -- Bram Matthys Software developer/IT consultant syzop at vulnscan.org Website: www.vulnscan.org PGP key: www.vulnscan.org/pubkey.asc PGP fp: EBCA 8977 FCA6 0AB0 6EDB 04A7 6E67 6D45 7FE1 99A6
Matthias Müller
2014-Mar-17 21:54 UTC
[Samba] 'document has been locked for editing by another user' - medium latency / limited bw connection issues?
Am Montag 17 M?rz 2014 schrieb Bram Matthys:> Hi, > > I hope some of you have been in a similar situation and can shed some > light on this:We have a similar situation here in the company.> I have a VPN connection to a Samba 4.1.4 server and when I use Word 2010We have normal LAN and users are sometimes changing some config files of the CAD system. That means changing plain text files with either Notepad, Notepad++, gvim or Wordpad. The user can open the file but is not able to save a changed file.> on a W7 client to open an existing file I often get the followingalso W7 clients running the CAD system and the editors for changing> error: "document.docx has been locked for editing by another user."Similar message If the user creates the file new than he can save it. But if any user in the same UNIX primary group changed the file, the original creator is not able to edit the same file any more. Nor is he able to remove or copy the files. He can create new files and then he is able to do everything (delete, copying, editing). The share that stores the files is on the AIX machine. When the user logs into this machine he can do whatever he wants with the files according to the UNIX file permissions. Even another user has changed this file he still can edit the original file, which is not possible when this is done on the Windos client. Samba version 3.5.14 OS of the samba server: AIX 6.1.0.0 OS of client: Windows 7 -- Mit freundlichen Gr??en Matthias M?ller (Benutzer #439779 im Linux-Counter http://counter.li.org) PS: Bitte senden Sie als Antwort auf meine E-Mails reine Text-Nachrichten! -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 490 bytes Desc: This is a digitally signed message part. URL: <http://lists.samba.org/pipermail/samba/attachments/20140317/952a1ff8/attachment.pgp>
Bram Matthys
2014-Mar-21 21:25 UTC
[Samba] 'document has been locked for editing by another user' - medium latency / limited bw connection issues?
Hi, First of all, thanks Matthias for your response. It does however seem like your issue is unrelated and has to do with permissions. I saw a few others responded, hope it helps. On to my own issue, as I found a fix: Bram Matthys wrote, on 17-3-2014 18:21:> I have a VPN connection to a Samba 4.1.4 server and when I use Word 2010 on > a W7 client to open an existing file I often get the following error: > "document.docx has been locked for editing by another user." > I should clarify that the document is not in use by anyone (confirmed by > smbstatus), and this happens on several documents.. including ones I just > created minutes ago myself. > > I get this either 1) directly before I see the document (rarely), or 2) > after I clicked on 'Enable editing' due to being in 'Secure Display' mode > ('this file is from an internet location and is possibly unsafe'). > > I found out that if I wait long enough after opening the document, say: 10 > seconds to be safe, then I can pretty much always click on 'Enable Editing' > and edit the document without any errors.Apparently when the office document is displayed and the 'Enable Editing' button is visible, the file is still being read by Office in the background. Even if it's a very short file.. Normally not a problem, but when you click on 'Enable Editing' it is still being locked by Office itself and says it is in use. Rather silly, really... I added the IP of my \\a.b.c.d\something connection to Intranet sites (this is configured in internet explorer) to get rid of the warning in Office. I didn't really mind the warning so I didn't think of this earlier. However by doing this I also took care of the file-in-use-problem.. as the document is opened in edit mode right away and thus the whole problem of above is avoided. I've had no complaints since. Regards, Bram. -- Bram Matthys Software developer/IT consultant syzop at vulnscan.org Website: www.vulnscan.org PGP key: www.vulnscan.org/pubkey.asc PGP fp: EBCA 8977 FCA6 0AB0 6EDB 04A7 6E67 6D45 7FE1 99A6