MS Office files automatic locking not working?


#1

Greetings,

We are using the Seafile Pro server (version 6.2.4 as of yesterday), and although file locking works OK when doing it manually, it does not work automatically for MS Office files. We have tried with .xlsx and .docx files. We tried also enabling the seafile client option to “Enable sync of temporary files of MSOffice/Libreoffice” but it didn’t seem to help. This was also the case before the upgrade to 6.2.4

  1. Are there any clues on how to troubleshoot this?
  2. Also, we noticed that when manually locking a file, it takes about 10 seconds or so for other clients to be updated with the new (locked) status. Is this something that can be sped up in some way?

Many thanks in advance for any help!


#2

Can you search the keyword “lock” in the seafile.log of the client? Which version of client do you use?


#3

Hi Jonathan,

We use the latest client version (6.1.4). Here is the log file with the regex ‘\slock’ grepped for the past two days:

[01/10/2018 12:17:12 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 01:17:12 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 02:17:12 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 03:17:12 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 04:17:12 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 05:17:12 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 06:17:12 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 07:17:13 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 08:17:13 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 09:17:13 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 10:17:13 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 11:17:13 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 11:17:13 AM] filelock-mgr.c(954): 0 expired file locks are unlocked.
[01/10/2018 12:17:13 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 12:17:13 PM] filelock-mgr.c(954): 0 expired file locks are unlocked.
[01/10/2018 01:17:13 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 01:17:13 PM] filelock-mgr.c(954): 0 expired file locks are unlocked.
[01/10/2018 02:17:13 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 02:17:13 PM] filelock-mgr.c(954): 0 expired file locks are unlocked.
[01/10/2018 03:17:13 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 03:17:13 PM] filelock-mgr.c(954): 0 expired file locks are unlocked.
[01/10/2018 04:17:13 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 04:17:13 PM] filelock-mgr.c(954): 0 expired file locks are unlocked.
[01/10/2018 05:17:14 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 05:17:14 PM] filelock-mgr.c(954): 0 expired file locks are unlocked.
[01/10/2018 06:17:14 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 06:17:14 PM] filelock-mgr.c(954): 0 expired file locks are unlocked.
[01/10/2018 07:17:14 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 07:17:14 PM] filelock-mgr.c(954): 1 expired file locks are unlocked.
[01/10/2018 08:17:14 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 09:17:14 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 10:17:14 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/10/2018 11:17:14 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 12:17:14 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 01:17:14 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 02:17:14 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 03:17:15 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 04:17:15 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 05:17:15 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 06:17:15 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 07:17:15 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 08:17:15 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 09:17:15 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 10:17:15 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 11:17:15 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 12:17:15 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 01:17:16 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 02:17:16 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 03:17:16 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 04:17:16 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 05:17:16 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 06:17:16 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 07:17:16 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 08:17:16 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 09:17:16 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 10:17:16 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/11/2018 11:17:17 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/12/2018 12:17:17 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/12/2018 01:17:17 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/12/2018 02:17:17 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/12/2018 03:17:17 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/12/2018 04:17:17 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/12/2018 05:17:17 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/12/2018 06:17:17 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/12/2018 07:17:17 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/12/2018 08:17:17 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/12/2018 09:17:18 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/12/2018 10:17:18 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/12/2018 11:17:18 AM] filelock-mgr.c(924): Cleaning expired file locks.
[01/12/2018 12:17:18 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/12/2018 01:17:18 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/12/2018 02:17:18 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/12/2018 03:17:18 PM] filelock-mgr.c(924): Cleaning expired file locks.
[01/12/2018 04:17:18 PM] filelock-mgr.c(924): Cleaning expired file locks.

#4

This is from the server log, isn’t it?


#5

Correct, this is the server log.


#6

Can you search for lock in the client log? The log folder can be opened via the Seafile tray icon.


#7

I just tried opening one Word file (.docx), edited it, closed it (without saving) and opened another Word file without editing it, and see no messages in seafile.log pertaining to file locks. All times are CET, so all operations happened a few minutes ago:

