SMB shares disappear from Mac laptop

pedz

Dabbler
Joined
Jan 29, 2022
Messages
35
When things are working right, I can open a Finder window and click on Network in the left margin and I see my NAS server. Also, I can open Time Machine and it will find the time_machine share. But, this state has become rather short lived. I rebooted only a few hours ago and got back to the working state. Started a backup. It says it finished. But at this point, the Network window does not show the NAS server and time machine can not find the share it uses to do backups.

I'm not 100% sure this is all NAS because from my iPad, things appear to be working ok although it is a different user interface.

But I'm hoping someone here can help me diagnose this. I don't know much about SMB shares. Is there the equivalent of "showmounts -e" for NFS -- something that will go out and find the SMB shares? Also, the NAS server is called "truenas" (original heh!). I can ping "truenas", "truenas.lan" (my local domain) and "truenas.local".

Looks like I have TrueNAS-12.0-U8.

I see there are other posts. I'll go explore those as well.
 

Alecmascot

Guru
Joined
Mar 18, 2014
Messages
1,177
I can ping "truenas", "truenas.lan" (my local domain) and "truenas.local".
Do all these hosts resolve to the same ip address ?
 

pedz

Dabbler
Joined
Jan 29, 2022
Messages
35
I wonder what the daemon is called that send out or response to the mDNS packets. I wonder if it is stuck, hung, or dead.
 

awasb

Patron
Joined
Jan 11, 2021
Messages
415
You could try and "restart" things by switching (in TrueNAS Core, that is)

Code:
Network -> Global Configuration -> mDNS (and maybe WS-Discovery for M$-clients)


to disabled. Save. Re-enable. Save.
 

pedz

Dabbler
Joined
Jan 29, 2022
Messages
35
You could try and "restart" things by switching (in TrueNAS Core, that is)

Code:
Network -> Global Configuration -> mDNS (and maybe WS-Discovery for M$-clients)


to disabled. Save. Re-enable. Save.
Thank you. That's the type of advice / suggestion I was hoping for.
 

x130844

Dabbler
Joined
Oct 25, 2020
Messages
46
After updating from freenas 11 to 12.x latest, I now start having problems with mDNS.
my shares disappear from all my clients.
If I run:
dns-sd -B _smb._tcp.
on the command line on a client, the truenas entry is now gone.
I then stop and restart the mDNS from the truenas admin console. and it works again.
Any idea why mDNS has to be restarted every so often, when on version 11. it was working fine. never had to restart that service. Should I submit a bug? or at least, how can I debug this properly?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
After updating from freenas 11 to 12.x latest, I now start having problems with mDNS.
my shares disappear from all my clients.
If I run:
dns-sd -B _smb._tcp.
on the command line on a client, the truenas entry is now gone.
I then stop and restart the mDNS from the truenas admin console. and it works again.
Any idea why mDNS has to be restarted every so often, when on version 11. it was working fine. never had to restart that service. Should I submit a bug? or at least, how can I debug this properly?
TrueNAS 12 / Scale use avahi rather than mDNSResponder. What version of 11 were you using? We had one version where there was a thread that was constantly browsing ourselves over mDNS so that advertisements we constantly happening to "fix" cases where home network mDNS was kind of broken.
 

x130844

Dabbler
Joined
Oct 25, 2020
Messages
46
TrueNAS 12 / Scale use avahi rather than mDNSResponder. What version of 11 were you using? We had one version where there was a thread that was constantly browsing ourselves over mDNS so that advertisements we constantly happening to "fix" cases where home network mDNS was kind of broken.
I was using the latest 11. (11.3-U5?)
Still testing, is it possible that pi-hole could be created some issues with avahi?
truenas disappeared again, and before I recycled the mDNS button from the console. I tried to disable pi-hole just to see. bam, the mount showed back up again.
maybe it was luck, I'm still testing.. .
something is definitely different between 11 and 12. glad you confirmed the change with avahi vs mDNSResponder
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I was using the latest 11. (11.3-U5?)
Still testing, is it possible that pi-hole could be created some issues with avahi?
truenas disappeared again, and before I recycled the mDNS button from the console. I tried to disable pi-hole just to see. bam, the mount showed back up again.
maybe it was luck, I'm still testing.. .
something is definitely different between 11 and 12. glad you confirmed the change with avahi vs mDNSResponder
Yeah, the mDNS implementation in 11.3 is something that I wrote using py-bonjour actually (cython-ized mDNSResponder IIRC). It's important to note that badly-behaved devices can cause mDNS to not function properly on a network (some vendors get around this by continually spamming the network with service announcements).
 

x130844

Dabbler
Joined
Oct 25, 2020
Messages
46
Yeah, the mDNS implementation in 11.3 is something that I wrote using py-bonjour actually (cython-ized mDNSResponder IIRC). It's important to note that badly-behaved devices can cause mDNS to not function properly on a network (some vendors get around this by continually spamming the network with service announcements).
Well good job on your code from 11.3 :) it worked great. Do you happen to have any suggestions on how one can debug the needing to cycle mDNS to get it to reappear on the network?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Well good job on your code from 11.3 :) it worked great. Do you happen to have any suggestions on how one can debug the needing to cycle mDNS to get it to reappear on the network?
Hmm... try running avahi in debug mode, maybe get packet captures from your network and see what's going on in general in the mDNS-wise. Try manually editing the avahi config file and hard-code it so that it's only bound to one interface.
 

