[GitHub] [mina-sshd] tomaswolf commented on issue #312: Connect to server failed when get session:error: 在一个非套接字上尝试了一个操作
tomaswolf commented on issue #312: URL: https://github.com/apache/mina-sshd/issues/312#issuecomment-1385419758 The error message appears to indicate that this is Windows error 10038 ("An operation was attempted on something that is not a socket."). Searching the Internet for "OS 10038" or related things (like the Chinese error message text!) gets quite a few hits. Some include the Apache HTTP server; compare the [mod_winnt configuration of Apache httpd 2.2](https://httpd.apache.org/docs/2.2/mod/mpm_winnt.html#win32disableacceptex). (In newer releases, that config was removed; compare the [httpd 2.4 documentation](https://httpd.apache.org/docs/current/mod/mpm_winnt.html): it appears the problem is still there, but httpd falls back to another API if there are too many failures.) The cause appears to be unclear. Most hits report this occurring suddenly from time to time in otherwise working applications. It's being mentioned for many different applications. Some mention it was some corruption in the Windows TCP/IP stack, and some people claim running "netsh winsock reset" would resolve this problem. It is possible that the AsynchronousSocketChannel used by the Apache MINA sshd NIO2 transport back-end exercises some Windows code that triggers a bug in Windows. The Java native code does use the Windows ConnectEx function... maybe that can have the same problem as AcceptEx mentioned on other sites. JSch definitely doesn't use AsynchronousSocketChannel. You could try using the sshd-mina or sshd-netty transport back-ends with Apache MINA sshd; those also do not use AsynchronousSocketChannel. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org
[GitHub] [mina-sshd] MiniTaT commented on issue #312: Connect to server failed when get session:error: 在一个非套接字上尝试了一个操作
MiniTaT commented on issue #312: URL: https://github.com/apache/mina-sshd/issues/312#issuecomment-1385163955 ![image](https://user-images.githubusercontent.com/122873415/212870558-88eb5c4a-671d-47c2-945d-7f4e3ceb74aa.png) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org
[GitHub] [mina-sshd] MiniTaT opened a new issue, #312: Connect to server failed when get session:error: 在一个非套接字上尝试了一个操作
MiniTaT opened a new issue, #312: URL: https://github.com/apache/mina-sshd/issues/312 ### Version 2.9.2 ### Bug description Recently, we switched from jsch to mina ssh. In some of our customers' environments, we encountered the following error when connecting to the customer's machine through SSH. When we roll back to the version using jsch, we can connect the environment properly. Operating system: windows server 2016 target environment ip: IPv6 ### Actual behavior connection build failed. ### Expected behavior Connect the device properly. ### Relevant log output ```Shell ![image](https://user-images.githubusercontent.com/122873415/212870558-88eb5c4a-671d-47c2-945d-7f4e3ceb74aa.png) Caused by: java.io.IOException: 在一个非套接字上尝试了一个操作。 at sun.nio.ch.WindowsAsynchronousSocketChannelImpl.connect0(Native Method) ~[?:1.8.0_332] at sun.nio.ch.WindowsAsynchronousSocketChannelImpl.access$200(WindowsAsynchronousSocketChannelImpl.java:43) ~[?:1.8.0_332] at sun.nio.ch.WindowsAsynchronousSocketChannelImpl$ConnectTask.run(WindowsAsynchronousSocketChannelImpl.java:235) ~[?:1.8.0_332] at sun.nio.ch.WindowsAsynchronousSocketChannelImpl.implConnect(WindowsAsynchronousSocketChannelImpl.java:382) ~[?:1.8.0_332] at sun.nio.ch.AsynchronousSocketChannelImpl.connect(AsynchronousSocketChannelImpl.java:210) ~[?:1.8.0_332] at org.apache.sshd.common.io.nio2.Nio2Connector.connect(Nio2Connector.java:72) ~[sshd-core-2.9.2.jar:2.9.2] at org.apache.sshd.client.SshClient.doConnect(SshClient.java:632) ~[sshd-core-2.9.2.jar:2.9.2] at org.apache.sshd.client.SshClient.doConnect(SshClient.java:615) ~[sshd-core-2.9.2.jar:2.9.2] at org.apache.sshd.client.SshClient.connect(SshClient.java:546) ~[sshd-core-2.9.2.jar:2.9.2] at org.apache.sshd.client.SshClient.connect(SshClient.java:538) ~[sshd-core-2.9.2.jar:2.9.2] at org.apache.sshd.client.session.ClientSessionCreator.connect(ClientSessionCreator.java:74) ~[sshd-core-2.9.2.jar:2.9.2] at org.apache.sshd.client.session.ClientSessionCreator.connect(ClientSessionCreator.java:57) ~[sshd-core-2.9.2.jar:2.9.2] ``` ### Other information our code : ![image](https://user-images.githubusercontent.com/122873415/212872822-53a6975e-cd1b-4255-9e1e-617a97ad2f98.png) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org
[GitHub] [mina-sshd] garyiscoding commented on issue #310: What will cause the failure to open the channel
garyiscoding commented on issue #310: URL: https://github.com/apache/mina-sshd/issues/310#issuecomment-1385029023 long openChannelTimeout = 500L; try (ChannelExec channel = session.createExecChannel(command); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ByteArrayOutputStream errorStream = new ByteArrayOutputStream()) { channel.setOut(outputStream); channel.setErr(errorStream); channel.open().verify(openChannelTimeout); channel.waitFor(EnumSet.of(CLOSED), execTimeout); Integer exitCode = channel.getExitStatus(); String outputStr = StringUtils.chomp(outputStream.toString()); String errorStr = StringUtils.chomp(errorStream.toString()); } -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org
[GitHub] [mina-sshd] garyiscoding commented on issue #310: What will cause the failure to open the channel
garyiscoding commented on issue #310: URL: https://github.com/apache/mina-sshd/issues/310#issuecomment-1385028394 `long openChannelTimeout = 500L; try (ChannelExec channel = session.createExecChannel(command); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ByteArrayOutputStream errorStream = new ByteArrayOutputStream()) { channel.setOut(outputStream); channel.setErr(errorStream); channel.open().verify(openChannelTimeout); channel.waitFor(EnumSet.of(CLOSED), execTimeout); Integer exitCode = channel.getExitStatus(); String outputStr = StringUtils.chomp(outputStream.toString()); String errorStr = StringUtils.chomp(errorStream.toString()); }` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org
[GitHub] [mina-sshd] garyiscoding commented on issue #310: What will cause the failure to open the channel
garyiscoding commented on issue #310: URL: https://github.com/apache/mina-sshd/issues/310#issuecomment-1385028733 `long openChannelTimeout = 500L; try (ChannelExec channel = session.createExecChannel(command); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ByteArrayOutputStream errorStream = new ByteArrayOutputStream()) { channel.setOut(outputStream); channel.setErr(errorStream); channel.open().verify(openChannelTimeout); channel.waitFor(EnumSet.of(CLOSED), execTimeout); Integer exitCode = channel.getExitStatus(); String outputStr = StringUtils.chomp(outputStream.toString()); String errorStr = StringUtils.chomp(errorStream.toString()); }` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org
[GitHub] [mina-sshd] garyiscoding commented on issue #310: What will cause the failure to open the channel
garyiscoding commented on issue #310: URL: https://github.com/apache/mina-sshd/issues/310#issuecomment-1385023724 When the service is first deployed, there is no error. After running for a while, this error occurs ![image](https://user-images.githubusercontent.com/121858742/212841990-ea8ef337-0412-40a2-8207-9786481972bb.png) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org