You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by GitBox <gi...@apache.org> on 2023/01/17 10:21:27 UTC

[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-unsubscribe@mina.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


[GitHub] [mina-sshd] tomaswolf commented on issue #312: Connect to server failed when get session:error: 在一个非套接字上尝试了一个操作

Posted by GitBox <gi...@apache.org>.
tomaswolf commented on issue #312:
URL: https://github.com/apache/mina-sshd/issues/312#issuecomment-1387539730

   You could also try using a later Java version. Try Java 11 or 17, or maybe even 19. 


-- 
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-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] Connect to server failed when get session:error: 在一个非套接字上尝试了一个操作 [mina-sshd]

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf closed issue #312: Connect to server failed when get session:error: 在一个非套接字上尝试了一个操作
URL: https://github.com/apache/mina-sshd/issues/312


-- 
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-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


[GitHub] [mina-sshd] tomaswolf commented on issue #312: Connect to server failed when get session:error: 在一个非套接字上尝试了一个操作

Posted by GitBox <gi...@apache.org>.
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-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


[GitHub] [mina-sshd] MiniTaT commented on issue #312: Connect to server failed when get session:error: 在一个非套接字上尝试了一个操作

Posted by GitBox <gi...@apache.org>.
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-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


[GitHub] [mina-sshd] MiniTaT commented on issue #312: Connect to server failed when get session:error: 在一个非套接字上尝试了一个操作

Posted by GitBox <gi...@apache.org>.
MiniTaT commented on issue #312:
URL: https://github.com/apache/mina-sshd/issues/312#issuecomment-1396385975

   > 
   We can't go to the customer site to check, so we'll contact the customer to try "netsh winsock reset"。
   
   


-- 
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-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org