Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Nov 2019 09:33:33 +1100
From:      Andrew Reilly <areilly@bigpond.net.au>
To:        Chris Gordon <chris@theory14.net>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: Long-shot: repeatable macOS samba share unmounting during Lightroom import
Message-ID:  <EDA5B7C6-C1FC-4AD3-9C8F-E7E494777988@bigpond.net.au>
In-Reply-To: <C943835D-2691-46D7-B90B-51FB1047B0D4@theory14.net>
References:  <28504691-D08B-483B-B4C5-CA47F2C523ED@bigpond.net.au> <C943835D-2691-46D7-B90B-51FB1047B0D4@theory14.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Chris,

> On 25 Nov 2019, at 05:12, Chris Gordon <chris@theory14.net> wrote:
>=20
> WARNING:  Mostly deviating from a FreeBSD specific discion
>=20
>> On Nov 23, 2019, at 9:33 PM, Andrew Reilly <areilly@bigpond.net.au> =
wrote:
>>=20
>> Hi all,
>>=20
>> This is a long-shot question, because it involves a lot of moving
>> pieces, most of which are opaque commercial, poorly documented
>> things.  Never the less, it does involve FreeBSD-stable as one of
>> the players, and my experience over the years has been that FreeBSD
>> folk are both knowledgeable and helpful, so here's hoping.  Herwith
>> my tale of computer-induced irritation:
>>=20
>> The story takes place at home, where the FreeBSD system in question
>> is a local network file server.  The FreeBSD tracks -STABLE every
>> week.  It boots from ZFS on NVM flash and has four 4TB Hitachi ATA
>> drives in a RAIDZ.  The current motherboard has a Ryzen 7 1700
>> 8-core locked at 3GHz by the bios to avoid a problem of going to
>> sleep permanently by failing to come out of some sort of low-power
>> state.  It has 32G RAM.  It has intel "PRO/1000 PCI-Express Network
>> Driver" network connected to a simple gigabit switch, with both
>> IPv4 and IPv6 configured and working.
>>=20
>> The other protagonist in this tale, also connected to the gigabit
>> LAN, is an iMac running current-Catalina on APFS flash, mounting
>> three filesystems over SMB, from Samba 4.10.10.  After appropriate
>> Samba tweaking this seems to be at least as reliable as it ever was
>> with netatalk or NFS, and apparently better supported by Apple.
>>=20
>> I keep my Lightroom Classic catalogue on the mac's local (flash)
>> drive, but the photo storage is on the network.  The Import Backups
>> directory is also on (a different) network drive.  I use Lightroom's
>> Import function to copy photos off SD cards using the mac's built-in
>> SD card reader and register with the catalogue.  So far so normal,
>> I think.
>>=20
>> The problem arose about ?three or four? months ago: could be
>> coincident with OS or Lightroom upgrades, I can't remember, but I
>> haven't changed anything about the setup, configuration or workflow.
>> Now, every single time Lightroom does an import, while it's doing
>> the first scan of the SD card to identify photos that it's seen
>> before, all three of the Samba filesystems unmount from the mac,
>> silently.  I can find no record of error in any of the logs,
>> suggesting that the system thinks that it happened deliberately.
>> Needless to say, this throws out the import workflow, although it
>> manages to pick itself up OK if I just re-mount everything.
>>=20
>> Anyone have any similar experiences?  Any thoughts of where I could
>> poke it to find out why this might be happening?  It feels like a
>> time-out bug somewhere, but (a) there is no complaint, and (b) the
>> network traffic is light at the time.  Needless to say Apple
>> documentation is useless.
>>=20
>> Probably another good reason to find an alternative to Lightroom...
>=20
> Other than the hardware specifics, I have the same exact workflow and =
same players involved.
>=20
> Maybe an odd question, but how are you mounting the SMB shares?

In the fallback instance, I mount them with Finder command-K (Go -> =
Connect to Server).  Usually they mount automatically when I log in, =
because I have them in my Startup Items.

>=20
> Since updating to Catalina, I've found lots of problems dealing with =
SMB using the Finder window and the items under the Locations side bar.  =
For instance:
> - Mount a share.  At some point overnight when nothing is using it, =
the share is unmounted.  I can't find anything in the logs to say why, =
when, what, etc.  Just unmounted.

