SSH with Jenkins CLI - java

When I ssh (I am using Windows 10 with OpenSSH) into jenkins-cli.jar I get the following error:
Jan 05, 2023 12:48:06 PM io.jenkins.cli.shaded.org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar getOrCreateProvider
INFO: getOrCreateProvider(EdDSA) created instance of io.jenkins.cli.shaded.net.i2p.crypto.eddsa.EdDSASecurityProvider
Jan 05, 2023 12:48:07 PM io.jenkins.cli.shaded.org.apache.sshd.common.io.DefaultIoServiceFactoryFactory getIoServiceProvider
INFO: No detected/configured IoServiceFactoryFactory; using Nio2ServiceFactoryFactory
io.jenkins.cli.shaded.org.apache.sshd.common.RuntimeSshException: Failed to get the session.
at io.jenkins.cli.shaded.org.apache.sshd.client.future.DefaultConnectFuture.getSession(DefaultConnectFuture.java:59)
at io.jenkins.cli.shaded.org.apache.sshd.client.future.DefaultConnectFuture.getSession(DefaultConnectFuture.java:34)
at hudson.cli.SSHCLI.sshConnection(SSHCLI.java:102)
at hudson.cli.CLI._main(CLI.java:294)
at hudson.cli.CLI.main(CLI.java:103)
Caused by: java.io.IOException: The semaphore timeout period has expired
at java.base/sun.nio.ch.Iocp.translateErrorToIOException(Iocp.java:299)
at java.base/sun.nio.ch.Iocp$EventHandlerTask.run(Iocp.java:389)
at java.base/java.lang.Thread.run(Thread.java:1589)
After trying:
java -jar jenkins-cli.jar -s SERVER:8080/ -ssh -user MY_USERNAME
What is the cause of this error, so that I can fix it and SSH into my jenkins instance?

Related

Getting Exception whenever I start Jenkins

Whenever I run this command java -jar jenkins.war --ajp13Port=-1 --httpPort=8080 it throws
First Jenkins started with daemon mode where it was restarting the process then I have tried to start it manually but getting the same error.
I even tried with older version of Jenkins as well but gettting the same error.
Jenkins Version - 2.107.2
Running from: /Applications/Jenkins/jenkins.war
webroot: $user.home/.jenkins
Apr 25, 2018 2:54:55 PM Main deleteWinstoneTempContents
WARNING: Failed to delete the temporary Winstone file /var/folders/60/r656jt5d01s0g2qtqdlycjbr0000gq/T/winstone/jenkins.war
Apr 25, 2018 2:54:55 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Logging initialized #429ms
Apr 25, 2018 2:54:55 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Apr 25, 2018 2:54:56 PM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Empty contextPath
Apr 25, 2018 2:54:56 PM winstone.Logger logInternal
INFO: Winstone shutdown successfully
java.lang.NoSuchMethodError: org.eclipse.jetty.server.handler.HandlerWrapper.updateBean(Ljava/lang/Object;Ljava/lang/Object;Z)V
at org.eclipse.jetty.server.handler.HandlerWrapper.setHandler(HandlerWrapper.java:95)
at org.eclipse.jetty.servlet.ServletContextHandler.doSetHandler(ServletContextHandler.java:188)
at org.eclipse.jetty.servlet.ServletContextHandler.relinkHandlers(ServletContextHandler.java:210)
at org.eclipse.jetty.servlet.ServletContextHandler.<init>(ServletContextHandler.java:171)
at org.eclipse.jetty.webapp.WebAppContext.<init>(WebAppContext.java:289)
at org.eclipse.jetty.webapp.WebAppContext.<init>(WebAppContext.java:221)
at winstone.HostConfiguration$1.<init>(HostConfiguration.java:155)
at winstone.HostConfiguration.create(HostConfiguration.java:155)
at winstone.HostConfiguration.<init>(HostConfiguration.java:81)
at winstone.HostGroup.initHost(HostGroup.java:66)
at winstone.HostGroup.<init>(HostGroup.java:45)
at winstone.Launcher.<init>(Launcher.java:145)
at winstone.Launcher.main(Launcher.java:354)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at Main._main(Main.java:312)
at Main.main(Main.java:136)
Check the dependency tree or open the war by extracting it and see that the particular method is available or not.
This may be the case when it is taking a wrong jar while building the war file from it.

Problems with set up with the Test automation framework Selendroid

