I’ve some Ubuntu Servers working Samba with Winbind. Every little thing is okay, however Macs will randomly disconnect in a single day, or at some irregular interval.
On the servers, Samba logs this as two occasions:
1: ../source3/smbd/service.c:1050(close_cnum) 2: closed connection to service knowledge
By matching timestamps on the Macs I can see they log the drops as:
kcm DEPRECATED USE in libdispatch shopper: Setting timer interval to 0 requests a 1ns timer, did you imply FOREVER (a one-shot timer)?; set a breakpoint on _dispatch_bug_deprecated to debug
By analyzing timestamps I’ve decided that that is the one occasion logged on the Mac purchasers’ aspect. Right here is an instance shopper that has a shell script writing to a textual content file on a share each ten seconds:
You may see the connection was alive at 08:59:46
within the textual content file on the left, and in /var/log/system.log
there’s solely a single related message.
I requested on the Samba checklist serve about it and have been advised the Macs are merely closing the connections.
Replace:
Wireshark evaluation reveals some extra info:
- STATUS_NETWORK_SESSION_EXPIRED
- SATATUS_INVALID_PARAMETER
- STATUS_NETWORK_NAME_DELETED
Right here is the ultimate SMB2
message (second from backside): Negotiate Protocol Response
:
As if to confound, there’s an NT Standing: STATUS_SUCCESS
messages in there (see annotation).
Here’s what Microsoft says in regards to the error:
If the Standing area within the SMB2 header is
STATUS_NETWORK_SESSION_EXPIRED, the shopper MUST try and
reauthenticate the session that’s recognized by the SessionId within the
SMB2 header, as laid out in part 3.2.4.2.3. If the
reauthentication try succeeds, the shopper MUST retry the request
that failed with STATUS_NETWORK_SESSION_EXPIRED. If the
reauthentication try fails, the shopper MUST fail the operation and
terminate the session, as laid out in part 3.2.4.23.
Is there a script I can run to only renew the session in a cron job?
Finish replace
Different varieties purchasers will hold the connections open ceaselessly, so it does certainly seem to be solely Macs are doing this. The OS variations range from OS X 10.12 to macOS Catalina, utilizing numerous flavors of SMB2 to SMB3.
Any concept how I can start to grasp why the macs are doing this, or any recommendations on getting them to maintain the connections alive?
The Mac purchasers are working jobs that depend on a persistent connection.
Extremely related to know, however initially omitted as I used to be on the lookout for a workaround:
I’ve a few dozen of those servers (largely Ubuntu 18.04; Samba 4.7.6) working advantageous for the previous a number of years. Three of them had automated updates put in, and these three have the difficulty of the Macs disconnecting. I am holding again letting the opposite servers restart for the updates, and the Macs is not going to drop connections to the non-updated servers.
As a take a look at I setup a server to 16.04 to see if and older model of Ubuntu Server would pose the identical problem. Surprisingly it has the identical downside utilizing a unique model of Samba (4.3.11). I should do the take a look at once more, with out letting 16.04 set up the most recent safety updates, in an effort to affirm my suspicions that these are the reason for the issue.
Although I believe one thing in Ubuntu’s core modified, I’m asking right here since solely Macs are affected.
On various Macs with OSes from 10.12 to Catalina I’ve tried testing them with their default settings, and all doable mixtures of adjustments to /and so on/nsmb.conf
:
[default] signing_required=no protocol_vers_map=[see manpage for nsmb.conf (linked below)]
I’ve additionally tried disabling all sleep and powersaving choices, and even utilizing a pleasant cafffinate
wrapper, KeepingYouAwake, to implement this.
On the server I’ve tried following the recommendation of one other sysadmin on the #macosx freenode channel, kode54, who shared how they ultimately acquired a steady connection.
The recommendation did not assist–effectively I have never totally tried it because it requires putting in a model of Samba from a PPA for a model of Samba maintained by the Linux for Faculties Challenge–however knowledgeable me of vfs_fruit
and the actual fact that there’s a developmental effort of extending Samba by means of an additional bundle for, partially, coping with Macs. It additionally led me to discover a web page on Samba’s wiki discussing difficulties with Macs and server-side workarounds: Configure Samba to Work Higher with Mac OS X
It is tough for me to strive putting in prompt Samba PPA as a result of these servers are fileservers partially solely, and are usually at all times getting used for compute jobs that may take days to run (neuroimaging processing). They have been constructed for compute jobs, and do storage virtually as a side-effect of the dual-socket, high-memory density, server choices additionally taking place to be the servers with the big variety of drive bays (16+).
I am hoping to strive different choices earlier than changing into totally negatively disruptive.
Since not one of the server-side choices are serving to–I have been making an attempt the flags in numerous mixtures no to avail–I’m hoping that the Apple neighborhood could have some workaround for me.
Any means of preserving a persistent connection, regardless of the place the difficulty could originate, can be extremely beneficial.