You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a very weird error that I can't trace down. When I try to delete a file, it deletes but throws an exception and even crashes Samba itself . I'm almost certain this has something to do with session.close() but I don't know what's going on. If I run this code against a test windows share it works, so some kind of Samba incompatibility?
Code followed by java stacktrace and Samba stacktrace
SmbConfig config = SmbConfig.builder()
.withMultiProtocolNegotiate(true)
.build();
SMBClient client = new SMBClient(config);
AuthenticationContext ac = new AuthenticationContext(smbUser, smbPass.toCharArray(), "");
Connection connection = client.connect(smbHost);
Session session = connection.authenticate(ac);
try {
DiskShare share = (DiskShare) session.connectShare(smbShare);
if(share.fileExists(finalString)) {
FileAllInformation info = share.getFileInformation(finalString);
if(info.getStandardInformation().isDirectory()) {
return new ResponseEntity<>("The specified path is a directory, not a file.", HttpStatus.BAD_REQUEST);
}
share.rm(finalString);
share.close();
return new ResponseEntity<>("File deleted successfully.", HttpStatus.OK);
} else {
return new ResponseEntity<>("File not found.", HttpStatus.NOT_FOUND);
}
} catch (Exception e) {
e.printStackTrace();
return new ResponseEntity<>("Failed to delete the file", HttpStatus.INTERNAL_SERVER_ERROR);
} finally {
session.close();
connection.close();
client.close();
}
Stacktrace when trying to delete file:
2024-07-19T13:42:41.417-04:00 ERROR 32240 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception
com.hierynomus.protocol.transport.TransportException: java.net.SocketException: An established connection was aborted by the software in your host machine
at com.hierynomus.smbj.transport.tcp.direct.DirectTcpTransport.write(DirectTcpTransport.java:86) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.connection.Connection.send(Connection.java:238) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.session.Session.send(Session.java:303) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.session.Session.logoff(Session.java:256) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.session.Session.close(Session.java:279) ~[smbj-0.13.0.jar:0.13.0]
at com.oe.everythingapi.controller.EverythingController.deleteFile(EverythingController.java:106) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:255) ~[spring-web-6.1.8.jar:6.1.8]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:188) ~[spring-web-6.1.8.jar:6.1.8]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118) ~[spring-webmvc-6.1.8.jar:6.1.8]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:926) ~[spring-webmvc-6.1.8.jar:6.1.8]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:831) ~[spring-webmvc-6.1.8.jar:6.1.8]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-6.1.8.jar:6.1.8]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089) ~[spring-webmvc-6.1.8.jar:6.1.8]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979) ~[spring-webmvc-6.1.8.jar:6.1.8]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014) ~[spring-webmvc-6.1.8.jar:6.1.8]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914) ~[spring-webmvc-6.1.8.jar:6.1.8]
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590) ~[tomcat-embed-core-10.1.24.jar:6.0]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) ~[spring-webmvc-6.1.8.jar:6.1.8]
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) ~[tomcat-embed-core-10.1.24.jar:6.0]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:195) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-10.1.24.jar:10.1.24]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-6.1.8.jar:6.1.8]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.1.8.jar:6.1.8]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-6.1.8.jar:6.1.8]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.1.8.jar:6.1.8]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-6.1.8.jar:6.1.8]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.1.8.jar:6.1.8]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:389) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na]
Caused by: java.net.SocketException: An established connection was aborted by the software in your host machine
at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:425) ~[na:na]
at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:445) ~[na:na]
at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:831) ~[na:na]
at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1035) ~[na:na]
at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81) ~[na:na]
at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142) ~[na:na]
at com.hierynomus.smbj.transport.tcp.direct.DirectTcpTransport.write(DirectTcpTransport.java:83) ~[smbj-0.13.0.jar:0.13.0]
... 55 common frames omitted
com.hierynomus.smbj.common.SMBRuntimeException: com.hierynomus.protocol.transport.TransportException: java.util.concurrent.ExecutionException: com.hierynomus.smbj.common.SMBRuntimeException: com.hierynomus.protocol.transport.TransportException: java.io.EOFException: EOF while reading packet
at com.hierynomus.smbj.share.Share.receive(Share.java:394)
at com.hierynomus.smbj.share.Share.receive(Share.java:376)
at com.hierynomus.smbj.share.Share.sendReceive(Share.java:359)
at com.hierynomus.smbj.share.Share.closeFileId(Share.java:171)
at com.hierynomus.smbj.share.Open.close(Open.java:92)
at com.hierynomus.smbj.share.DiskShare.rm(DiskShare.java:432)
at com.oe.everythingapi.controller.EverythingController.deleteFile(EverythingController.java:96)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:255)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:188)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:926)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:831)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:195)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:389)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: com.hierynomus.protocol.transport.TransportException: java.util.concurrent.ExecutionException: com.hierynomus.smbj.common.SMBRuntimeException: com.hierynomus.protocol.transport.TransportException: java.io.EOFException: EOF while reading packet
at com.hierynomus.protocol.transport.TransportException$1.wrap(TransportException.java:30)
at com.hierynomus.protocol.transport.TransportException$1.wrap(TransportException.java:24)
at com.hierynomus.protocol.commons.concurrent.Futures.get(Futures.java:47)
at com.hierynomus.smbj.share.Share.receive(Share.java:389)
... 56 more
Caused by: java.util.concurrent.ExecutionException: com.hierynomus.smbj.common.SMBRuntimeException: com.hierynomus.protocol.transport.TransportException: java.io.EOFException: EOF while reading packet
at com.hierynomus.protocol.commons.concurrent.PromiseBackedFuture.get(PromiseBackedFuture.java:59)
at com.hierynomus.protocol.commons.concurrent.CancellableFuture.get(CancellableFuture.java:84)
at com.hierynomus.protocol.commons.concurrent.Futures.get(Futures.java:42)
... 57 more
Caused by: com.hierynomus.smbj.common.SMBRuntimeException: com.hierynomus.protocol.transport.TransportException: java.io.EOFException: EOF while reading packet
at com.hierynomus.smbj.common.SMBRuntimeException$1.wrap(SMBRuntimeException.java:28)
at com.hierynomus.smbj.common.SMBRuntimeException$1.wrap(SMBRuntimeException.java:22)
at com.hierynomus.protocol.commons.concurrent.Promise.deliverError(Promise.java:95)
at com.hierynomus.smbj.connection.OutstandingRequests.handleError(OutstandingRequests.java:88)
at com.hierynomus.smbj.connection.Connection.handleError(Connection.java:293)
at com.hierynomus.smbj.transport.PacketReader.run(PacketReader.java:59)
... 1 more
Caused by: 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)
... 1 more
Caused by: java.io.EOFException: EOF while reading packet
... 6 more
2024-07-19T13:43:41.424-04:00 ERROR 32240 --- [r nas.lan.local] com.hierynomus.smbj.session.Session : Caught exception while closing TreeConnect with id: 244349310
com.hierynomus.protocol.transport.TransportException: java.util.concurrent.ExecutionException: com.hierynomus.smbj.common.SMBRuntimeException: java.util.concurrent.TimeoutException: Timeout expired
at com.hierynomus.protocol.transport.TransportException$1.wrap(TransportException.java:30) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.protocol.transport.TransportException$1.wrap(TransportException.java:24) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.protocol.commons.concurrent.Futures.get(Futures.java:47) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.share.TreeConnect.close(TreeConnect.java:70) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.share.Share.close(Share.java:116) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.session.Session.logoff(Session.java:236) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.session.Session.close(Session.java:279) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.connection.Connection.close(Connection.java:178) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.connection.Connection.close(Connection.java:155) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.connection.Connection.handleError(Connection.java:295) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.transport.PacketReader.run(PacketReader.java:59) ~[smbj-0.13.0.jar:0.13.0]
at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na]
Caused by: java.util.concurrent.ExecutionException: com.hierynomus.smbj.common.SMBRuntimeException: java.util.concurrent.TimeoutException: Timeout expired
at com.hierynomus.protocol.commons.concurrent.PromiseBackedFuture.get(PromiseBackedFuture.java:59) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.protocol.commons.concurrent.CancellableFuture.get(CancellableFuture.java:84) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.protocol.commons.concurrent.Futures.get(Futures.java:42) ~[smbj-0.13.0.jar:0.13.0]
... 9 common frames omitted
Caused by: com.hierynomus.smbj.common.SMBRuntimeException: java.util.concurrent.TimeoutException: Timeout expired
at com.hierynomus.smbj.common.SMBRuntimeException$1.wrap(SMBRuntimeException.java:28) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.common.SMBRuntimeException$1.wrap(SMBRuntimeException.java:22) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.protocol.commons.concurrent.Promise.retrieve(Promise.java:136) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.protocol.commons.concurrent.PromiseBackedFuture.get(PromiseBackedFuture.java:57) ~[smbj-0.13.0.jar:0.13.0]
... 11 common frames omitted
Caused by: java.util.concurrent.TimeoutException: Timeout expired
... 13 common frames omitted
2024-07-19T13:43:41.425-04:00 WARN 32240 --- [r nas.lan.local] c.hierynomus.smbj.connection.Connection : Exception while closing session 339248438
com.hierynomus.protocol.transport.TransportException: java.net.SocketException: An established connection was aborted by the software in your host machine
at com.hierynomus.smbj.transport.tcp.direct.DirectTcpTransport.write(DirectTcpTransport.java:86) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.connection.Connection.send(Connection.java:238) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.session.Session.send(Session.java:303) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.session.Session.logoff(Session.java:256) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.session.Session.close(Session.java:279) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.connection.Connection.close(Connection.java:178) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.connection.Connection.close(Connection.java:155) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.connection.Connection.handleError(Connection.java:295) ~[smbj-0.13.0.jar:0.13.0]
at com.hierynomus.smbj.transport.PacketReader.run(PacketReader.java:59) ~[smbj-0.13.0.jar:0.13.0]
at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na]
Caused by: java.net.SocketException: An established connection was aborted by the software in your host machine
at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:425) ~[na:na]
at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:445) ~[na:na]
at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:831) ~[na:na]
at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1035) ~[na:na]
at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81) ~[na:na]
at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142) ~[na:na]
at com.hierynomus.smbj.transport.tcp.direct.DirectTcpTransport.write(DirectTcpTransport.java:83) ~[smbj-0.13.0.jar:0.13.0]
... 9 common frames omitted
Stacktrace from Samba crash:
Jul 19 13:42:41 nas smbd[5062]: [2024/07/19 13:42:41.691158, 0] ../../source3/smbd/fd_handle.c:39(fd_handle_destructor)
Jul 19 13:42:41 nas smbd[5062]: PANIC: assert failed at ../../source3/smbd/fd_handle.c(39): (fh->fd == -1) || (fh->fd == AT_FDCWD)
Jul 19 13:42:41 nas smbd[5062]: [2024/07/19 13:42:41.691193, 0] ../../lib/util/fault.c:173(smb_panic_log)
Jul 19 13:42:41 nas smbd[5062]: ===============================================================
Jul 19 13:42:41 nas smbd[5062]: [2024/07/19 13:42:41.691210, 0] ../../lib/util/fault.c:174(smb_panic_log)
Jul 19 13:42:41 nas smbd[5062]: INTERNAL ERROR: assert failed: (fh->fd == -1) || (fh->fd == AT_FDCWD) in pid 5062 (4.17.12)
Jul 19 13:42:41 nas smbd[5062]: [2024/07/19 13:42:41.691225, 0] ../../lib/util/fault.c:178(smb_panic_log)
Jul 19 13:42:41 nas smbd[5062]: If you are running a recent Samba version, and if you think this problem is not yet fixed in the latest versions, please consider reporting this bug, see https://wiki.samba.org/index.php/Bug_Reporting
Jul 19 13:42:41 nas smbd[5062]: [2024/07/19 13:42:41.691239, 0] ../../lib/util/fault.c:183(smb_panic_log)
Jul 19 13:42:41 nas smbd[5062]: ===============================================================
Jul 19 13:42:41 nas smbd[5062]: [2024/07/19 13:42:41.691252, 0] ../../lib/util/fault.c:184(smb_panic_log)
Jul 19 13:42:41 nas smbd[5062]: PANIC (pid 5062): assert failed: (fh->fd == -1) || (fh->fd == AT_FDCWD) in 4.17.12
Jul 19 13:42:41 nas smbd[5062]: [2024/07/19 13:42:41.691534, 0] ../../lib/util/fault.c:292(log_stack_trace)
Jul 19 13:42:41 nas smbd[5062]: BACKTRACE: 27 stack frames:
Jul 19 13:42:41 nas smbd[5062]: #0 /usr/lib64/libgenrand-samba4.so(log_stack_trace+0x2e) [0x154b376df64e]
Jul 19 13:42:41 nas smbd[5062]: #1 /usr/lib64/libgenrand-samba4.so(smb_panic+0x9) [0x154b376df8a9]
Jul 19 13:42:41 nas smbd[5062]: #2 /usr/lib64/libsmbd-base-samba4.so(+0x4d0fb) [0x154b37ac10fb]
Jul 19 13:42:41 nas smbd[5062]: #3 /usr/lib64/libtalloc.so.2(+0x44df) [0x154b3768e4df]
Jul 19 13:42:41 nas smbd[5062]: #4 /usr/lib64/libsmbd-base-samba4.so(file_free+0xd6) [0x154b37ace266]
Jul 19 13:42:41 nas smbd[5062]: #5 /usr/lib64/libsmbd-base-samba4.so(+0xc0781) [0x154b37b34781]
Jul 19 13:42:41 nas smbd[5062]: #6 /usr/lib64/libsmbd-base-samba4.so(smbd_smb2_request_process_close+0x211) [0x154b37b34f01]
Jul 19 13:42:41 nas smbd[5062]: #7 /usr/lib64/libsmbd-base-samba4.so(smbd_smb2_request_dispatch+0xdfa) [0x154b37b28bfa]
Jul 19 13:42:41 nas smbd[5062]: #8 /usr/lib64/libsmbd-base-samba4.so(+0xb5bc1) [0x154b37b29bc1]
Jul 19 13:42:41 nas smbd[5062]: #9 /usr/lib64/libtevent.so.0(tevent_common_invoke_fd_handler+0x91) [0x154b376a18c1]
Jul 19 13:42:41 nas smbd[5062]: #10 /usr/lib64/libtevent.so.0(+0xee07) [0x154b376a7e07]
Jul 19 13:42:41 nas smbd[5062]: #11 /usr/lib64/libtevent.so.0(+0xcef7) [0x154b376a5ef7]
Jul 19 13:42:41 nas smbd[5062]: #12 /usr/lib64/libtevent.so.0(_tevent_loop_once+0x91) [0x154b376a0ba1]
Jul 19 13:42:41 nas smbd[5062]: #13 /usr/lib64/libtevent.so.0(tevent_common_loop_wait+0x1b) [0x154b376a0e7b]
Jul 19 13:42:41 nas smbd[5062]: #14 /usr/lib64/libtevent.so.0(+0xce97) [0x154b376a5e97]
Jul 19 13:42:41 nas smbd[5062]: #15 /usr/lib64/libsmbd-base-samba4.so(smbd_process+0x817) [0x154b37b17be7]
Jul 19 13:42:41 nas smbd[5062]: #16 /usr/sbin/smbd(+0xb090) [0x561688f68090]
Jul 19 13:42:41 nas smbd[5062]: #17 /usr/lib64/libtevent.so.0(tevent_common_invoke_fd_handler+0x91) [0x154b376a18c1]
Jul 19 13:42:41 nas smbd[5062]: #18 /usr/lib64/libtevent.so.0(+0xee07) [0x154b376a7e07]
Jul 19 13:42:41 nas smbd[5062]: #19 /usr/lib64/libtevent.so.0(+0xcef7) [0x154b376a5ef7]
Jul 19 13:42:41 nas smbd[5062]: #20 /usr/lib64/libtevent.so.0(_tevent_loop_once+0x91) [0x154b376a0ba1]
Jul 19 13:42:41 nas smbd[5062]: #21 /usr/lib64/libtevent.so.0(tevent_common_loop_wait+0x1b) [0x154b376a0e7b]
Jul 19 13:42:41 nas smbd[5062]: #22 /usr/lib64/libtevent.so.0(+0xce97) [0x154b376a5e97]
Jul 19 13:42:41 nas smbd[5062]: #23 /usr/sbin/smbd(main+0x1489) [0x561688f65259]
Jul 19 13:42:41 nas smbd[5062]: #24 /lib64/libc.so.6(+0x236b7) [0x154b374a96b7]
Jul 19 13:42:41 nas smbd[5062]: #25 /lib64/libc.so.6(__libc_start_main+0x85) [0x154b374a9775]
Jul 19 13:42:41 nas smbd[5062]: #26 /usr/sbin/smbd(_start+0x21) [0x561688f65b31]
Jul 19 13:42:41 nas smbd[5062]: [2024/07/19 13:42:41.691824, 0] ../../source3/lib/dumpcore.c:315(dump_core)
Jul 19 13:42:41 nas smbd[5062]: dumping core in /var/log/samba/cores/smbd
Jul 19 13:42:41 nas smbd[5062]:
The text was updated successfully, but these errors were encountered:
This is a very weird error that I can't trace down. When I try to delete a file, it deletes but throws an exception and even crashes Samba itself . I'm almost certain this has something to do with session.close() but I don't know what's going on. If I run this code against a test windows share it works, so some kind of Samba incompatibility?
Code followed by java stacktrace and Samba stacktrace
Stacktrace when trying to delete file:
Stacktrace from Samba crash:
The text was updated successfully, but these errors were encountered: