Samba 4 vs MS Office – Error accessing the file for saving, open and read works

centos6microsoft-office-2010network-sharesambasamba4

Description

I am struggling with a rather old (well-known) issue using the latest samba 4 suite. The MS Office 2010 products refuse to save a new (or modified) file on the samba share and display a message of the form:

"There was an error accessing the file \sambashare\smbtest\testfile.pptx".

This particular issue persists only with MS Office 2010 files (docx, pptx, xlsx). Opening and reading the files works just fine, but when it comes to modifying or saving a new file, it doesn't work. Please note that ALL the other file types, including older MS Office products (eg. MS Office 2003) work just fine.

Environment

OS (server): CentOS release 6.2 (Final) —
OS (client): Windows 7 —
Samba version: samba-4.1.11

Other similar cases:

a) Samba Share – MS Excel when saving "can't access the file, there are several possible reasons"

b) https://lists.samba.org/archive/samba/2011-December/165327.html

I have read lots of "resolved" cases with such kind of error but they all use older samba versions (3.*). The solutions provided to these cases don't work for the new samba version as some of the parameters were deprecated. I was hoping that this issue would have been resolved in samba 4 but it actually did not.

Configuration

Also I performed a series of tests by changing the smb.conf file. Here is what I currently have at the moment.

[smbtest]
comment = samba test workspace
path = /sambashare/smbtest
valid users = @g-staff
force group = g-staff
browseable = yes
writeable = yes
read only = no
guest ok = no
directory mask = 2770
force directory mode = 2770
create mask = 2775
force create mode = 2775

Your help would be greatly appreciated. Thanks!

Best Answer

Support came from one of the Samba developers.

It seems like this problem was caused by my current IBM GPFS (network filesystem) configuration and not Samba.

Resolving the problem

The following 2 workarounds are available:

A) Apply "special" settings:

For GPFS 1.3.1.0 or higher -> enable GPFS setting for file rename using SMB2 access:

  1. Using SSH, connect to the active management node as the 'root' user.

  2. Run the following command to set the cifsBypassShareLocksOnRename flag:

[root@gpfsmngtserver ~]# mmchconfig cifsBypassShareLocksOnRename=yes -i
mmchconfig: Command successfully completed
mmchconfig: Propagating the cluster configuration data to all affected nodes. This is an asynchronous process.
  1. Verify the settings:
[root@gpfsmngtserver ~]# mmfsadm dump config |grep -i cifs
cifsBypassShareLocksOnRename 1    <---- check that this is now set to 1
cifsBypassTraversalChecking 0

No reconnect of network drives or reboot of clients is required.

Note: Support for SMB2 will automatically be re-enabled when an upgrade has been applied. Please check and reapply any workarounds that may be needed on the upgraded release, especially if a workaround had been applied prior to an upgrade.

OR

B) Edit and save files locally on client and then copy those files to the network share.


References IBM Support page: http://www-01.ibm.com/support/docview.wss?uid=ssg1S1004008

Samba Bugzilla page: https://bugzilla.samba.org/show_bug.cgi?id=10774

Related Topic