Bug 1094 - MS Excel documents think they have been altered by another user while open for editing
MS Excel documents think they have been altered by another user while open fo...
Status: CLOSED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: File Services
3.0.2
All Windows 2000
: P3 normal
: none
Assigned To: Gerald (Jerry) Carter
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-02-17 19:43 UTC by Bryan K. Walton
Modified: 2007-01-23 03:41 UTC (History)
5 users (show)

See Also:


Attachments
Text file samba log with debug level set to 10. (681.25 KB, text/plain)
2004-03-17 13:48 UTC, Bryan K. Walton
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan K. Walton 2004-02-17 19:43:18 UTC
We have a problem where people using Microsoft Excel 2002 (from the Office XP
suite) encounter an error message when saving changes to excel files on Samba
shares.  When trying to save changes to an excel file stored on a linux share
drive, they get a pop up box: "The file '<insert file name>' may have been
changed by another user since you last saved it.  In that case, what do you want
to do?"  The user is given two options: 1) Save a copy, and 2) Overwrite
changes.  This happens with every excel file regardless of who has access to the
file, and regardless of how long the file has been open for editing.  Our
employees are using Excel 2002 on top of Windows 2000 (with a few people using
Windows XP).  The shares are sitting on a Debian linux box running Samba 3.0.2.
 Samba was built from source.
Comment 1 Stephen Ridley 2004-02-24 23:33:57 UTC
I have the same problem but with all microsoft office applications both Office
2000 and XP when used on a Windows 2000 and XP Pro. I have also tested Windows
98 and it is fine not usre if that helps narrow it down.

What I see happening is that the file is not read only before opening the file I
can then save once but after it finishes saving the file it is now read only. I
then have to close the file turn the read only flag off and then open the file
again. This has to be done after ever save.

The server is running on Redhat 8 with the following config (I have removed the
names of the shares, groups, users and the server).


[global]
        workgroup = tttt
        netbios name = rrrr
        server string = Samba PDC running %v
        obey pam restrictions = Yes
        pam password change = Yes
        passwd program = /usr/bin/passwd %u
        passwd chat = *New*password* %n\n *Retype*new*password* %n\n
*passwd:*all*authentication*tokens*updated*successfully*
        unix password sync = Yes
        log level = 2
        log file = /var/log/samba/%m.log
        min protocol = LANMAN2
        client signing = No
        socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=8192 SO_RCVBUF=8192
        load printers = No
        show add printer wizard = No
        add machine script = /usr/sbin/useradd -d /dev/null -g machine -s
/bin/false -c SambaMachine -M %u
        logon script = netlogon.bat
        logon path = \\%L\profiles\%U
        logon drive = H:
        logon home = \\%L\%U\.profile
        domain logons = Yes
        os level = 99
        domain master = Yes
        dns proxy = No
        wins support = Yes
        kernel oplocks = No
        ldap ssl = no
        template homedir = /home/%U
        create mask = 0664
        force create mode = 0664
        directory mask = 0775
        force directory mode = 0775
        hosts allow = 127.0.0.1, 192.168.1.0/255.255.255.0
        profile acls = Yes
        printing = lprng
        map system = Yes
        map hidden = Yes
        oplocks = No
        level2 oplocks = No

[homes]
        comment = Home Directories
        read only = No
        browseable = No

[printers]
        comment = All Printers
        path = /var/spool/samba
        printable = Yes
        browseable = No

[netlogon]
        comment = Global logon folder
        path = /home/netlogon
        create mask = 0600
        force create mode = 0600
        directory mask = 0700
        force directory mode = 0700

[profiles]
        comment = User Profiles folder
        path = /home/samba/profiles
        read only = No
        create mask = 0600
        force create mode = 0600
        directory mask = 0700
        force directory mode = 0700
        csc policy = disable

[tttt]
        comment = tttt Shared Storage
        path = /home/tttt
        username = zzzz,@yyyy,@tttt
        invalid users = @ssss
        valid users = zzzz, @yyyy, @tttt
        write list = zzzz, @yyyy, @tttt
        read only = No
        delete readonly = Yes

[uuuu]
        comment = Server Backups
        path = /uuuu
        username = zzzz,@yyyy
        valid users = zzzz, @yyyy
        write list = zzzz, @yyyy
        browseable = No
        delete readonly = Yes

[vvvv]
        comment = All vvvv folders
        path = /vvvv
        username = zzzz,@yyyy
        valid users = zzzz, @yyyy
        write list = zzzz, @yyyy
        delete readonly = Yes

[wwww]
        comment = wwww folder
        path = /home/wwww
        username = zzzz,@yyyy,@wwww
        valid users = zzzz, @yyyy, @wwww
        write list = zzzz, @yyyy, @wwww
        force group = wwww 
        delete readonly = Yes

[xxxx]
        comment = xxxx folder
        path = /home/xxxx
        username = zzzz,@yyyy,@xxxx
        valid users = zzzz, @yyyy, @xxxx
        write list = zzzz, @yyyy, @xxxx
        force group = xxxx
        delete readonly = Yes
Comment 2 Gerald (Jerry) Carter 2004-03-17 07:50:00 UTC
I cannot reproduce this using excel 2000 on 2ksp4 
or excel 2002 on XPsp1 using the latest Samba 3.0 
cvs code.

Could either of you retest against the cvs code 
possibly?   Or maybe send a level 10 debug log?

Regarding the timestamp issue, are the clocks 
sync'd between the client and server ?
Comment 3 Guido Leenders 2004-03-17 11:58:49 UTC
Guido Leenders, 2004-03-17:
After posting my comment to the mailing list, I've studied the problem further.
It was ultimately solved by:

dos filetimes=yes
fake directory create times=yes
dos filetime resolution=yes
delete readonly=yes

Given the production situation, I had no opportunity to further find out which 
one was the actual problem solver, but I've also tested the following as soon 
as excel started working:

* open xls in excel
* wait 15 sec
* execute touch on xls
* save in excel -> message occurs again

Obviously, excel stores in memory the last modification time of the file when 
opening it. It stores this probably with a second resolution. Before saving 
(similar to the opportunistic locking of Oracle Forms), it checks whether the 
file was saved in between. Probably it uses some kind of call that accepts the 
second resolution of the original modification time and compares it with the 
actual situation with a higher resolution as found on Linux.

Perhaps because Excel doesn't recognize that Samba provides higher resolutions. 
Therefore, it always signals a change.

My best guess. Problem also occurs with 2.2.8a.
Comment 4 Bryan K. Walton 2004-03-17 13:48:30 UTC
Created attachment 446 [details]
Text file samba log with debug level set to 10.

This is for Jerry, who asked me to set debug level to 10.  Jerry, the .xls file
I opened while logging was set to this level is called fundscore1003.xls.  If
you search through this log file you will see that file opened.  Trying to save
changes to this .xls file generated the error message again.
Comment 5 Bryan K. Walton 2004-03-17 14:23:48 UTC
Hi Jerry,
   Thanks for your comments.  I agree that the problem doesn't exist with Excel 
2000 on Windows 2Ksp4.  And, after your email, I also tested Excel 2002 on 
XPsp1.  I confirm that the problem doesn't exist there either.  For us, the 
problem only exists with Excel 2002 on Windows 2Ksp4 (I don't have any pre sp4 
machines to test).
   As for Guido's comments about four entries in his smb.conf file fixing it, I 
tried and those lines did not affect my situation.  I get the pop up message 
regardless.
   Again, from what I can see the problem is only repeatable with Excel 2002 on 
Windows 2K.
   As for time sync between the client and server, yes they are synced up.  
Both are using a ntp client, talking to the same time server.
   Also, I just turned up logging to log level 10 (for a brief 30 seconds or 
so).  While it was turned up, I opened up a .xls file and then saved it.  I 
just attached it a few minutes ago.

-Bryan
Comment 6 Nir Livni 2004-03-29 06:23:50 UTC
The problem is a documented problem of Excel 2002, fixed in Office XP Service 
Pack 3.

http://support.microsoft.com/default.aspx?kbid=324491

Have you tested samba-2.2.8a / samba 3 using Excel 2002 with Service Pack 3 ?

I hope it helps,
Nir
Comment 7 Bryan K. Walton 2004-03-29 11:49:56 UTC
Hi Nir,  Thanks for the information regarding Office XP SP3.  I updated our
installation to SP3 about two hours ago, and the problem still exists.  About
two months ago (pre SP3) I worked with Microsoft to get the very hotfix that is
now in SP3.  And just like with SP3, the hotfix didn't fix it either.  The fix
supplied by Microsoft sounds very similar, but I believe it focuses more on
macintoshes, it just so happens that the symptoms are the same for us.
Comment 8 Nir Livni 2004-03-29 12:26:34 UTC
Hi Bryan,
I've seen this problem happening on Excel 2003 as well, and found one incident 
on the web:
http://www.computing.net/office/wwwboard/forum/2398.html

The problems here (both Excel 2002 and 2003) started when we turned Oplocks 
on. (Oplocks were disabled in smb.conf until a week ago) - which makes sence 
according to the explanation on KB324491.
Try turning all oplocks off, and see what happens.
By the way - 
Does Microsoft support samba server when reporting such bugs ?
Thanks,
Nir
Comment 9 Bryan K. Walton 2004-03-29 14:51:55 UTC
Thanks Nir for the workaround!  We turned off oplocks and that seems to be
working for now.  As to whether MS supports samba server, I would doubt it.  But
when I called them, I didn't volunteer that info (and they didn't ask).  I
wanted to try the hotfix and didn't want to risk them turning me down. ;-)

Thanks again,
Bryan
Comment 10 Nir Livni 2004-03-30 02:52:43 UTC
I still believe there is a bug here. Windows file servers support oplocks, and 
I could not reproduce the problem with Office XP SP3 using windows file servers.
I still do not know if this is a client side or server side problem.
Comment 11 Bryan K. Walton 2004-03-30 13:46:37 UTC
Hi Nir,
   I agree, there is still a bug here.  1) I shouldn't have to turn oplocks off.
 2) As it so happens, turning off oplocks isn't fixing it 100% of the time.  I
haven't quite figured out what triggers it, but about 5% of the time, our
employees are still getting the message when trying to save changes to a spread
sheet.  Don't misunderstand me, things are much more tolerable now, but it
definitely isn't fixed yet.

Thanks again for your help!
Bryan
Comment 12 Nir Livni 2004-04-01 05:26:18 UTC
Hi all,
Our tests show that even when keeping oplocks on, the workarround in KB324491,
solves the problem.

1. Click Start, click Run, type regedit in the Open box, and then press ENTER.
2. Locate and then click the following key:
   HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\10.0\Excel\Options

3. On the Edit menu, point to New, and then click DWORD Value.
4. Type QFE_Saskatchewan for the name, and then press ENTER.
5. Right-click the QFE_Saskatchewan entry, and then click Modify.

<< Remark - now, use the 2nd option described ("type 1 ... to disable") and not
<< the first option that improves...

6. In the Value box, type 2 to have Excel always flush the file cache before
   obtaining the time stamp (which should resolve the problem in most cases),
   or type 1 in order to have Excel disable the time stamp check (not
   recommended) and suppress the dialog in all cases. 
   Click OK to save the setting.

7. Re-start Excel to have the setting take effect for that user.
Comment 13 Charlie Leach 2004-04-05 07:14:05 UTC
I have been experiencing this problem for a while with Excel 2002. The problem
appeared for the first time when I upgraded to service pack 4. I upgraded Samba
to Samba 3.0.0 rc4, but this did not solve it.

It seems to me to be an inability of Excel and Samba to communicate oplock
status. In my case, when the excel file is opened, it does not trigger the
oplock which remains off, thus when you save, it thinks there might be another
version open, hence the dialogue box. However saving the file does trigger the
oplock, and I can save the file any number of times after that without
triggering the problem. It is only Excel, not word etc. Checking the smbstatus
of the files reveals oplock is "none" on newly opened files, but changes to
"Exclusive + Batch" once the file has been saved once.