pedz

Dabbler
Joined
Jan 29, 2022
Messages
35
I tried turning mDNS off and on via the Truenas web GUI and I still can't see anything from the Truenas server via Apple's Finder, Time Machine, or a 3rd party app called "Discovery". When things are "working", all three of those can see entries from the NAS.

When the mDNS is disabled, the entries in /usr/local/etc/avahi/services are erased. So, when it was enabled, I copied those files over to a temp directory. Disable mDNS via the GUI, and then ran avahi-daemon --debug (as root) after replacing the services files. I don't see any nasty messages. This is version 0.7 and I see there is a version 0.8 out. The interface is found, the IPv4 address is correct, the services files are all read without errors.

I can mount my "Users" SMB share from my Mac via "Connect to Server" and then I type in smb://truenas.local/Users/pedz and it mounts. But I can't do this with the Time Machine entry... so... until I can get mDNS working, I can't do Time Machine backups.

I don't really want to reboot because I have processes that are running that I don't want to interrupt PLUS ... after a reboot, it seems to work for only a short while and then I'm back in the same boat. So, I'd like to figure out how to get this back working.

I could do network traces as was suggested but I don't know what I would be looking for.
Found user 'avahi' (UID 200) and group 'avahi' (GID 200).
Successfully dropped root privileges.
avahi-daemon 0.7 starting up.
Loading service file /usr/local/etc/avahi/services/ADISK.service.
Loading service file /usr/local/etc/avahi/services/AFPOVERTCP.service.
Loading service file /usr/local/etc/avahi/services/DEV_INFO.service.
Loading service file /usr/local/etc/avahi/services/HTTP.service.
Loading service file /usr/local/etc/avahi/services/HTTPS.service.
Loading service file /usr/local/etc/avahi/services/MIDDLEWARE.service.
Loading service file /usr/local/etc/avahi/services/MIDDLEWARE_SSL.service.
Loading service file /usr/local/etc/avahi/services/SFTP_SSH.service.
Loading service file /usr/local/etc/avahi/services/SMB.service.
Loading service file /usr/local/etc/avahi/services/SSH.service.
Joining mDNS multicast group on interface ix0.IPv4 with address 192.168.1.3.
New relevant interface ix0.IPv4 for mDNS.
Network interface enumeration completed.
Registering new address record for fe80::3cec:efff:fe6d:2ab6 on vnet0.3.*.
Registering new address record for fe80::3cec:efff:fe2b:5fe2 on vnet0.1.*.
Registering new address record for 192.168.1.3 on ix0.IPv4.
Server startup complete. Host name is truenas.local. Local service cookie is 535196288.
 

x130844

Dabbler
Joined
Oct 25, 2020
Messages
46
I tried turning mDNS off and on via the Truenas web GUI and I still can't see anything from the Truenas server via Apple's Finder, Time Machine, or a 3rd party app called "Discovery". When things are "working", all three of those can see entries from the NAS.

When the mDNS is disabled, the entries in /usr/local/etc/avahi/services are erased. So, when it was enabled, I copied those files over to a temp directory. Disable mDNS via the GUI, and then ran avahi-daemon --debug (as root) after replacing the services files. I don't see any nasty messages. This is version 0.7 and I see there is a version 0.8 out. The interface is found, the IPv4 address is correct, the services files are all read without errors.

I can mount my "Users" SMB share from my Mac via "Connect to Server" and then I type in smb://truenas.local/Users/pedz and it mounts. But I can't do this with the Time Machine entry... so... until I can get mDNS working, I can't do Time Machine backups.

I don't really want to reboot because I have processes that are running that I don't want to interrupt PLUS ... after a reboot, it seems to work for only a short while and then I'm back in the same boat. So, I'd like to figure out how to get this back working.

I could do network traces as was suggested but I don't know what I would be looking for.

Same boat here, have to reboot the client, although on Monterey, this seems to work.

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
 
Last edited:

pedz

Dabbler
Joined
Jan 29, 2022
Messages
35
Same boat here, have to reboot the client, although on Monterey, this seems to work.

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
That didn't work for me. I have three laptops in the same situation.

I signed up for the avahi mailing list and sent an email to them. No reply yet.
 

pedz

Dabbler
Joined
Jan 29, 2022
Messages
35
General Disclaimer -- I have NO idea what I'm doing so do what I do at your own risk!! :smile:

I logged in a root on the NAS, set `use-ipv6=yes` in /usr/local/etc/avahi/avahi-daemon.conf, and did `avahi-daemon --reload`. It is now "working".

I've noticed more and more, Apple products using IPv6 addresses so I thought I'd give it a whirl. Could be just a coincidence. We'll see...
 
Last edited:

x130844

Dabbler
Joined
Oct 25, 2020
Messages
46
General Disclaimer -- I have NO idea what I'm doing so do what I do at your own risk!! :smile:

I logged in a root on the NAS, set `use-ipv6=yes` in /usr/local/etc/avahi/avahi-daemon.conf, and did `avahi-daemon --reload`. It is now "working".

I've noticed more and more, Apple products using IPv6 addresses so I thought I'd give it a whirl. Could be just a coincidence. We'll see...
hmm I have ipv6 turned off.
but:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
works, if I then of course restart dock and finder.
killall Finder
killall Dock

Maybe I should re-enable ipv6 on my router? and use ipv6 everywhere (as default?)
 
Top