I have problems with setting up the Selendroid server.
When i run the command java -jar selendroid-standalone-0.11.0-with-dependencies.jar -app selendroid-test-app-0.11.0.apk
I get the following errors:
C:\Users\mawal2\Downloads>java -jar selendroid-standalone-0.11.0-with-dependenci
es.jar -app selendroid-test-app-0.11.0.apk
################# Selendroid #################
################# Configuration in use #################
io.selendroid.SelendroidConfiguration#19469ea2[
port=4444
timeoutEmulatorStart=300000
supportedApps=[selendroid-test-app-0.11.0.apk]
verbose=false
emulatorPort=5560
deviceScreenshot=false
selendroidServerPort=8080
keystore=<null>
emulatorOptions=<null>
registrationUrl=<null>
proxy=<null>
serverHost=<null>
keepAdbAlive=false
noWebViewApp=false
noClearData=false
sessionTimeoutSeconds=1800
forceReinstall=false
logLevel=ERROR
]
Oct 16, 2014 7:57:24 AM io.selendroid.SelendroidLauncher launchServer
INFO: Starting selendroid-server port 4444
Oct 16, 2014 7:57:24 AM io.selendroid.io.ShellCommand exec
INFO: executing command: C:\Users\mawal2\Documents\android\adt-bundle-windows-x8
6_64-20140702\sdk\build-tools\android-4.4W\aapt.exe remove C:\Users\mawal2\Downl
oads\selendroid-test-app-0.11.0.apk META-INF/MANIFEST.MF
Oct 16, 2014 7:57:24 AM io.selendroid.io.ShellCommand exec
INFO: executing command: C:\Users\mawal2\Documents\android\adt-bundle-windows-x8
6_64-20140702\sdk\build-tools\android-4.4W\aapt.exe remove C:\Users\mawal2\Downl
oads\selendroid-test-app-0.11.0.apk META-INF/CERT.RSA
Oct 16, 2014 7:57:24 AM io.selendroid.io.ShellCommand exec
INFO: executing command: C:\Users\mawal2\Documents\android\adt-bundle-windows-x8
6_64-20140702\sdk\build-tools\android-4.4W\aapt.exe remove C:\Users\mawal2\Downl
oads\selendroid-test-app-0.11.0.apk META-INF/CERT.SF
Oct 16, 2014 7:57:24 AM io.selendroid.io.ShellCommand exec
INFO: executing command: C:\Users\mawal2\Documents\android\adt-bundle-windows-x8
6_64-20140702\sdk\build-tools\android-4.4W\aapt.exe remove C:\Users\mawal2\Downl
oads\selendroid-test-app-0.11.0.apk META-INF/ANDROIDD.SF
Oct 16, 2014 7:57:24 AM io.selendroid.io.ShellCommand exec
INFO: executing command: C:\Users\mawal2\Documents\android\adt-bundle-windows-x8
6_64-20140702\sdk\build-tools\android-4.4W\aapt.exe remove C:\Users\mawal2\Downl
oads\selendroid-test-app-0.11.0.apk META-INF/ANDROIDD.RSA
Oct 16, 2014 7:57:24 AM io.selendroid.io.ShellCommand exec
INFO: executing command: C:\Users\mawal2\Documents\android\adt-bundle-windows-x8
6_64-20140702\sdk\build-tools\android-4.4W\aapt.exe remove C:\Users\mawal2\Downl
oads\selendroid-test-app-0.11.0.apk META-INF/NDKEYSTO.SF
Oct 16, 2014 7:57:24 AM io.selendroid.io.ShellCommand exec
INFO: executing command: C:\Users\mawal2\Documents\android\adt-bundle-windows-x8
6_64-20140702\sdk\build-tools\android-4.4W\aapt.exe remove C:\Users\mawal2\Downl
oads\selendroid-test-app-0.11.0.apk META-INF/NDKEYSTO.RSA
Oct 16, 2014 7:57:24 AM io.selendroid.io.ShellCommand exec
INFO: executing command: C:\Program Files\Java\jdk1.8.0_20\bin\bin\jarsigner.exe
-sigalg MD5withRSA -digestalg SHA1 -signedjar C:\Users\mawal2\Downloads\resigne
d-selendroid-test-app-0.11.0.apk -storepass android -keystore C:\Users\mawal2\.a
ndroid\debug.keystore C:\Users\mawal2\Downloads\selendroid-test-app-0.11.0.apk a
ndroiddebugkey
Oct 16, 2014 7:57:24 AM io.selendroid.SelendroidLauncher launchServer
SEVERE: Error occurred while building server: An error occurred while resigning
the app 'selendroid-test-app-0.11.0.apk'.
io.selendroid.exceptions.SessionNotCreatedException: An error occurred while res
igning the app 'selendroid-test-app-0.11.0.apk'.
at io.selendroid.server.model.SelendroidStandaloneDriver.initApplication
sUnderTest(SelendroidStandaloneDriver.java:114)
at io.selendroid.server.model.SelendroidStandaloneDriver.<init>(Selendro
idStandaloneDriver.java:82)
at io.selendroid.server.SelendroidStandaloneServer.initializeSelendroidS
erver(SelendroidStandaloneServer.java:61)
at io.selendroid.server.SelendroidStandaloneServer.<init>(SelendroidStan
daloneServer.java:50)
at io.selendroid.SelendroidLauncher.launchServer(SelendroidLauncher.java
:49)
at io.selendroid.SelendroidLauncher.main(SelendroidLauncher.java:105)
Caused by: io.selendroid.exceptions.ShellCommandException: An error occured whil
e executing shell command: C:\Program Files\Java\jdk1.8.0_20\bin\bin\jarsigner.e
xe -sigalg MD5withRSA -digestalg SHA1 -signedjar C:\Users\mawal2\Downloads\resig
ned-selendroid-test-app-0.11.0.apk -storepass android -keystore C:\Users\mawal2\
.android\debug.keystore C:\Users\mawal2\Downloads\selendroid-test-app-0.11.0.apk
androiddebugkey
at io.selendroid.io.ShellCommand.exec(ShellCommand.java:49)
at io.selendroid.builder.SelendroidServerBuilder.signTestServer(Selendro
idServerBuilder.java:274)
at io.selendroid.builder.SelendroidServerBuilder.resignApp(SelendroidSer
verBuilder.java:134)
at io.selendroid.server.model.SelendroidStandaloneDriver.initApplication
sUnderTest(SelendroidStandaloneDriver.java:112)
... 5 more
Caused by: io.selendroid.exceptions.ShellCommandException:
... 9 more
Exception in thread "main" io.selendroid.exceptions.SessionNotCreatedException:
An error occurred while resigning the app 'selendroid-test-app-0.11.0.apk'.
at io.selendroid.server.model.SelendroidStandaloneDriver.initApplication
sUnderTest(SelendroidStandaloneDriver.java:114)
at io.selendroid.server.model.SelendroidStandaloneDriver.<init>(Selendro
idStandaloneDriver.java:82)
at io.selendroid.server.SelendroidStandaloneServer.initializeSelendroidS
erver(SelendroidStandaloneServer.java:61)
at io.selendroid.server.SelendroidStandaloneServer.<init>(SelendroidStan
daloneServer.java:50)
at io.selendroid.SelendroidLauncher.launchServer(SelendroidLauncher.java
:49)
at io.selendroid.SelendroidLauncher.main(SelendroidLauncher.java:105)
Caused by: io.selendroid.exceptions.ShellCommandException: An error occured whil
e executing shell command: C:\Program Files\Java\jdk1.8.0_20\bin\bin\jarsigner.e
xe -sigalg MD5withRSA -digestalg SHA1 -signedjar C:\Users\mawal2\Downloads\resig
ned-selendroid-test-app-0.11.0.apk -storepass android -keystore C:\Users\mawal2\
.android\debug.keystore C:\Users\mawal2\Downloads\selendroid-test-app-0.11.0.apk
androiddebugkey
at io.selendroid.io.ShellCommand.exec(ShellCommand.java:49)
at io.selendroid.builder.SelendroidServerBuilder.signTestServer(Selendro
idServerBuilder.java:274)
at io.selendroid.builder.SelendroidServerBuilder.resignApp(SelendroidSer
verBuilder.java:134)
at io.selendroid.server.model.SelendroidStandaloneDriver.initApplication
sUnderTest(SelendroidStandaloneDriver.java:112)
... 5 more
Caused by: io.selendroid.exceptions.ShellCommandException:
... 9 more
C:\Users\mawal2\Downloads>
I think the problem has something to to with either the java or android environment variable.
I have read a lot of guides and forum postes and tried different ways, but i always end up with the same result. The env-variables are currently set-up in the following way:
Under "User variables for ":
ANDROID_HOME: C:\Users\mawal2\Documents\android\adt-bundle-windows-x86_64-20140702\sdk
JAVA_HOME: C:\Program Files\Java\jdk1.8.0_20\bin
Under "System varibles":
Path: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Windows\CCM;C:\Program Files\OpenVPN\bin;C:\Users\mawal2\Documents\android\adt-bundle-windows-x86_64-20140702\sdk\tools\;C:\Users\mawal2\Documents\android\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\;C:\Program Files\Java\jdk1.8.0_20\bin\;
My OS is Windows 8.1 Enterprise
Am very grateful for all help i can get!
Best regards Magnus
I solved the problem when a An error occured whil
e executing shell command: C:\Program Files\Java\jdk1.8.0_20\bin\bin\jarsigner.e
xe
There are bin\bin after each other wich is not correct. Solved it by changing the Java home variable to:
JAVA_HOME: C:\Program Files\Java\jdk1.8.0_20\
I also notice that for me variable changes are only done after restarting the computer, this may be the reason why didn't manage to solve it before.

