Peter Turcsanyi created NIFI-16385:
--------------------------------------

             Summary: SMB processors fail if SMB2 ECHO is not supported by the 
server
                 Key: NIFI-16385
                 URL: https://issues.apache.org/jira/browse/NIFI-16385
             Project: Apache NiFi
          Issue Type: Bug
            Reporter: Peter Turcsanyi
            Assignee: Peter Turcsanyi


NIFI-12837 introduced connection health check because the underlying smbj 
library can return stale connections from its pool. The NiFi side code can 
handle the failed connection (reopen on exception) but it is more problematic 
when DFS is used and the smbj client opens sessions to the linked servers 
internally (not visible to our code) and it does not check if the cached 
connection is alive or not.

To solve the stale connection issue, the NiFi code intercepts the 
"getConnection" call, validates the connection, and opens a new one if 
necessary. The [health 
check|https://github.com/apache/nifi/blob/751efb02f0360f89266d625cbda8e7c3a00465ee/nifi-extension-bundles/nifi-smb-bundle/nifi-smb-smbj-common/src/main/java/org/apache/nifi/smb/common/SmbClient.java#L80]
 is performed via an SMB2 ECHO call. This approach properly works on Windows 
Server and Linux/Samba but other servers (like Dell PowerScale) may reject the 
ECHO. Actually, these servers strictly follow the SMB specification which says 
about the [SMB2 
ECHO|https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-smb2/fa23e613-2768-49e5-aa68-97c4bba72379]
 request: _“If Connection.SessionTable is empty, the server SHOULD<405> 
disconnect the connection.”_

Result on the client side:
{code:java}
2026-09-24 22:32:52,172 INFO [Packet Reader for 10.17.189.79, Original Thread 
name: Timer-Driven Process Thread-2] c.h.s.t.tcp.direct.DirectTcpPacketReader 
PacketReader e
rror, got exception.
com.hierynomus.protocol.transport.TransportException: java.io.EOFException: EOF 
while reading packet
        at 
com.hierynomus.smbj.transport.tcp.direct.DirectTcpPacketReader.readFully(DirectTcpPacketReader.java:72)
        at 
com.hierynomus.smbj.transport.tcp.direct.DirectTcpPacketReader.readTcpHeader(DirectTcpPacketReader.java:59)
        at 
com.hierynomus.smbj.transport.tcp.direct.DirectTcpPacketReader.doRead(DirectTcpPacketReader.java:48)
        at 
com.hierynomus.smbj.transport.PacketReader.readPacket(PacketReader.java:75)
        at com.hierynomus.smbj.transport.PacketReader.run(PacketReader.java:53)
        at java.base/java.lang.Thread.run(Thread.java:1583) {code}
As the health check is critical for DFS only, it can be made optional for 
environments where the server does not support it (and no DFS is in use).

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to