I haven't experienced any unattended unmounts.  Just during Lightroom =
import.

I _have_ noticed (in Catalina, not before), that the Finder Sidebar does =
not necessarily "keep up" with the mounted state of shares: after =
logging in, I have seen my shared folders appear on the desktop as they =
open, but the server listed in the side bar does not show the Eject icon =
that comes with being mounted.

> - With a fresh start of the Finder process and I can access the SMB =
server/shares.  After some time, activity, something, I only get =
"Connection Failed" and can't access anything.  What's really crazy, is =
that I can't even unmount mounted shares from under Locations when it =
gets in this state (I can unmount via right click on the desktop item, =
CLI, etc).  I see the share with the eject button, but just get useless =
error message (if anything).
> - Killing (killall -HUP Finder) makes everything work again for a =
short bit.

I've never been game to kill Finder from the command line.  If it comes =
to that I just reboot the mac.  I figure there are so many daemon =
processes involved these days that the chances of them not getting =
tangled on manual intervention are slim.

>=20
> If I mount the share via the Finder menubar (Go -> Connect to Server) =
everything works and is rock solid.  Mounts with no problems, no mystery =
unmount, etc.  I did test a Lightroom import and had no SMB issues when =
the shared where mounted via the menu bar.

After writing my call for help, I took a couple of test photos and did =
another import and nothing broke.  So perhaps there is an issue of =
import size, or an issue with the first import after starting Lightroom, =
or something.  I'll be doing more experimentation to see what specific =
issue triggers it.

>=20
> I also store all of my music on the server and access it via SMB =
mounts.  I've noticed that the Apple Music app will automatically mount =
the SMB share when I hit play.  Unlike iTunes, I assume it's more aware =
of the filesystem and mounts.  Even with the Finder window off in la-la =
land, the auto-mount by Music works fine.  Now if this behavior could =
only be exposed to every other app....

That sounds ominous.  I don't use the Apple Music app (Apple doesn't =
understand FLAC), but a precedent of automatically mounting and (one =
assumes) unmounting "media shares" could be a clue.

>=20
> My completely un-researched guess is that when they removed the =
NetBIOS support (one of the changes in Catalina), some bug was =
introduced or uncovered causing the problematic behavior.  My guess ins =
based on the assumption that the Finder window (not sure what to call =
it) displays all of the network browsing and discovery and  is the code =
path that was impacted by the NetBIOS change.  Any mount tied in with =
this path gets impacted, and when this goes south, it takes the mounts =
with it.  Mounting via other means doesn't bring in the associated path.

That sounds sort of plausible too.

FWIW I'm running Avahi on my FreeBSD system, and advertising the SAMBA =
shares in the "apple-approved" way:

/user/local/etc/avahi/services/smb.service:
<?xml version=3D"1.0" standalone=3D'no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
 <name replace-wildcards=3D"yes">%h</name>
 <service>
   <type>_smb._tcp</type>
   <port>445</port>
 </service>
 <service>
   <type>_device-info._tcp</type>
   <port>0</port>
   <txt-record>model=3DRackMac</txt-record>
 </service>
</service-group>

So I don't think that my system has been relying on NetBIOS at all.

>=20
> I will check each new OS X update to see if this issue goes away.  =
Until then, I just mount my shares via "Go- > 'Connect to Server'".   =
Also note that you can re-enable NetBIOS support in Catalina =
(https://medium.com/@gobinathm/how-to-access-smb-printer-shares-in-macos-c=
atalina-10-15-17ea91d2c10b).  I've not done nor tested that.
>=20
> Hopefully a minor tweak to how you mount the SMB share will save you =
the huge hassle of changing out tools.
>=20
> Hope that helps.
>=20
> Chris

Thanks for the suggestions.  I'll keep my eyes on the logs the next time =
I do a big Lightroom import.

Cheers,

Andrew Reilly
E: areilly@bigpond.net.au
M: +61-409-824-272




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?EDA5B7C6-C1FC-4AD3-9C8F-E7E494777988>