Jenkins on Solaris 10 64 bit

I am trying to upgrade my Jenkins on a Solaris SPARC machine. I have been using Jenkins version 1.528 and the java version is "1.6.0_65".
I tried to install 1.565.1 on this server, I was able to start it using "java -jar jenkins.war --httpPort=8086"
Aug 13, 2014 2:52:16 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started SelectChannelConnector#0.0.0.0:8086
Aug 13, 2014 2:52:16 PM winstone.Logger logInternal
INFO: Winstone Servlet Engine v2.0 running: controlPort=disabled
Aug 13, 2014 2:52:18 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Aug 13, 2014 2:52:19 PM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Aug 13, 2014 2:52:19 PM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Aug 13, 2014 2:52:19 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Aug 13, 2014 2:52:19 PM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Aug 13, 2014 2:52:19 PM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Aug 13, 2014 2:52:37 PM org.jenkinsci.main.modules.sshd.SSHD start
INFO: Started SSHD at port 54927
Aug 13, 2014 2:52:37 PM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
Aug 13, 2014 2:52:37 PM hudson.TcpSlaveAgentListener <init>
INFO: JNLP slave agent listener started on TCP port 54928
Aug 13, 2014 2:52:37 PM hudson.WebAppMain$3 run
INFO: Jenkins is fully up and running
but the homepage never loads on browser. I see there is something listening on the port but the connnetion is in CLOSE_WAIT status.
bash-3.2$ lsof -i |grep 8086
java 26329 acs 7u IPv4 0x3018556b840 0t0 TCP *:8086 (LISTEN)
java 26329 acs 105u IPv4 0x30278e93900 0t0 TCP server:8086->user-machine:54670 (ESTABLISHED)
java 26329 acs 750u IPv4 0x300b9af9900 0t0 TCP server:8086->user-machine:54671 (CLOSE_WAIT)
java 26329 acs 751u IPv4 0x301ab4f0080 0t0 TCP server:8086->user-machine:54672 (CLOSE_WAIT)
I tried other version 1.532 and it worked but it did not work for 1.534
I tried the same version 1.565.3 on a Linux server and it worked there, It had java version "1.7.0_45". Has anyone else faced this issue?
We have got the same problem on Solaris 11.1.
SunOS XXXXX 5.11 11.1 sun4v sparc sun4v
We are so far using 5.32.1 stable working. 5.80.3 not working.
There is no respond on wget. We are using default port 8080 and neither on wget nor on browser a connection can be established.
This issue is not fixed, I have opened a JIRA ticket on Jenkins forum
JENKINS-24357
There are a few related tickets as well

