[ https://issues.apache.org/jira/browse/KARAF-7607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Varga updated KARAF-7607: -------------------------------- Description: This issue was encountered in OpenDaylight, in our very leaf project's integration tests. The issue is tracked [here|https://jira.opendaylight.org/browse/TRNSPRTPCE-701]. It manifests as: {noformat} 1375 [main] DEBUG org.apache.sshd.client.SshClient - close(SshClient[d6da883])[Immediately] closed org.apache.sshd.common.SshException: DefaultOpenFuture[ChannelShell[id=0, recipient=-1]-ClientSessionImpl[karaf@localhost/127.0.0.1:8101]]: Failed (IllegalArgumentException) to execute: Invalid UINT32 value: -1 at org.apache.sshd.common.future.AbstractSshFuture.lambda$verifyResult$1(AbstractSshFuture.java:132) at org.apache.sshd.common.future.AbstractSshFuture.formatExceptionMessage(AbstractSshFuture.java:190) at org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:131) at org.apache.sshd.client.future.DefaultOpenFuture.verify(DefaultOpenFuture.java:39) at org.apache.sshd.client.future.DefaultOpenFuture.verify(DefaultOpenFuture.java:32) at org.apache.sshd.common.future.VerifiableFuture.verify(VerifiableFuture.java:43) at org.apache.karaf.client.Main.main(Main.java:281) Caused by: java.lang.IllegalArgumentException: Invalid UINT32 value: -1 at org.apache.sshd.common.util.ValidateUtils.createFormattedException(ValidateUtils.java:213) at org.apache.sshd.common.util.ValidateUtils.throwIllegalArgumentException(ValidateUtils.java:179) at org.apache.sshd.common.util.ValidateUtils.checkTrue(ValidateUtils.java:162) at org.apache.sshd.common.util.buffer.BufferUtils.validateUint32Value(BufferUtils.java:703) at org.apache.sshd.common.util.buffer.Buffer.putUInt(Buffer.java:726) at org.apache.sshd.client.channel.PtyCapableChannelSession.lambda$doOpenPty$0(PtyCapableChannelSession.java:265) at java.base/java.util.HashMap.forEach(HashMap.java:1337) at org.apache.sshd.client.channel.PtyCapableChannelSession.doOpenPty(PtyCapableChannelSession.java:263) at org.apache.sshd.client.channel.ChannelShell.doOpen(ChannelShell.java:45) at org.apache.sshd.client.channel.AbstractClientChannel.handleOpenSuccess(AbstractClientChannel.java:366) at org.apache.sshd.common.session.helpers.AbstractConnectionService.channelOpenConfirmation(AbstractConnectionService.java:545) at org.apache.sshd.common.session.helpers.AbstractConnectionService.process(AbstractConnectionService.java:456) at org.apache.sshd.common.session.helpers.CurrentService.process(CurrentService.java:109) at org.apache.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:594) at org.apache.sshd.common.session.helpers.AbstractSession.lambda$handleMessage$0(AbstractSession.java:525) at org.apache.sshd.common.util.threads.ThreadUtils.runAsInternal(ThreadUtils.java:66) at org.apache.sshd.common.session.helpers.AbstractSession.handleMessage(AbstractSession.java:524) at org.apache.sshd.common.session.helpers.AbstractSession.decode(AbstractSession.java:1644) at org.apache.sshd.common.session.helpers.AbstractSession.messageReceived(AbstractSession.java:485) at org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:64) at org.apache.sshd.common.io.nio2.Nio2Session.handleReadCycleCompletion(Nio2Session.java:371) at org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:344) at org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:339) at org.apache.sshd.common.io.nio2.Nio2CompletionHandler.lambda$completed$0(Nio2CompletionHandler.java:38) at java.base/java.security.AccessController.doPrivileged(Native Method) at org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:37) at java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:127) at java.base/sun.nio.ch.Invoker$2.run(Invoker.java:219) at java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) {noformat} The problem is that Karaf's client is setting up terminal properties from JLine, but does not pay attention to JLine return values: Attributes.getControlChar() will return -1 when the ControlChar is not available, but Karaf [does not pay attention to that|https://github.com/apache/karaf/blob/main/client/src/main/java/org/apache/karaf/client/Main.java#L223], pushing -1 down to [SSHD config|https://github.com/apache/karaf/blob/main/client/src/main/java/org/apache/karaf/client/Main.java#L267]. With [SSHD-1244|https://issues.apache.org/jira/browse/SSHD-1244], such control characters will get rejected because of the UInt check being introduced in the corresponding patch. This renders bin/client inoperable in automated environments, which probably have terminals with fewer-than-expected PTY features available. As such, this is a regression in functionality when compared to 4.4.1 or 4.3.7, but is not caused by a code change, but rather SSHD flushing out pre-existing badness. was: This issue was encountered in OpenDaylight, in our very leaf project's integration tests. The issue is tracked [here|https://jira.opendaylight.org/browse/TRNSPRTPCE-701]. It manifests as: {noformat} 1375 [main] DEBUG org.apache.sshd.client.SshClient - close(SshClient[d6da883])[Immediately] closed org.apache.sshd.common.SshException: DefaultOpenFuture[ChannelShell[id=0, recipient=-1]-ClientSessionImpl[karaf@localhost/127.0.0.1:8101]]: Failed (IllegalArgumentException) to execute: Invalid UINT32 value: -1 at org.apache.sshd.common.future.AbstractSshFuture.lambda$verifyResult$1(AbstractSshFuture.java:132) at org.apache.sshd.common.future.AbstractSshFuture.formatExceptionMessage(AbstractSshFuture.java:190) at org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:131) at org.apache.sshd.client.future.DefaultOpenFuture.verify(DefaultOpenFuture.java:39) at org.apache.sshd.client.future.DefaultOpenFuture.verify(DefaultOpenFuture.java:32) at org.apache.sshd.common.future.VerifiableFuture.verify(VerifiableFuture.java:43) at org.apache.karaf.client.Main.main(Main.java:281) Caused by: java.lang.IllegalArgumentException: Invalid UINT32 value: -1 at org.apache.sshd.common.util.ValidateUtils.createFormattedException(ValidateUtils.java:213) at org.apache.sshd.common.util.ValidateUtils.throwIllegalArgumentException(ValidateUtils.java:179) at org.apache.sshd.common.util.ValidateUtils.checkTrue(ValidateUtils.java:162) at org.apache.sshd.common.util.buffer.BufferUtils.validateUint32Value(BufferUtils.java:703) at org.apache.sshd.common.util.buffer.Buffer.putUInt(Buffer.java:726) at org.apache.sshd.client.channel.PtyCapableChannelSession.lambda$doOpenPty$0(PtyCapableChannelSession.java:265) at java.base/java.util.HashMap.forEach(HashMap.java:1337) at org.apache.sshd.client.channel.PtyCapableChannelSession.doOpenPty(PtyCapableChannelSession.java:263) at org.apache.sshd.client.channel.ChannelShell.doOpen(ChannelShell.java:45) at org.apache.sshd.client.channel.AbstractClientChannel.handleOpenSuccess(AbstractClientChannel.java:366) at org.apache.sshd.common.session.helpers.AbstractConnectionService.channelOpenConfirmation(AbstractConnectionService.java:545) at org.apache.sshd.common.session.helpers.AbstractConnectionService.process(AbstractConnectionService.java:456) at org.apache.sshd.common.session.helpers.CurrentService.process(CurrentService.java:109) at org.apache.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:594) at org.apache.sshd.common.session.helpers.AbstractSession.lambda$handleMessage$0(AbstractSession.java:525) at org.apache.sshd.common.util.threads.ThreadUtils.runAsInternal(ThreadUtils.java:66) at org.apache.sshd.common.session.helpers.AbstractSession.handleMessage(AbstractSession.java:524) at org.apache.sshd.common.session.helpers.AbstractSession.decode(AbstractSession.java:1644) at org.apache.sshd.common.session.helpers.AbstractSession.messageReceived(AbstractSession.java:485) at org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:64) at org.apache.sshd.common.io.nio2.Nio2Session.handleReadCycleCompletion(Nio2Session.java:371) at org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:344) at org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:339) at org.apache.sshd.common.io.nio2.Nio2CompletionHandler.lambda$completed$0(Nio2CompletionHandler.java:38) at java.base/java.security.AccessController.doPrivileged(Native Method) at org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:37) at java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:127) at java.base/sun.nio.ch.Invoker$2.run(Invoker.java:219) at java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) {noformat} The problem is that Karaf's client is setting up terminal properties from JLine, but does not pay attention to JLine return values: Attributes.getControlChar() will return -1 when the ControlChar is not available, but Karaf [does not pay attention to that|https://github.com/apache/karaf/blob/main/client/src/main/java/org/apache/karaf/client/Main.java#L223], pushing -1 down to [SSHD config|https://github.com/apache/karaf/blob/main/client/src/main/java/org/apache/karaf/client/Main.java#L267]. With [SSHD-1244|https://issues.apache.org/jira/browse/SSHD-1244], such control characters will get rejected because of the UInt check being introduced in the corresponding patch. > bin/client fails with SSHD IllegalArgumentException > --------------------------------------------------- > > Key: KARAF-7607 > URL: https://issues.apache.org/jira/browse/KARAF-7607 > Project: Karaf > Issue Type: Bug > Components: karaf > Affects Versions: 4.3.8, 4.4.2 > Reporter: Robert Varga > Priority: Critical > > This issue was encountered in OpenDaylight, in our very leaf project's > integration tests. The issue is tracked > [here|https://jira.opendaylight.org/browse/TRNSPRTPCE-701]. > It manifests as: > {noformat} > 1375 [main] DEBUG org.apache.sshd.client.SshClient - > close(SshClient[d6da883])[Immediately] closed > org.apache.sshd.common.SshException: DefaultOpenFuture[ChannelShell[id=0, > recipient=-1]-ClientSessionImpl[karaf@localhost/127.0.0.1:8101]]: Failed > (IllegalArgumentException) to execute: Invalid UINT32 value: -1 > at > org.apache.sshd.common.future.AbstractSshFuture.lambda$verifyResult$1(AbstractSshFuture.java:132) > at > org.apache.sshd.common.future.AbstractSshFuture.formatExceptionMessage(AbstractSshFuture.java:190) > at > org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:131) > at > org.apache.sshd.client.future.DefaultOpenFuture.verify(DefaultOpenFuture.java:39) > at > org.apache.sshd.client.future.DefaultOpenFuture.verify(DefaultOpenFuture.java:32) > at > org.apache.sshd.common.future.VerifiableFuture.verify(VerifiableFuture.java:43) > at org.apache.karaf.client.Main.main(Main.java:281) > Caused by: java.lang.IllegalArgumentException: Invalid UINT32 value: -1 > at > org.apache.sshd.common.util.ValidateUtils.createFormattedException(ValidateUtils.java:213) > at > org.apache.sshd.common.util.ValidateUtils.throwIllegalArgumentException(ValidateUtils.java:179) > at > org.apache.sshd.common.util.ValidateUtils.checkTrue(ValidateUtils.java:162) > at > org.apache.sshd.common.util.buffer.BufferUtils.validateUint32Value(BufferUtils.java:703) > at org.apache.sshd.common.util.buffer.Buffer.putUInt(Buffer.java:726) > at > org.apache.sshd.client.channel.PtyCapableChannelSession.lambda$doOpenPty$0(PtyCapableChannelSession.java:265) > at java.base/java.util.HashMap.forEach(HashMap.java:1337) > at > org.apache.sshd.client.channel.PtyCapableChannelSession.doOpenPty(PtyCapableChannelSession.java:263) > at > org.apache.sshd.client.channel.ChannelShell.doOpen(ChannelShell.java:45) > at > org.apache.sshd.client.channel.AbstractClientChannel.handleOpenSuccess(AbstractClientChannel.java:366) > at > org.apache.sshd.common.session.helpers.AbstractConnectionService.channelOpenConfirmation(AbstractConnectionService.java:545) > at > org.apache.sshd.common.session.helpers.AbstractConnectionService.process(AbstractConnectionService.java:456) > at > org.apache.sshd.common.session.helpers.CurrentService.process(CurrentService.java:109) > at > org.apache.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:594) > at > org.apache.sshd.common.session.helpers.AbstractSession.lambda$handleMessage$0(AbstractSession.java:525) > at > org.apache.sshd.common.util.threads.ThreadUtils.runAsInternal(ThreadUtils.java:66) > at > org.apache.sshd.common.session.helpers.AbstractSession.handleMessage(AbstractSession.java:524) > at > org.apache.sshd.common.session.helpers.AbstractSession.decode(AbstractSession.java:1644) > at > org.apache.sshd.common.session.helpers.AbstractSession.messageReceived(AbstractSession.java:485) > at > org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:64) > at > org.apache.sshd.common.io.nio2.Nio2Session.handleReadCycleCompletion(Nio2Session.java:371) > at > org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:344) > at > org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:339) > at > org.apache.sshd.common.io.nio2.Nio2CompletionHandler.lambda$completed$0(Nio2CompletionHandler.java:38) > at java.base/java.security.AccessController.doPrivileged(Native Method) > at > org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:37) > at java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:127) > at java.base/sun.nio.ch.Invoker$2.run(Invoker.java:219) > at > java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112) > at > java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) > at > java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) > at java.base/java.lang.Thread.run(Thread.java:829) > {noformat} > The problem is that Karaf's client is setting up terminal properties from > JLine, but does not pay attention to JLine return values: > Attributes.getControlChar() will return -1 when the ControlChar is not > available, but Karaf [does not pay attention to > that|https://github.com/apache/karaf/blob/main/client/src/main/java/org/apache/karaf/client/Main.java#L223], > pushing -1 down to [SSHD > config|https://github.com/apache/karaf/blob/main/client/src/main/java/org/apache/karaf/client/Main.java#L267]. > With [SSHD-1244|https://issues.apache.org/jira/browse/SSHD-1244], such > control characters will get rejected because of the UInt check being > introduced in the corresponding patch. > This renders bin/client inoperable in automated environments, which probably > have terminals with fewer-than-expected PTY features available. > As such, this is a regression in functionality when compared to 4.4.1 or > 4.3.7, but is not caused by a code change, but rather SSHD flushing out > pre-existing badness. -- This message was sent by Atlassian Jira (v8.20.10#820010)