Turning the oplock off cures the symptom but not the problem, which I believe
is: "why isn't samba picking up the oplock, or why isn't excel generating an
oplock on opening when it does on saving the file?" 

Does this help and/or match other's experience? 
Is the regedit proposed here solve that problem or work around it?
Comment 14 Nir Livni 2004-04-10 10:14:53 UTC
Hi Charlie.
The suggested solution is a workarround that disables this feature in Excel. 
(Excel will not check if someone has changed the file while you edit it).
Basically, this is impossible for anyone to write to an Excel file while you 
edit it, unless:
1. the workbook is a shared workbook
2. Your workstation has been disconnected from the network, and someone took 
over the file...
Comment 15 Charlie Leach 2004-04-10 11:35:50 UTC
Hio Nir,

I tried that workaround but it made no difference, either as hexadecimal or
decimal (which should it be by the way?). The dialogue still comes up as before.

Logically I'm sure it must be possible to solve the original problem. Do you
happen to know exactly what is happening in Samba (the exact code) that makes it
switch the oplock on when an excel file is saved? Since that works, presumably
there is only a minor code change to ensure the same thing is triggered by
file_opening as well as file_saving? 
Comment 16 Nir Livni 2004-04-11 13:29:10 UTC
Hi Charlie.
You can send me an email, containing regedit export of
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\10.0\Excel\Options

I will see what is the difference between your entry and my entry.

All the people I know of that had that problem - fixed it with that registry 
entry.
Regarding the code in samba needs to be changed -
I'm sure its not that simple to change that code...
Comment 17 Hadeyt Thierry 2004-05-06 06:32:05 UTC
We have the same problem with Samba 2.2.8 / 3.0.x
And we have the problem #1167 (See report)
There is a strange similarity in the two problems, No ?!

Your workstations has been disconnected from the network .....
Comment 18 Stephen Ridley 2004-05-12 22:41:05 UTC
After reading bug 1177 I changed the config I posted earlier to have "profile
acls" set to Yes only in the "profiles" share (as this is the only one its
needed for) and the problem is gone.

It does seem to be that both "nt acl support" and "profile acls" cannot be set
to Yes globally or for a share otherwise Office exihbits this problem.
Comment 19 Bob Harvey 2004-05-22 04:52:57 UTC
I am having this problem on a 3.0.4 installation with Office XP (no service
packs).  I cannot apply service packs because of the way this vessel is managed.

I upgraded from 2.2.8aSuse to 3.0.4 to solve a different problem with Word/Excel
and for the first 3 days Office XP was no problem.  Then suddenly excel started
doing this.

We are using security=share and guest ok = yes because previous attempts to
manage  linux "shadows" of the users on the installed W2K server failed, and the
way the W2K server is setup it won't share authentication with any other server
on board.  

I am making these comments for your information, just to help size the problem up.
Comment 20 Guido Leenders 2004-06-18 03:26:02 UTC
In March I've reported the problem and then made some changes to the way times 
are stored. After an evaluation, we saw that this change solved approximately 
90% of the messages, but they are not completely gone.

We have tried Office XP SP3 with the registry change and now all problems are 
gone.

Guido Leenders
Comment 21 Peter Hopfgartner 2004-08-26 06:58:50 UTC
Server: Debian woody, samba-3.0.6 from debian packages provided by the samba 
group.

Client: Windows XP, SP2, Office XP SP3.

The problem went away setting oplocks = no.

Hope this may help somebody.
Comment 22 Gerald (Jerry) Carter 2004-08-26 07:08:59 UTC
I'm going to makre this one as fixed in 3.0.6 due to the 
new deferred open code.  Please test.
Comment 23 Michel Gravey 2004-11-18 00:59:58 UTC
The bug still occurs in 3.0.8

Environnement: samba 3.0.8 compiled from source on linux/debian.
Client: excel 2002 (office and registry not patched).

Maybe you can re-open the bug...
Comment 24 David Rees 2005-01-03 14:15:49 UTC
I'm seeing this on Windows XP SP2 with MS Office Excel 2003 SP1 running against
Samba 3.0.10 on Fedora Core 3 (samba-3.0.10-1.fc3).