IntelliJ - Unable to start Tomcat 8. Starts fine via comand line

I'm a complete noob to IntelliJ and Tomcat 8. I managed to configured Tomcat 7 in IntelliJ in the same manner (as configuring TC8) and it works normally. Also, TC8 works when I start it up using command-line.
Here's what IntelliJ tells me when I try to run TC8:
"Application Server was not connected before run configuration stop,
reason: java.io.IOException: Failed to retrieve RMIServer stub:
javax.naming.CommunicationException [Root exception is
java.rmi.ConnectIOException: error during JRMP connection
establishment; nested exception is: java.net.SocketException:
Connection reset]"
Logs:
C:\apache-tomcat-8.0.8\bin\catalina.bat run Using CATALINA_BASE:
"C:\Program Files\Apache Software Foundation\Tomcat 8.0" Using
CATALINA_HOME: "C:\apache-tomcat-8.0.8" Using CATALINA_TMPDIR:
"C:\apache-tomcat-8.0.8\temp" Using JRE_HOME: "C:\Program
Files\Java\jre8" Using CLASSPATH:
"C:\apache-tomcat-8.0.8\bin\bootstrap.jar;C:\apache-tomcat-8.0.8\bin\tomcat-juli.jar"
Jun 06, 2014 1:22:08 AM org.apache.catalina.startup.Catalina load
WARNING: Unable to load server configuration from [C:\Program
Files\Apache Software Foundation\Tomcat 8.0\conf\server.xml] Jun 06,
2014 1:22:08 AM org.apache.catalina.startup.Catalina load WARNING:
Unable to load server configuration from [C:\Program Files\Apache
Software Foundation\Tomcat 8.0\conf\server.xml] Jun 06, 2014 1:22:08
AM org.apache.catalina.startup.Catalina start SEVERE: Cannot start
server. Server instance is not configured. Disconnected from server
Follow these steps :
Configure new Tomcat Server :
After configure click on OK.
Then on that one + symbol is there click on it i.e. in Green color, it shows :
then last step is to configure it for application :
from deployment tab add exploded file of application then configure that in which browser you want to open application then click OK, if you want to change more settings then you can.
Then try click on Green Button that will run your application.

