Koozali.org formerly Contribs.org

Documents not removing .lock files when closed on ibay

Offline HE

Documents not removing .lock files when closed on ibay
« on: November 21, 2018, 10:26:36 AM »
Hello

I have an odd one where the client is having issues opening documents on the server saying that they are open by other people or even themselves when it is not open on any machine I don't believe this to be an issue with the sme server but have tried every fix on the web with Microsoft office.

The server is an SME 9.2 server used as email and networked share for all staff. The documents are often using links to other documents to pull information.

Offline TerryF

  • *
  • 1,040
Re: Documents not removing .lock files when closed on ibay
« Reply #1 on: November 21, 2018, 12:34:23 PM »
Nice read @LinuxQuestions.org dunno if it will help :-)

"The LOCK icon means that a file or folder is owned by a privileged user, such as "root", but the user account you are currently logged in as, does not have enough permissions to read the file or enter the folder.
This happens (the LOCK icon) if you for example, edit a file as root, and then save it to a location like a regular users /home folder. The root user will not see the LOCK icon, because he has enough permissions to access the file, but a regular user will see the LOCK icon, because he doesn't have the permission to view the file."
and
"Another way you can get the lock icon is if you copy a file from one computer to another in a manner which preserves permissions.

I can be user simon on two different computers, but these will often end up as two different simons as far as linux is concerned. Thus the simon@indigo-prime cannot alter files owned by simon@joker even though they are both ordinary users and both me.

I've seen this happen with CDROM backups - the restored files were all locked because the newly created me had a different uid from the original me.

The solution is to choose a method of copying or transferring files which does not preserve permissions."
--
qui scribit bis legit

Offline ReetP

  • *
  • 1,771
Re: Documents not removing .lock files when closed on ibay
« Reply #2 on: November 21, 2018, 01:34:28 PM »
Have a look at the permissions on the file for starters. And see if there are any hidden lock files in the directory.

Sometimes files can be held open by things like 'Recently Used' I think. Although it appears to be closed, the application holds a lock on the file.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline HE

Re: Documents not removing .lock files when closed on ibay
« Reply #3 on: November 21, 2018, 07:44:06 PM »
Hello

The documents are on an Ibay that uses group privileges (for example staff) read and write to group it will work normally a user will open the document and edit it then close it and the lock file will remove its self the problem is that it wont always remove its self, 80% of the time it will work fine. I can delete the lock file when not in use which fixes the issue and document works as normal. I don't think it is a server issue but googling is just a endless hole of answers. If there are more important questions on the forums please reply to those first.

Offline ReetP

  • *
  • 1,771
Re: Documents not removing .lock files when closed on ibay
« Reply #4 on: November 21, 2018, 07:55:34 PM »
LOL.... every question is important !! If we can help we will.

What version of Office?

I'm pretty sure this will be a M$ issue, with Office or the user still having a file lock, but that won't help angry users. The problem is trying to find a solution.

Typical M$ solution... put it in their cloud.....

https://support.office.com/en-us/article/Excel-file-is-locked-for-editing-by-another-user-6fa93887-2c2c-45f0-abcc-31b04aed68b3
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline HE

Re: Documents not removing .lock files when closed on ibay
« Reply #5 on: November 21, 2018, 08:27:24 PM »
Hello

Thanks for your help as always

They use office 2010 and 4 pc's with office 2013

Offline ReetP

  • *
  • 1,771
Re: Documents not removing .lock files when closed on ibay
« Reply #6 on: November 21, 2018, 09:21:58 PM »
OK. Someone may be around later who has experience of this (I happily ditched all M$ products years ago and never looked back !)

Not sure if it is relevant to you but read this

https://www.linuxtopia.org/online_books/network_administration_guides/samba_reference_guide/24_locking_07.html

And check:

Code: [Select]
config show smb
Mine looks like this for reference:

Code: [Select]
smb=service
    DeadTime=10080
    KeepVersions=disabled
    OpLocks=enabled
    OsLevel=35
    RecycleBin=disabled
    RoamingProfiles=no
    ServerName=home
    ServerRole=PDC
    ShadowCount=10
    ShadowDir=/home/e-smith/files/.shadow
    UnixCharSet=ISO8859-1
    UseClientDriver=yes
    Workgroup=workgroup
    status=enabled

(Just a guide)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline TerryF

  • *
  • 1,040
Re: Documents not removing .lock files when closed on ibay
« Reply #7 on: November 21, 2018, 10:53:36 PM »
No don't think its a SME issue..

As you would have found in your research there are differences between office versions in relation to collaboration in particular after 2010

I don't have a copy of either suite to pinpoint it just reading others who have had similar issues.

--
qui scribit bis legit

Offline HE

Re: Documents not removing .lock files when closed on ibay
« Reply #8 on: November 27, 2018, 02:25:33 PM »
Hello

Thanks for all the help im not sure if I will ever find the issue.

One question before I close the discussion Is what Specs should I be running for an SME9.2 server with 80 users connected using as a gateway, Mail and File server. I currently use an i3 with 8GB ram and 2 TB HDD. I will Be adding redundancy to the next build this current one backs up to a nas it is not using raid.


Offline ReetP

  • *
  • 1,771
Re: Documents not removing .lock files when closed on ibay
« Reply #9 on: November 27, 2018, 03:45:28 PM »
Thanks for all the help im not sure if I will ever find the issue.

Regrettably the answer lies in the M$ domain. They seem to take pleasure in trying to ensure anything M$ related will not run well on anything beyond M$ hardware & software. It is an uphill battle.

Quote
One question before I close the discussion Is what Specs should I be running for an SME9.2 server with 80 users connected using as a gateway, Mail and File server. I currently use an i3 with 8GB ram and 2 TB HDD. I will Be adding redundancy to the next build this current one backs up to a nas it is not using raid.

How long is a piece of string? :-)

Depends on how much it gets hammered! You can check your system loads and see if anything gets maxed out.

The one thing I would change IMMEDIATELY is add a 2nd (and even 3rd) HDD and get at least a RAID 1 mirror running. Drives are cheap. 80 employees not working for 8 hours whilst you wait for your backup to restore is not.

If you run RAID and a disk goes West you have bought yourself some time to fix the issue.

Until I had a bit more money and moved to more exotic RAIDs, I used to run a 3 disk RAID ! So either two drives running with a hot spare, or even all 3 running together.

Your write speed may slow a little but read will be much faster than a single drive. And you have the benefit of some redundancy...

Saved my bacon on numerous occasions.

Beyond that, cost and use etc. Have a search on the interwebs for recommended hardware levels for CentOS6/RHEL6
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline HE

Re: Documents not removing .lock files when closed on ibay
« Reply #10 on: November 27, 2018, 05:28:59 PM »
Does SME support raid standard im not even sure how to configure the raid and will it tell me when a drive has failed or do I have to get contribs to do that for me?

Offline ReetP

  • *
  • 1,771
Re: Documents not removing .lock files when closed on ibay
« Reply #11 on: November 27, 2018, 06:09:26 PM »
Does SME support raid standard im not even sure how to configure the raid and will it tell me when a drive has failed or do I have to get contribs to do that for me?

Supports it out of the box. In fact your server is probably configured with a RAID with a failed drive already.... (depending on how you set it up)

This should show you what is already set up:

Code: [Select]
cat /proc/mdstat
Configuring isn't rocket science - plenty of pages on the wiki and help here but it may vary a bit depending on what you did on install.

No contribs required, and it should scream from the rafters if a drive fails ;-)

Main thing is making sure for RAID 1 you use 2 identical drives.

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Re: Documents not removing .lock files when closed on ibay
« Reply #12 on: November 28, 2018, 10:41:37 PM »
Typical M$ solution...

Typical non-solution, I would say. Don't do anything to definitively diagnose what the problem is, but just thrash around doing various things until something (hopefully) works.

Offline ReetP

  • *
  • 1,771
Re: Documents not removing .lock files when closed on ibay
« Reply #13 on: November 29, 2018, 12:14:30 AM »
Typical non-solution, I would say. Don't do anything to definitively diagnose what the problem is, but just thrash around doing various things until something (hopefully) works.

Regrettably I'm not knowledgeable enough to fully diagnose it.

When I first had a read around about the issue it seems this is a common issue with Office on various platforms. The lock file gets left on the server for reasons unknown.

e.g A few typical links here.

https://superuser.com/questions/30980/microsoft-office-document-is-locked-for-editing-by-another-user
https://www.experts-exchange.com/questions/26566869/Word-2010-Error-File-is-Locked-for-Editing-by-'another-user'.html

I have seen similar issues occasionally with LibreOffice on Linux - the application crashes leaving a lock file (or some form of tmp file), or the 'Recently Used' menu can keep the file locked. Or a variety of other reasons.

As far as I am aware it isn't an issue with Samba but with the applications being a bit messy. (I have seen other issues, say with DBs, that have been with Samba and Oplocks etc. Windows Sage used to be a nightmare.... But I don't believe this is the case in this instance)

Happy to be corrected though.

I did post my smb conf for comparison. The OP is welcome to paste his own config and any log files that may be relevant.

FWIW some stuff on Samba debugging I found.

https://wiki.samba.org/index.php/Setting_the_Samba_Log_Level
https://wiki.samba.org/index.php/Client_specific_logging

Temporarily set the debug level [0-10] Default seems to 2 from testparm but man smb.conf says it should be 0

Check current parameters with testparm. use --help for usage information.

Code: [Select]
testparm -vs
This is a neat command I never knew about to change samba settings on the fly (man smcontrol):

Code: [Select]
smbcontrol smbd debug 2
Logs are in /var/log/samba

I found there is no key in SME to set the loglevel permamently

Checked the current level which seems to be to 2 though smb.conf says it should be 0

Code: [Select]
testparm -vs  |grep log\ level
Or

Code: [Select]
testparm --parameter-name "log level"
You can add a debug setting by doing the following.

Edit this as a new file:

Code: [Select]
nano /etc/e-smith/templates-custom/etc/smb.conf/11loglevel
Add this code snippet:

Code: [Select]
{
    $level = $smb{LogLevel} || '2';
        return "log level = ${level}";
}

Try setting it to 2:

Code: [Select]
config setprop smb LogLevel 2
Code: [Select]
signal-event workgroup-update
(you might want  to try
Code: [Select]
service smb restartas well)

Code: [Select]
cat /etc/samba/smb.conf |grep log\ levellog level = 2

Now take a look in /var/log/samba and see what you can find in the logs.

Now try a higher level eg 3 (4 and above are dev stuff and generate a lot of logs) etc

Another setting you could try is upping the logging for locking like this:

Code: [Select]
config setprop smb LogLevel "2 locking:5"
This may give you some more info.

If you know the owner of the file you can set logging per IP and all sorts of other tricks. You may need to spend a bit of concentrated time to test this.

Remember to either delete the key or set it to 2 or a sensible level after testing !

OK. I've about exhausted my abilities. Let us know if anything shows up or you need further help.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline TerryF

  • *
  • 1,040
Re: Documents not removing .lock files when closed on ibay
« Reply #14 on: November 29, 2018, 02:40:10 AM »
I'll have to note most of that, thanks ReetP..
--
qui scribit bis legit