xebialabs / overthere

Runs something "Over there"

Home Page:http://www.xebialabs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unknown connection protocol ssh

j-michaels opened this issue · comments

Hello!

I'm getting the error "Unknown connection protocol ssh" when trying to connect with Overthere version 5.0.2. It looks like this same issue has been raised before in 2016, and was due to a problem with the Scannit library, but that was resolved with Scannit 1.4.1.

I'm only getting this error when the code is deployed to my company's Docker container platform. It runs fine on my local. Does Overthere require some specific environment setup? I've read through the documentation but I'm not seeing anything that could have caused this.

Hi @Teshel, Which JVM is running in the docker environment? Is it different from you local installation?

Hi @hierynomus!

My local environment:
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

The Docker container is from Alpine:
openjdk version "1.8.0_92-internal"
OpenJDK Runtime Environment (build 1.8.0_92-internal-alpine-r1-b14)
OpenJDK 64-Bit Server VM (build 25.92-b14, mixed mode)

I changed the Docker container to use Oracle's Java instead, since that's what's on my local. However, I'm still getting the same error "Unknown connection protocol ssh".

Docker container Java version now:
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

I've narrowed it down a little further. This is a Spring Boot app, and I've been running it on my local by using mvn spring-boot:run. The error only comes when Spring's fat jar is started with java -jar my-app.jar. I'm able to reproduce this in my local by using the latter.

Has anyone gotten Overthere to work with Spring Boot?

I've not looked at how spring-boot builds a single jar.
What I think makes sense is to add some extra methods that allow you to programmatically register connectionbuilders. That would circumvent the entire problem. Then you could dynamically wire it in Spring itself.

I've fixed this with 4fa6795. You can now create an OverthereConnector instead of using the Overthere static class. On the OverthereConnector you can programmatically register/enable the exact protocols you wish to support.

I have also encountered this problem - no spring-boot involved. Just using the supplied example ExecuteOnUnix class compiled in Eclipse. Exported as an executable jar from Eclipse and when run the example produces this error.

Can you detail how to use the OverthereConnector to replace this line from the example:

OverthereConnection connection = Overthere.getConnection("ssh", options);

@cabintech
OverthereConnector connectionBuilder = new OverthereConnector();
connectionBuilder.registerProtocol(com.xebialabs.overthere.ssh.SshConnectionBuilder.class);
OverthereConnection connection = connectionBuilder.getConnection("ssh", options);