[01/15/18 20:52:57] seaf-daemon.c(558): starting seafile client 6.1.4
[01/15/18 20:52:57] seaf-daemon.c(560): seafile source code version 1de7ecd32c0dfaa3fd0eedbd3fc2752d50752dda
[01/15/18 20:52:57] ../common/mq-mgr.c(60): [mq client] mq cilent is started
[01/15/18 20:52:57] ../common/mq-mgr.c(106): [mq mgr] publish to heartbeat mq: seafile.heartbeat
[01/15/18 20:52:58] sync-mgr.c(2252): File syncing protocol version on server https://seafile.domain.com is 2. Client file syncing protocol version is 2. Use version 2.
[01/15/18 20:52:59] sync-mgr.c(2252): File syncing protocol version on server https://sf.domain.net is 1. Client file syncing protocol version is 2. Use version 1.
[01/15/18 20:52:59] sync-mgr.c(739): Repo 'Other documents' sync state transition from 'synchronized' to 'committing'.
[01/15/18 20:52:59] repo-mgr.c(3728): All events are processed for repo cf922a14-fa85-4281-9c39-8f57b1986a79.
[01/15/18 20:52:59] sync-mgr.c(739): Repo 'Other documents' sync state transition from 'committing' to 'initializing'.
[01/15/18 20:53:00] sync-mgr.c(739): Repo 'My Library' sync state transition from 'synchronized' to 'committing'.
[01/15/18 20:53:00] repo-mgr.c(3728): All events are processed for repo d4725762-485d-488f-9196-b1800522105c.
[01/15/18 20:53:00] sync-mgr.c(739): Repo 'My Library' sync state transition from 'committing' to 'initializing'.
[01/15/18 20:53:01] sync-mgr.c(739): Repo 'Shared Library' sync state transition from 'synchronized' to 'committing'.
[01/15/18 20:53:02] repo-mgr.c(3728): All events are processed for repo 5cb9c43c-02d4-4d8d-9de5-3d8be6f15b57.
[01/15/18 20:53:02] sync-mgr.c(739): Repo 'Shared Library' sync state transition from 'committing' to 'initializing'.
[01/15/18 20:53:35] sync-mgr.c(739): Repo 'Shared Library' sync state transition from 'synchronized' to 'committing'.
[01/15/18 20:53:35] repo-mgr.c(3728): All events are processed for repo 5cb9c43c-02d4-4d8d-9de5-3d8be6f15b57.
[01/15/18 20:53:35] sync-mgr.c(739): Repo 'Shared Library' sync state transition from 'committing' to 'synchronized'.
[01/15/18 20:55:48] sync-mgr.c(739): Repo 'Shared Library' sync state transition from 'synchronized' to 'committing'.
[01/15/18 20:55:48] repo-mgr.c(3728): All events are processed for repo 5cb9c43c-02d4-4d8d-9de5-3d8be6f15b57.
[01/15/18 20:55:48] sync-mgr.c(739): Repo 'Shared Library' sync state transition from 'committing' to 'synchronized'.
[01/15/18 20:56:10] sync-mgr.c(739): Repo 'Shared Library' sync state transition from 'synchronized' to 'committing'.
[01/15/18 20:56:10] repo-mgr.c(3728): All events are processed for repo 5cb9c43c-02d4-4d8d-9de5-3d8be6f15b57.
[01/15/18 20:56:10] sync-mgr.c(739): Repo 'Shared Library' sync state transition from 'committing' to 'synchronized'.

#8

@daydr3am3r What program do you use to open the files? The auto locking depends on a special behavior of MS Office program that creates a hidden “~$xxxx” file.


#9

@Jonathan The problem was first discovered using Microsoft Office 16.9 for Mac. The tests I did with Microsoft Office 365 for Business version 1711 for Windows.

Temporary files are indeed being created (and synced), and as stated in my initial post, I also toyed around with enabling “Enable sync of temporary files of MSOffice/Libreoffice” but it didn’t help.


#10

Auto locking is not supported on Mac yet. In your Windows test, is every file name doesn’t work? Have tried with some simple file names?


#11

I will double check on the Windows host and get back to you, although we mostly use Seafile via MacOS. Is there a projected date when the feature will be introduced for Mac clients as well?


#12

Although this is on our dev plan, we haven’t have time to make it work for Mac. That would require some changes to the core syncing code for Mac. We need to do it more cautiously.


#13

Confirmed that automatic Windows file locking works OK after all, I guess what threw me off is the delay between opening an MS Office file and having it automatically marked as locked.

In light of the new facts, is there a way to at least speed up the process of syncing the “locked” state of files with other users when manually locking them?

As a minor comment, I find it a bit strange to have the client version identical between the Windows and the Mac OS client, if there is no feature parity… For instance for the Drive client, I intuitively understand that the Mac OS client is lagging behind the Windows client because it’s version 0.8.0 and not 0.8.5 (which is the current version of the Windows client).

Are there other features that are supported in the Windows Seafile client that are not in the Mac OS client?


#14

It’s in our long term plan to make the status detection faster with notification pushing instead of the current polling mechanism. But it’ll certainly make it harder to deploy as it requires something like websocket.