SMB share issue with macOS Sierra

Status
Not open for further replies.

cpts

Dabbler
Joined
Aug 9, 2011
Messages
22
I've been trying to get SMB sharing to play nice with my macs after a long time using NFS. I use automount/autofs to keep shares mounted which has been working fine with NFS, but I keep running into an issue when I try SMB. Here's the error from the Mac's console:

kCFURLVolumeIsAutomountedKey missing for file:///iserve/Data/: Error Domain=NSCocoaErrorDomain Code=257 "The file “Data” couldn’t be opened because you don’t have permission to view it." UserInfo={NSURL=file:///iserve/Data/, NSFilePath=/iserve/Data, NSUnderlyingError=0x600000452a20 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}

The shares will mount initially, then generally only one of them (I have two shares) will disconnect and I'll see this error. This happens at least once a day and usually requires a reboot of the Mac. While it's working, I have no issues whatsoever accessing files on either share (reading, writing, deleting, etc...). My setup is not complex, the dataset owner/group are the same as the SMB user and permissions are basically a free-for-all - read/write/execute for all.

I'm running FreeNAS 11 RC, though I've seen the same error on 9.10 stable.

I'd appreciate any suggestions.
 
Last edited:

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I've been trying to get SMB sharing to play nice with my macs after a long time using NFS. I use automount/autofs to keep shares mounted which has been working fine with NFS, but I keep running into an issue when I try SMB. Here's the error from the Mac's console:

kCFURLVolumeIsAutomountedKey missing for file:///iserve/Data/: Error Domain=NSCocoaErrorDomain Code=257 "The file “Data” couldn’t be opened because you don’t have permission to view it." UserInfo={NSURL=file:///iserve/Data/, NSFilePath=/iserve/Data, NSUnderlyingError=0x600000452a20 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}

The shares will mount initially, then generally only one of them (I have two shares) will disconnect and I'll see this error. This happens at least once a day and usually requires a reboot of the Mac. While it's working, I have no issues whatsoever accessing files on either share (reading, writing, deleting, etc...). My setup is not complex, the dataset owner/group are the same as the SMB user and permissions are basically a free-for-all - read/write/execute for all.

I'm running FreeNAS 11 RC, though I've seen the same error on 9.10 stable.

I'd appreciate any suggestions.

Does this happen if you mount by ip address rather than hostname? (Warning- not a Mac user)
 

cpts

Dabbler
Joined
Aug 9, 2011
Messages
22
Good question. I was 100% sure I was using the ip address, but a quick check and it looks like I'm mounting by hostname. I'll change it and see what happens.
 

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,478
So let me get this straight: you want to automatically mount an SMB share when the user logs in?

Why not just add the relevant IP address and path in the login items and be done?
 

cpts

Dabbler
Joined
Aug 9, 2011
Messages
22
So let me get this straight: you want to automatically mount an SMB share when the user logs in?

Why not just add the relevant IP address and path in the login items and be done?

I found that to be much less reliable in the past (i.e. computer wakes from sleep and mounts are gone). Granted, that was several OS versions ago, might be worth another shot.
 

cpts

Dabbler
Joined
Aug 9, 2011
Messages
22
Does this happen if you mount by ip address rather than hostname? (Warning- not a Mac user)

Using IP address didn't help. I'm going to try nojohnny101's suggestion as it's been awhile.
 

cpts

Dabbler
Joined
Aug 9, 2011
Messages
22
Problem with adding it to login items is that it almost always tries to mount prior to the network being up resulting in an error. Also recovery of those mounts after waking from sleep is as good as it ever was (i.e. bad). Oh well, I'll stick with NFS for now I guess.
 

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,478
How are you exactly adding it to auto mount upon login? Is this computer connected via wifi or wire?

I have also used tools such as applescript and automator with good success when I need to build in delays or put wait commands within a task sequence.
 

RichR

Explorer
Joined
Oct 20, 2011
Messages
77
Let me guess - you are running Sierra 10.12?..... Same scenario but slightly different details.... So, I administer numerous remote machines, and some had to use larger Synology devices. Using SMB shares with 10.11 had not been an issue in the past, and the connections were stable. In using them with 10.12, at some point the connection would hose Finder, and restarting Finder by numerous methods proved to be fruitless, with the only way to get a clean machine again was to reboot.

As soon as I switched the machines to AFP, I had no problem. Although it's supposedly deprecated, it works. IT seems something with SMB on recent OS X is jacked, whether it be version 2 or 3, and playing with numerous settings on the share side nothing seemed to fix the problem reliably. That being said, I have numerous FreeNAS boxes sharing to OS X.10 and 11, and 12 via AFP, and have had 0 issues.
 

cpts

Dabbler
Joined
Aug 9, 2011
Messages
22
How are you exactly adding it to auto mount upon login? Is this computer connected via wifi or wire?

I have also used tools such as applescript and automator with good success when I need to build in delays or put wait commands within a task sequence.

I can get around the startup mounting by adding a delay in an automator action, but what I can't get sorted is the random dropouts after being logged in. I'm looking for something without friction so when family members need to access files, they're always there. The good news is that this works perfectly with NFS on mac and linux clients. The bad news is that there's no way to access NFS shares on iOS so I'm using both SMB and NFS to share the same set of files.
 