Turning off oplocks fixes the problem.
Comment 25 Darren Gibbons 2005-01-04 12:35:56 UTC
Confirmed on FreeBSD 5.3-RELEASE-p2, samba-3.0.10,1 installed via ports and
Excel 2003.

This bug should be reopened.
Comment 26 Pierre Belanger 2005-01-05 12:31:11 UTC
We have the same problem here.

Tested on Samba-3.0.10 under Solaris 9 using Excel 2002 SP3 (10.6713.6714) on
Windows XP Pro. 5.1.2600 Server Pack 1 Build 2600.

In terms of locking, this is what we have:

# testparm -s -v | grep lock
        kernel oplocks = Yes
        lock spin count = 3
        lock spin time = 10
        oplock break wait time = 0
        lock directory = /usr/local/samba3/var/locks
        pid directory = /usr/local/samba3/var/locks
        block size = 1024
        veto oplock files = 
        blocking locks = Yes
        fake oplocks = No
        locking = Yes
        oplocks = Yes
        level2 oplocks = Yes
        oplock contention limit = 2
        posix locking = Yes
        strict locking = Yes

According to man pages, kernel oplocks are turned off if the system doesn't
support it.

I also agree... please reopen this bug!

Pierre B.(In reply to comment #0)
> We have a problem where people using Microsoft Excel 2002 (from the Office XP
> suite) encounter an error message when saving changes to excel files on Samba
> shares.  When trying to save changes to an excel file stored on a linux share
> drive, they get a pop up box: "The file '<insert file name>' may have been
> changed by another user since you last saved it.  In that case, what do you want
> to do?"  The user is given two options: 1) Save a copy, and 2) Overwrite
> changes.  This happens with every excel file regardless of who has access to the
> file, and regardless of how long the file has been open for editing.  Our
> employees are using Excel 2002 on top of Windows 2000 (with a few people using
> Windows XP).  The shares are sitting on a Debian linux box running Samba 3.0.2.
>  Samba was built from source.

(In reply to comment #0)
> We have a problem where people using Microsoft Excel 2002 (from the Office XP
> suite) encounter an error message when saving changes to excel files on Samba
> shares.  When trying to save changes to an excel file stored on a linux share
> drive, they get a pop up box: "The file '<insert file name>' may have been
> changed by another user since you last saved it.  In that case, what do you want
> to do?"  The user is given two options: 1) Save a copy, and 2) Overwrite
> changes.  This happens with every excel file regardless of who has access to the
> file, and regardless of how long the file has been open for editing.  Our
> employees are using Excel 2002 on top of Windows 2000 (with a few people using
> Windows XP).  The shares are sitting on a Debian linux box running Samba 3.0.2.
>  Samba was built from source.

(In reply to comment #25)
> Confirmed on FreeBSD 5.3-RELEASE-p2, samba-3.0.10,1 installed via ports and
> Excel 2003.
> 
> This bug should be reopened.

Comment 27 Marc Rechte 2005-03-22 09:18:11 UTC
Hi to all,

Got the same problem with Office 2003 + Windows XP SP2, but it seems the problem
happened just after we upgraded to SP2. I tried the registry work around:

[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Options]
"QFE_Saskatchewan"=dword:00000002

And it solves the problem.

I am on Samba 3.0.10 (from Red Hat Enterprise Server 4).

However there is probably a problem in Samba related to time stamp.

Regards,

Marc.
Comment 28 Gerald (Jerry) Carter 2005-08-24 10:26:17 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.
Comment 29 bhupesh karankar 2007-01-23 03:41:59 UTC
(In reply to comment #28)
> sorry for the same, cleaning up the database to prevent unecessary reopens of
> bugs.

hello all,
i found that prob in our samba server on Cent OS, i have found that problem before 4 days.
when i have restart samba service, i have check all solution which discribe in abouve discussion, but still problem not solve...
i have also check/change regedit and change as 
[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Options]
"QFE_Saskatchewan"=dword:00000002


but still i have prob,,,,,what is the perfrect  solution, can any body tell me.
with this which option we have to select, 
which oplocks we have to enalbe or disable.
help me out
please open that again