Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to get operation result within specified timeout: xxx msec #649

Open
xiaoming19871124 opened this issue Dec 25, 2024 · 1 comment

Comments

@xiaoming19871124
Copy link

Version

2.14.0

Bug description

Hello everybody, when I use by version 2.14 to connect a terminal, I always got an error like this:
"Failed to get operation result within specified timeout: 30000 msec"

But however I set longer timout number, I still got such timeout error after time what I set;
I had tried to run sshd from other system with no Linx System, it works correctly;

The actual scene such as below:
Linx:~/ssh_test/sshd# cat /etc/os-release
PRETTY_NAME="Linx GNU/Linux 6.0.100 (buster)"
NAME="Linx GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=Linx
HOME_URL="http://www.linx-info.com/"

Linx:~/ssh_test/sshd# java --version
java 17.0.4 2022-07-19 LTS
Java(TM) SE Runtime Environment (build 17.0.4+11-LTS-179)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.4+11-LTS-179, mixed mode, sharing)

Actual behavior

09:56:11.534 [main] INFO com.hg.common.utils.SshdUtil - ############### Connect to host(sshd): 192.168.70.81:22 by user: root...
09:56:11.543 [main] INFO com.hg.common.utils.SshdUtil - ############### Execute Command(sshd): ls -la
09:56:11.932 [main] DEBUG org.apache.sshd.common.util.security.SecurityUtils - register(BC) not registered - enabled=true, supported=false
09:56:11.946 [main] DEBUG org.apache.sshd.common.util.security.SecurityUtils - register(EdDSA) not registered - enabled=true, supported=false
09:56:12.277 [main] INFO org.apache.sshd.common.io.DefaultIoServiceFactoryFactory - No detected/configured IoServiceFactoryFactory; using Nio2ServiceFactoryFactory
09:56:12.321 [main] INFO org.apache.sshd.client.config.hosts.DefaultConfigFileHostEntryResolver - resolveEffectiveResolver([email protected]:22/null) no configuration file at /root/.ssh/config
09:56:12.322 [main] DEBUG org.apache.sshd.client.config.hosts.DefaultConfigFileHostEntryResolver - resolveEffectiveHost([email protected]:22/null) => null
09:56:12.323 [main] DEBUG org.apache.sshd.client.SshClient - connect([email protected]:22) no overrides
09:56:12.348 [main] DEBUG org.apache.sshd.common.io.nio2.Nio2Connector - Connecting to /192.168.70.81:22
09:56:12.355 [main] DEBUG org.apache.sshd.common.io.nio2.Nio2Connector - setOption(SO_REUSEADDR)[true] from property=Property[socket-reuseaddr](Boolean]
09:56:12.374 [sshd-SshClient[55a561cf]-nio2-resume-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Connector - connect(/192.168.70.81:22): waiting for connection (timeout=60000ms)
09:56:12.380 [sshd-SshClient[55a561cf]-nio2-resume-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - Creating IoSession on /192.168.70.81:33058 from /192.168.70.81:22 via null
09:56:42.422 [main] INFO com.hg.common.utils.SshdUtil - Login Host: 192.168.70.81 Error
org.apache.sshd.common.SshException: DefaultConnectFuture[root@/192.168.70.81:22]: Failed to get operation result within specified timeout: 30000 msec
at org.apache.sshd.common.future.AbstractSshFuture.lambda$verifyResult$1(AbstractSshFuture.java:114)
at org.apache.sshd.common.future.AbstractSshFuture.formatExceptionMessage(AbstractSshFuture.java:206)
at org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:114)
at org.apache.sshd.client.future.DefaultConnectFuture.verify(DefaultConnectFuture.java:55)
at org.apache.sshd.client.future.DefaultConnectFuture.verify(DefaultConnectFuture.java:36)
at org.apache.sshd.common.future.VerifiableFuture.verify(VerifiableFuture.java:84)
at org.apache.sshd.common.future.VerifiableFuture.verify(VerifiableFuture.java:69)
at com.hg.common.utils.SshdUtil.initialSession(SshdUtil.java:75)
at com.hg.common.utils.SshdUtil.runString(SshdUtil.java:503)
at com.hg.common.utils.SshdUtil.connectBySshd(SshdUtil.java:608)
at com.hg.common.utils.SshdUtil.main(SshdUtil.java:589)
Caused by: java.util.concurrent.TimeoutException: Timed out after 30000 msec
at org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:113)
... 8 common frames omitted
09:56:42.427 [main] ERROR com.hg.common.utils.SshdUtil - Host:192.168.70.81 User:root Login Error
09:56:42.428 [main] INFO com.hg.common.utils.SshdUtil - ############### Execute Result(sshd):

Expected behavior

I wish I can set one or more params that let it works normally;
However thinks for everybody's help and suggestion;

Relevant log output

No response

Other information

No response

@tomaswolf
Copy link
Member

Most probably this is a duplicate of #642 and is caused by entropy starvation. Possible work-arounds:

  • Stay on 2.13.x and wait for the next release of Apache MINA sshd.
  • Or use the 2.14.1-SNAPSHOT artifacts from the Apache Snapshots maven repository.
  • Or according to Stackoverflow run with a system property set: -Djava.security.egd=file:/dev/./urandom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants