Install the app
How to install the app on iOS

Follow along with the video below to see how to install our site as a web app on your home screen.

Note: This feature may not be available in some browsers.

Problems saving macOS MS Word & Apple Preview files to SMB shares

As an Amazon Associate, we may earn commissions from qualifying purchases. Learn more...

31
10
NAS
DS418Play,DS218+,DS115
Operating system
  1. macOS
  2. Windows
Mobile operating system
  1. iOS
I am starting a new thread for this because it is a more accurate description of this issue than my previous thread about clearing the SMB cache to clear stalls when saving files.

Since the DSM 7.2 upgrade, the trick with clearing the SMB cache no longer unfreezes the apps concerned, which has caused me to look again at the issue.

Firstly, this problem now occurs on pretty much every save of a file to an SMB share from MS Word, Excel and Apple Preview on macOS. All software is fully up-to-date as of today.

At the root of the problem is that when you save a file to an SMB share, both apps create a folder at the same level of the share as the file you are saving. It has the name of the file with some apparently random characters appended to it after a dot, such as filename.ext.sb-12d3fc97-t7Wcfq, where the original filename was filename.ext. I am not entirely sure of the intended function of this folder, but it is at this point that the app stalls and you get the beachball. If you log on to DSM and delete the folder in FileStation then the save completes and the app comes out of its stalled state.

Word and Excel go one step further as they can create multiple folders and also what looks like a temporary file with the first two characters replaced with "~$". If you delete the folders AND the ~$ file the stalled app comes back to life again.

While these folders (and, for Word and Excel, the ~$ file) are sitting there in the folder the app will never come out of its stalled state.

There does not seem to be any permission issue with the shares, folders, or these folders and the ~$ file, but I cannot say for absolutely certain that this is not the issue. it is just that whatever I look at the permissions seem to be OK. I am however struggling to find out what else could be the cause of the blocking effect of these artefacts of the saving process. My guess is that if everything is working OK these should be created and then almost instantly deleted, but this is failing to happen and that is why the whole saving process hangs.

As I said, previously clearing the SMB cache fixed the problem, but that doesn't work any more. I also suspect that the SMB cache is not the cause of the problem, it was more that clearing the cache restarted Samba and that had the effect of almost coincidentally fixing the problem.

One other interesting thing is that Adobe Illustrator does not exhibit this behaviour when saving files and I nowadays never have problems with saving Illustrator files. This used to be a problem a few years ago but I think Adobe have fixed the problem, probably by modifying the way they save files. Microsoft and Apple have not.

Does anyone have any clue about this issue?
 
I see the hidden session file and temporary save folder (enable showing hidden items with keystrokeshift alt . ). But I can't yet get Excel to freeze during the save. You already went through Mac's /etc/nsmb.conf settings in the previous thread, have you reviewed the SMB advanced setting in DSM?
 
I have tried all sorts of of combinations of settings here, both in the DSM Control Panel and also with the nsmb.conf on the Mac, trawling for information on what settings to employ, and nothing seems to stop this behaviour. It is close to witchcraft, quite honestly.

I am close to giving up on it - whatever I try I get this issue occurring. It is not just on my Mac - it is on my wife's Mac as well. We are trying to run a very busy business and it is getting beyond a joke.

There doesn't seem to be any clear guidance from Apple or Synology on what settings to use to make this just work. Apple say they do not support third-party SMB servers, Synology say it is all down to Apple, and Microsoft say they only support saving to a computer's built-in storage. The only consistent thing is that whatever I have tried so far we get this problem!

Oh, and the problem has gone from being at least solvable as a hack by clearing the SMB cache to not being solvable through any mechanism.
 
One other thing to add is that I don't have any issues with any transactions with files from the Finder - copying, renaming, moving files all works absolutely fine. It is only saving from within applications that causes problems.
 
What location on the NAS are you saving to? Could there be a permissions conflict… I was testing using a folder within my NAS account’s home share.
 
I am saving to multiple shares created through the Shared Folder section of the Control Panel.

However, when I just went through this section to create a Test folder, I suddenly wondered whether there was any difference if the access permissions were assigned to individual users or instead to a group in which the individual were placed.

Having made that change (removed permissions from users, assigned instead to a group) it is just possible that this might just have finally, after all this time, resolved the issue! With the access permission assigned to a group and not to the individual users, when you save a file from Word the oddly named folder gets created as before, but then it gets deleted straight away.