Last edited:

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,478
As per @RichR what version of Mac OS X are you running?

but what I can't get sorted is the random dropouts after being logged.
Sorry I missed this in your initial post, I was focusing on helping you to automount. Some more questions:
- what are your permissions for the shares and relevant datasets (Mac, windows, unix)?
- is the random disconnect happening when you are always accessing the share (i.e. Messing with files) or does it happen even when the share sits idle?
- you said you have two shares, does the disconnect always happen to the same share?

The bad news is that there's no way to access NFS shares on iOS so I'm using both SMB and NFS to share the same set of files.
Don't do that. Bad things happen when you try accessing the same dataset with two different sharing protocols at once (unless you give one strict read-only restrictions).
 

cpts

Dabbler
Joined
Aug 9, 2011
Messages
22
As per @RichR what version of Mac OS X are you running?
10.12.5 (macOS Sierra)
- what are your permissions for the shares and relevant datasets (Mac, windows, unix)?
Unix, though I've tried Windows as well. I always assumed Unix was a better option to cover Mac and Linux, though since I've little to lose, I'm trying Mac permissions now.
- is the random disconnect happening when you are always accessing the share (i.e. Messing with files) or does it happen even when the share sits idle?
This happens when the share sits idle, though this might be coincidental.
- you said you have two shares, does the disconnect always happen to the same share?
It happens with either share.
Don't do that. Bad things happen when you try accessing the same dataset with two different sharing protocols at once (unless you give one strict read-only restrictions).
That's why I'm trying to get SMB to work on the Mac. I might have to switch to AFP as that seems supported across all my devices, though I'm trying to avoid it as it will be deprecated.
 
Last edited:

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,478
Well as others have stated, Mac OS X 10.12.x has been having some problems that people have been posting about on the forums. How long have you been dealing with these problems? Did you make any changes/upgrades around the time these problems starting showing up?

Do you get any errors on the freenas side when this happens? and you said you have to restart to get the SMB shoes to mount again? Have you tried just restarting the SMB service possibly?

From your error code, it obviously is a permissions problem. If that is indeed the case, I would further test by creating a fresh dataset with appropriate permissions and a few test files and see if it stays connected. @anodos is the resident expert on permissions, if he chimes back in, he can advise on what your permission settings should be to start off (which permissions type to choose for the dataset given your environment).
 

cpts

Dabbler
Joined
Aug 9, 2011
Messages
22
Well I hate to celebrate prematurely, but using the Mac permissions has given me around 9 hours of access to the share without dropping the connection. I wish I had tried this sooner.
 

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,478
Well I hate to celebrate prematurely
Famous last words ;)

That's great. Keep us posted!
 

cpts

Dabbler
Joined
Aug 9, 2011
Messages
22
Famous last words ;)

That's great. Keep us posted!
Arg! I should have know better than to type that. Same error with both shares. I couldn't figure out how to restart SMB only on the mac and interestingly, one share always seems to be available.

I seem to recall having issues like this running 10.11.x running FreeNAS 9.10. And the only reason I'm switching from NFS which has yet to fail is so I can access shares from iOS devices.
 

cpts

Dabbler
Joined
Aug 9, 2011
Messages
22
Post the contents of /usr/local/etc/smb4.conf.

[global]
server max protocol = SMB3
encrypt passwords = yes
dns proxy = no
strict locking = no
oplocks = yes
deadtime = 15
max log size = 51200
max open files = 462863
logging = file
load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes
getwd cache = yes
guest account = tony
map to guest = Bad User
obey pam restrictions = yes
ntlm auth = no
directory name cache size = 0
kernel change notify = no
panic action = /usr/local/libexec/samba/samba-backtrace
nsupdate command = /usr/local/bin/samba-nsupdate -g
server string = FreeNAS Server
ea support = yes
store dos attributes = yes
lm announce = yes
hostname lookups = yes
acl allow execute always = true
dos filemode = yes
multicast dns register = yes
domain logons = no
local master = yes
idmap config *: backend = tdb
idmap config *: range = 90000001-100000000
server role = standalone
netbios name = ISERVE
workgroup = WORKGROUP
security = user
pid directory = /var/run/samba
create mask = 0666
directory mask = 0777
client ntlmv2 auth = yes
dos charset = CP437
unix charset = UTF-8
log level = 1


[Media]
path = "/mnt/z2pool/media"
printable = no
veto files = /.snapshot/.windows/.mac/.zfs/
writeable = yes
browseable = yes
vfs objects = zfs_space zfsacl catia fruit streams_xattr aio_pthread
hide dot files = yes
guest ok = no
nfs4:mode = special
nfs4:acedup = merge
nfs4:chown = true
zfsacl:acesort = dontcare


[Remote]
path = "/mnt/z2pool/remote"
printable = no
veto files = /.snapshot/.windows/.mac/.zfs/
writeable = yes
browseable = yes
vfs objects = zfs_space zfsacl catia fruit streams_xattr aio_pthread
hide dot files = yes
guest ok = no
nfs4:mode = special
nfs4:acedup = merge
nfs4:chown = true
zfsacl:acesort = dontcare

 
Status
Not open for further replies.
Top