
Hi all, I am using Libre Office wordprocessor on Kubuntu 13.04. My data is stored on a NAS (Synology DS213+) and accesses using NFS. When trying to access files from the NAS, LibreOffice locks up and freezes. There are no problems with any other programs accessing data (including Email etc) . Copying a file to the local computer allows it to be opened OK by LibreOffice, so it appears to be a problem with LibreOffice and networking. I upgraded Kubuntu from 12.10 to 13.04 and upgraded the NAS (from a DS209) at about the same time so can't be certain which one is causing the problem. However, as all other programs are accessing OK I would suspect it is LibreOffice. Has anyone else experienced this? Anywhere I should look? Thanks Bob

On Thu, Jul 11, 2013 at 10:03:54AM +1000, Bob wrote:
I am using Libre Office wordprocessor on Kubuntu 13.04. My data is stored on a NAS (Synology DS213+) and accesses using NFS.
When trying to access files from the NAS, LibreOffice locks up and freezes. There are no problems with any other programs accessing data (including Email etc) . Copying a file to the local computer allows it to be opened OK by LibreOffice, so it appears to be a problem with LibreOffice and networking.
that sounds very much like an NFS locking problem. Libre Office is trying to lock the file so it has exclusive Write access to it while it's open.
I upgraded Kubuntu from 12.10 to 13.04 and upgraded the NAS (from a DS209) at about the same time so can't be certain which one is causing the problem. However, as all other programs are accessing OK I would suspect it is LibreOffice.
most other programs probably aren't trying to get an exclusive lock on the opened files.
Has anyone else experienced this? Anywhere I should look?
a google search for 'libre office NFS freeze' reveals the following as the first result. It's for Open Office rather than Libre Office, but they're both forked from the same code base: http://forum.openoffice.org/en/forum/viewtopic.php?f=16&t=40846 it's from back in 2011, so it might not be the same problem. it links to another post on ubuntuforums.org, which suggests either a) mounting the NFS share with the 'nolock' option, to disable locking or b) modifying the wrapper script that starts up Libre Office so that the 'SAL_ENABLE_FILE_LOCKING=1' variable setting is commented out. I'd guess setting it to 0 would work as well. http://ubuntuforums.org/showthread.php?t=1645957 craig -- craig sanders <cas@taz.net.au> BOFH excuse #50: Change in Earth's rotational speed

On Thu, Jul 11, 2013 at 10:42:05AM +1000, Craig Sanders wrote:
Has anyone else experienced this? Anywhere I should look?
a google search for 'libre office NFS freeze'
the second search result was the LibreOffice 4.0 ReadMe which says: http://www.libreoffice.org/get-help/readme ---------------------------------------------------------------------- File Locking ---------------------------------------------------------------------- File locking is enabled by default in LibreOffice. On a network that uses the Network File System protocol (NFS), the locking daemon for NFS clients must be active. To disable file locking, edit the soffice script and change the line "export SAL_ENABLE_FILE_LOCKING" to "# export SAL_ENABLE_FILE_LOCKING". If you disable file locking, the write access of a document is not restricted to the user who first opens the document. Warning: The activated file locking feature can cause problems with Solaris 2.5.1 and 2.7 used in conjunction with Linux NFS 2.0. If your system environment has these parameters, we strongly recommend that you avoid using the file locking feature. Otherwise, LibreOffice will hang when you try to open a file from a NFS mounted directory from a Linux computer. I think the issue is a lot more wide-spread than is suggested here - i doubt if your NAS is running Solaris. and NFS v2 is truly ancient. v3 has been the default for ages. hmmm. another solution might be to check if your NAS can do NFS v4 and tell your Linux machine to mount it with that instead of NFS v3. you can use rpcinfo to find out what versions of NFS are available on your NAS. rpcinfo -u YOUR-NAS-SERVER-IP nfs e.g. you'd see something like this: # rpcinfo -u localhost nfs program 100003 version 2 ready and waiting program 100003 version 3 ready and waiting program 100003 version 4 ready and waiting if nfs v4 is available, then changing to it is probably as simple as unmounting the NFS mount, editing /etc/fstab to change 'nfs' to 'nfs4' and then remounting the share. NOTE HOWEVER, that this may not fix the problem....but it's worth a try if anything else needs to lock files on the NFS server, and especially if it's shared with multiple simultaneous users. disabling locking may solve the symptom, but it's a pretty drastic solution that may end up causing other problems (in particular, file corruption if two or more processes open a file for write at the same time) craig -- craig sanders <cas@taz.net.au> BOFH excuse #99: SIMM crosstalk.

On Thu, 11 Jul 2013, Craig Sanders <cas@taz.net.au> wrote:
if nfs v4 is available, then changing to it is probably as simple as unmounting the NFS mount, editing /etc/fstab to change 'nfs' to 'nfs4' and then remounting the share.
Recent Linux systems default to nfs4. That definitely happens with Debian/Testing now and I think it happened with Debian/Wheezy on both client and server. I first noticed this when "umount -a -t nfs" stopped working because an /etc/fstab entry of type "nfs" resulted in a "nfs4" mount. -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/

Craig Sanders <cas@taz.net.au> writes:
if nfs v4 is available, then changing to it is probably as simple as unmounting the NFS mount, editing /etc/fstab to change 'nfs' to 'nfs4' and then remounting the share.
I thought all nfs4 exports had to be under a single tree? And then you have to faff about convincing it that yes, the UIDs on the server and client really do match, even if you aren't using krb. Admittedly, I haven't tried to use nfs4 for about many years, and I was a lot dumber back then.

Thanks Craig, Russell and Trent for the responses.
you can use rpcinfo to find out what versions of NFS are available on your NAS.
rpcinfo -u YOUR-NAS-SERVER-IP nfs
e.g. you'd see something like this:
# rpcinfo -u localhost nfs program 100003 version 2 ready and waiting program 100003 version 3 ready and waiting program 100003 version 4 ready and waiting This is exactly what I got
if nfs v4 is available, then changing to it is probably as simple as unmounting the NFS mount, editing /etc/fstab to change 'nfs' to 'nfs4' and then remounting the share.
NOTE HOWEVER, that this may not fix the problem....but it's worth a try if anything else needs to lock files on the NFS server, and especially if it's shared with multiple simultaneous users.
Using nfs4 is the fstab entry didn't work - the share wasn't mounted.
it links to another post on ubuntuforums.org, which suggests either a) mounting the NFS share with the 'nolock' option, to disable locking
The 'nolock' solution works perfectly for me. I can now access documents OK Thanks again Bob

Craig Sanders <cas@taz.net.au> writes:
On Thu, Jul 11, 2013 at 10:03:54AM +1000, Bob wrote:
I am using Libre Office wordprocessor on Kubuntu 13.04. My data is stored on a NAS (Synology DS213+) and accesses using NFS.
When trying to access files from the NAS, LibreOffice locks up and freezes. There are no problems with any other programs accessing data (including Email etc) . Copying a file to the local computer allows it to be opened OK by LibreOffice, so it appears to be a problem with LibreOffice and networking.
that sounds very much like an NFS locking problem. Libre Office is trying to lock the file so it has exclusive Write access to it while it's open.
FWIW, these symptoms also present with people using MS Office + Outlook and samba3. My strong impression is that locking just doesn't work very well under ANY network filesystem. IIRC my approach for samba3 is the equivalent to export-with-nolock, which causes the clients to do client- side locking, at a small[0] performance penalty. [0] smb.conf says "up to 30%" IIRC, but I never heard anybody complain after I made the change.
participants (4)
-
Bob
-
Craig Sanders
-
Russell Coker
-
trentbuck@gmail.com