The file with the first two characters replaced by ~$ is still there, and doesn't get deleted, but it doesn't apparently cause any problems.

I am cautiously optimistic. Certainly the behaviour is very different, even though I am shown as the user in exactly the same way as before. But when I look at the Permissions tab in Properties it is very much different. It is odd to me that the effect would be so different, and particularly because everything works fine from the Finder and Illustrator. But it looks as if Word, Excel and Preview (and possibly others) maybe need the access permission to be assigned to a group rather than individual users for their saving behaviour to operate correctly.
 
Sounds promising, hopefully a you’ll find a solution. It could be a just re-saving the advanced/enhanced permissions does something.

The ~$ file is a deleted when you close the main file. It’s probably how Word etc know to say ‘this file is locked for editing’.
 
Have you guys tried turning off SMB and try using just AFS?
AFP is not recommended and deprecated by Apple for years.


Best regards,
Maciej
 
AFP is not recommended and deprecated by Apple for years.


Best regards,
Maciej

Yea, until they remove it, it seems to always have less issues than SMB. And it's depreciated as a server, ie, your Mac cannot serve AFP. It works perfectly well as a client, and I would argue, more reliably with less issues if you do a lot of Mac based work on your Synology. At least for me. YMMV.
 
Last edited:
I let my enthusiasm get the better of me. Although I did see things finally working correctly when I first made the change, with one folder created and then quickly deleted when you save a file, it has now gone back to the same problem again.

I am not sure there is any difference, but what I now observe is that when you save a file from Word for the first time it creates two folders with funny names. If you delete these (through DSM) it then creates five more folders. If you delete these as well then the application on the Mac finally stops beachballing.

On the second and subsequent time you save the document it also creates the file with the name starting ~$, and you have to delete this as well in order to kick the application back into life.

I cannot say what has changed that now causes the old behaviour to have resurfaced, or what ingredients resulted in the correct behaviour for a short while.
[automerge]1688663706[/automerge]
AFP is not recommended and deprecated by Apple for years.


Best regards,
Maciej
OK, well I have turned off SMB and turned on AFP, and the folder issue seems to have gone altogether. There are no folders created by Word or Preview when saving via AFP. The save from Word completes almost instantly with no stalls at all. There is still the ~$ file but that doesn't seem to cause any problems.

Preview also saves instantly with no stalls, no folders, no problems.

The permissions are unchanged from what they were with SMB.

I hate to have to go back to AFP given that is has been deprecated for so long, but in the circumstances that is what I will now do.

I didn't think to even try it because of how long it has now been that Apple have been telling people to move over to SMB and stop using AFP, but until this issue with SMB is sorted out it is the only sensible thing to do!
 
I let my enthusiasm get the better of me. Although I did see things finally working correctly when I first made the change, with one folder created and then quickly deleted when you save a file, it has now gone back to the same problem again.

I am not sure there is any difference, but what I now observe is that when you save a file from Word for the first time it creates two folders with funny names. If you delete these (through DSM) it then creates five more folders. If you delete these as well then the application on the Mac finally stops beachballing.

On the second and subsequent time you save the document it also creates the file with the name starting ~$, and you have to delete this as well in order to kick the application back into life.

I cannot say what has changed that now causes the old behaviour to have resurfaced, or what ingredients resulted in the correct behaviour for a short while.
[automerge]1688663706[/automerge]

OK, well I have turned off SMB and turned on AFP, and the folder issue seems to have gone altogether. There are no folders created by Word or Preview when saving via AFP. The save from Word completes almost instantly with no stalls at all. There is still the ~$ file but that doesn't seem to cause any problems.

Preview also saves instantly with no stalls, no folders, no problems.

The permissions are unchanged from what they were with SMB.

I hate to have to go back to AFP given that is has been deprecated for so long, but in the circumstances that is what I will now do.

I didn't think to even try it because of how long it has now been that Apple have been telling people to move over to SMB and stop using AFP, but until this issue with SMB is sorted out it is the only sensible thing to do!

Glad it's working for you. Personally I feel the exact opposite way. I LOATHE SMB with a hatred of 10000 suns. IT HAS ALWAYS been a burning dumpster fire when interacting with a Mac, and to this day, still is. I will loathe it when apple removes AFP client protocol from the Mac, and hope they do not for a very long time. The above just being the latest instance of that long history of awfulness that is SMB.