Google App Engine not being accessed via localhost

I am using Mac OS X 10.7.4, app engine sdk 1.7.0, eclipse juno and Java as programming language. The problem is that App runs perfectly well when deployed on appspot but does not work on localhost. When run as web application on port 8888 or any other port (if change it from the configuration), the log represents server is running but when I hit the URL, nothing happens and after some time connection times out. When, debugged it gives the error: Cannot connect to VM. Logs from console for both run and debugged are shown below, kindly help me, I have searched all over the 'net but could not find the solution.
Log when Debugged:
ERROR: transport error 202: handshake failed - connection prematurally closed
ERROR: JDWP: Failed to initialize transport via localhost:49741, trying localhost via 127.0.0.1:49741
ERROR: transport error 202: recv failed during handshake: Connection reset by peer
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
Log when run:
2012-07-17 19:07:42.504 java[417:407] [Java CocoaComponent compatibility mode]: Enabled
2012-07-17 19:07:42.505 java[417:407] [Java CocoaComponent compatibility mode]: Setting timeout for SWT to 0.100000
Jul 17, 2012 2:07:49 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
Jul 17, 2012 2:07:50 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed /Volumes/DATA 1/Google App Engine/Java/HelloWorld/war/WEB-INF/appengine-web.xml
Jul 17, 2012 2:07:50 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed /Volumes/DATA 1/Google App Engine/Java/HelloWorld/war/WEB-INF/web.xml
Jul 17, 2012 7:07:52 PM com.google.appengine.tools.development.DevAppServerImpl start
INFO: The server is running at localhost:8888/
Jul 17, 2012 7:07:52 PM com.google.appengine.tools.development.DevAppServerImpl start
INFO: The admin console is running at localhost:8888/_ah/admin
Log when Run from command line:
Jul 21, 2012 3:23:19 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
Jul 21, 2012 3:23:19 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed /Volumes/DATA 1/Softwares/appengine-java-sdk-1.7.0/demos
/guestbook/war/WEB-INF/appengine-web.xml
Jul 21, 2012 3:23:19 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed /Volumes/DATA 1/Softwares/appengine-java-sdk-1.7.0/demos/guestbook/war/WEB-INF/web.xml
Jul 21, 2012 8:23:22 PM com.google.appengine.tools.development.DevAppServerImpl start
INFO: The server is running at http://localhost:8080/
Jul 21, 2012 8:23:23 PM com.google.appengine.tools.development.DevAppServerImpl start
INFO: The admin console is running at http://localhost:8080/_ah/admin
Check the following:
1) If the application has actually started. Enter "ps ax | grep java" in terminal
2) If the application has bound to the port. Install nmap (not sure how to do it on mac) and run it with "nmap localhost". You will see a list of ports and protocols used. If you don't see 8888 with http then something is wrong.
Have you tried running it from the command line? It looks like you're trying to start it in the debugger as well.. no? Try running from the command line, make sure that works. Then try running it from eclipse with "Run" not "Debug" and make sure that works before trying the debugger. Appengine is a little bit particular...

Categories