TLDR: I rest my case.
 
Last edited by a moderator:
The ~$ file is a deleted when you close the main file. It’s probably how Word etc know to say ‘this file is locked for editing’.
Yes this is normal behaviour for Word & Excel; these apps on windows do this, as well as on Macs.

OP, fwiw I use Word, Excel and various Apple apps with SMB/CIFS on both Synology and Linux shares, and have never experienced the issues you describe. I have also system admin'd at various shops running Mac and Windows clients saving to SMB shares, and have never experienced these issues there either. Given that, this is not a general issue caused by using SMB shares on all Macs, but has to be caused by something specific in your setup and as such it should be possible to get to the bottom of the issue and fix it.

In your previous posts you seem to have gone fairly deep down the rabbit hole of custom SMB configuration settings... I just took a look on the Mac I'm writing this on (M1 Pro, Ventura 13.4.1) and I dont even have a custom nsmb.conf on this machine. I've created them on earlier Macs, but presumably at some point this one got setup from scratch and I've never had the need to fiddle with the SMB settings since. Perhaps its worth starting from scratch and removing your nsmb.conf and trying your Mac with the default baked-in config? It'd be quick to try.
 
Last edited:
@HappyDays Since you have a DS218+ you could do another test: if you haven't used your free Virtual DSM licence yet, install Virtual Machine Manager and spin up a default Virtual DSM 7. You can then test if the SMB issue replicates on a fresh install of DSM 7.2. This is a good go-to approach for testing issues (akin to using a new user account on Mac to see if there's a problem with non-default apps and agents in your usual account).

I have VMM setup with a small storage area assigned and assign 1 CPU core and 1 GB RAM to the vDSM, when running. When I'm not testing then the vDSM is powered off and there is no CPU or RAM assigned.

Like others on the thread, I have switched off AFP on all three NAS and now only use SMB with my Macs. Someone recently raised a SMB issue with DSM account names containing '.'. Maybe there is some other quirk in your specific NAS setup that the rest of us aren't doing.
 
@fredbert thanks, a good suggestion. I don't have time to pursue it right now but when I do I will certainly try that out. Is it the case that you do not get the symptom I have with Word and Preview of these folders being created when using SMB? I have struggled for so long with this issue and it is a great frustration, particularly now when the only solution is to log on to DSM and delete the folders in order to kick everything back into life. I have been amazed that when using AFP the folders just aren't created, and I can't imagine what could be behind them being created over SMB but not over AFP.

@Fortran - for quite a while I ws running without an nsmb.conf and the same issue was occurring. I re-implemented the nsmb.conf to see if it would help but it had no effect.

I will not be able to play with this for a couple of weeks now (holiday) but when I return I will try various things. I am fairly pleased to have it operating using AFP for the moment but AFP has its drawbacks - it is much slower than SMB for all transactions in the Finder for example. But it works and getting on with business rather than wasting lots of time trying to sort out IT issues is quite important right now...
 
@Fortran - for quite a while I ws running without an nsmb.conf and the same issue was occurring. I re-implemented the nsmb.conf to see if it would help but it had no effect.
If true, once tested, this at least means you can stop pursuing the nsmb.conf tweaks angle as a solution. But test it first by renaming your nsmb.conf and rebooting.

The other aspect you should look at is the share and folder permissions of the shares in question on the NAS.
  • The user that is used to connect to the SMB shares should have full read/write permissions on the share and folder that you're accessing.
  • Using the 'Permissions Inspector' on the folder, also give the user 'Administration' permissions on the folder if they haven't already got this.
It sounds as though eg Word is creating temp files but is not subsequently able to delete them when the file is closed.
 
Is it the case that you do not get the symptom I have with Word and Preview of these folders being created when using SMB?
I enabled viewing hidden files in Finder; so I could see the temporary file and folder being created and disappearing. So for me I do see the $file and the temp save folder, but they also disappear when the original file is close and saved, respectively. I am not experiencing the freeze that you are.


And yes I recall that I also found SMB being faster than AFP, along with depreciation the speed was the reason I switched over.
 
Have just seen SMB Service has been updated today.

 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Popular tags from this forum

Similar threads

I'm having an issue with an app (not sure if it matters which one, details below) saving files with...
Replies
0
Views
545

Thread Tags

Tags Tags
macos smb

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending content in this forum

Back
Top