com.jcraft.jsch.JSchException

tip

Ant scp task has an attribute called trust. If set to false (default) the host you connect to has to be set in the knownhosts file (you might have to create it) Another way is to explicitly set "trust = true". Check the documentation: https://goo.gl/G5680x

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Hi, we are using PublishOverSSHPlugin in a lot of jenkins jobs and they fail occasionally with the error *verify: false* {noformat} SSH: Connecting from host [foo] SSH: Connecting with configuration [xyz (target host)] ... ERROR: Exception when publishing, exception message [Failed to connect session for config [xyz (target host)]. Message [verify: false]] Build step 'Send files or execute commands over SSH' changed build result to FAILURE Build step 'Send files or execute commands over SSH' marked build as failure {noformat} i found the the following strack traces in jenkins.log for this issue {noformat} Sep 30, 2013 12:01:19 AM jenkins.plugins.publish_over_ssh.BapSshHostConfiguration connect Warning: Failed to connect session for config [xyz (target host)]. Message [verify: false] com.jcraft.jsch.JSchException: verify: false at com.jcraft.jsch.Session.connect(Session.java:305) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.connect(BapSshHostConfiguration.java:221) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:135) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:112) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:51) at jenkins.plugins.publish_over.BapPublisher$Performer.perform(BapPublisher.java:229) at jenkins.plugins.publish_over.BapPublisher$Performer.access$000(BapPublisher.java:205) at jenkins.plugins.publish_over.BapPublisher.perform(BapPublisher.java:158) at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:64) at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:37) at hudson.FilePath.act(FilePath.java:906) at hudson.FilePath.act(FilePath.java:879) at jenkins.plugins.publish_over.BPInstanceConfig.perform(BPInstanceConfig.java:138) at jenkins.plugins.publish_over.BPPlugin.perform(BPPlugin.java:111) at jenkins.plugins.publish_over_ssh.BapSshBuilderPlugin.perform(BapSshBuilderPlugin.java:64) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586) at hudson.model.Run.execute(Run.java:1593) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:247) Sep 30, 2013 12:01:19 AM jenkins.plugins.publish_over.BPCallablePublisher invoke Warning: Exception when publishing, exception message [Failed to connect session for config [xyz (target host)]. Message [verify: false]] jenkins.plugins.publish_over.BapPublisherException: Failed to connect session for config [xyz (target host)]. Message [verify: false] at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.connect(BapSshHostConfiguration.java:225) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:135) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:112) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:51) at jenkins.plugins.publish_over.BapPublisher$Performer.perform(BapPublisher.java:229) at jenkins.plugins.publish_over.BapPublisher$Performer.access$000(BapPublisher.java:205) at jenkins.plugins.publish_over.BapPublisher.perform(BapPublisher.java:158) at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:64) at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:37) at hudson.FilePath.act(FilePath.java:906) at hudson.FilePath.act(FilePath.java:879) at jenkins.plugins.publish_over.BPInstanceConfig.perform(BPInstanceConfig.java:138) at jenkins.plugins.publish_over.BPPlugin.perform(BPPlugin.java:111) at jenkins.plugins.publish_over_ssh.BapSshBuilderPlugin.perform(BapSshBuilderPlugin.java:64) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586) at hudson.model.Run.execute(Run.java:1593) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:247) Sep 30, 2013 12:01:19 AM jenkins.plugins.publish_over.BPInstanceConfig perform Warning: An exception was caught when invoking perform jenkins.plugins.publish_over.BapPublisherException: Exception when publishing, exception message [Failed to connect session for config [xyz (target host)]. Message [verify: false]] at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:68) at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:37) at hudson.FilePath.act(FilePath.java:906) at hudson.FilePath.act(FilePath.java:879) at jenkins.plugins.publish_over.BPInstanceConfig.perform(BPInstanceConfig.java:138) at jenkins.plugins.publish_over.BPPlugin.perform(BPPlugin.java:111) at jenkins.plugins.publish_over_ssh.BapSshBuilderPlugin.perform(BapSshBuilderPlugin.java:64) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586) at hudson.model.Run.execute(Run.java:1593) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:247) Caused by: jenkins.plugins.publish_over.BapPublisherException: Failed to connect session for config [xyz (target host)]. Message [verify: false] at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.connect(BapSshHostConfiguration.java:225) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:135) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:112) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:51) at jenkins.plugins.publish_over.BapPublisher$Performer.perform(BapPublisher.java:229) at jenkins.plugins.publish_over.BapPublisher$Performer.access$000(BapPublisher.java:205) at jenkins.plugins.publish_over.BapPublisher.perform(BapPublisher.java:158) at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:64) ... 15 more {noformat} Since jsch-0.1.50 this issue is fixed ( see the changelog of jsch http://www.jcraft.com/jsch/ChangeLog ). Currently, PublicOverSSHPlugin uses jsch-0.1.45.
    via by ismail demirel,
  • Hi, we are using PublishOverSSHPlugin in a lot of jenkins jobs and they fail occasionally with the error *verify: false* {noformat} SSH: Connecting from host [foo] SSH: Connecting with configuration [xyz (target host)] ... ERROR: Exception when publishing, exception message [Failed to connect session for config [xyz (target host)]. Message [verify: false]] Build step 'Send files or execute commands over SSH' changed build result to FAILURE Build step 'Send files or execute commands over SSH' marked build as failure {noformat} i found the the following strack traces in jenkins.log for this issue {noformat} Sep 30, 2013 12:01:19 AM jenkins.plugins.publish_over_ssh.BapSshHostConfiguration connect Warning: Failed to connect session for config [xyz (target host)]. Message [verify: false] com.jcraft.jsch.JSchException: verify: false at com.jcraft.jsch.Session.connect(Session.java:305) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.connect(BapSshHostConfiguration.java:221) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:135) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:112) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:51) at jenkins.plugins.publish_over.BapPublisher$Performer.perform(BapPublisher.java:229) at jenkins.plugins.publish_over.BapPublisher$Performer.access$000(BapPublisher.java:205) at jenkins.plugins.publish_over.BapPublisher.perform(BapPublisher.java:158) at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:64) at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:37) at hudson.FilePath.act(FilePath.java:906) at hudson.FilePath.act(FilePath.java:879) at jenkins.plugins.publish_over.BPInstanceConfig.perform(BPInstanceConfig.java:138) at jenkins.plugins.publish_over.BPPlugin.perform(BPPlugin.java:111) at jenkins.plugins.publish_over_ssh.BapSshBuilderPlugin.perform(BapSshBuilderPlugin.java:64) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586) at hudson.model.Run.execute(Run.java:1593) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:247) Sep 30, 2013 12:01:19 AM jenkins.plugins.publish_over.BPCallablePublisher invoke Warning: Exception when publishing, exception message [Failed to connect session for config [xyz (target host)]. Message [verify: false]] jenkins.plugins.publish_over.BapPublisherException: Failed to connect session for config [xyz (target host)]. Message [verify: false] at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.connect(BapSshHostConfiguration.java:225) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:135) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:112) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:51) at jenkins.plugins.publish_over.BapPublisher$Performer.perform(BapPublisher.java:229) at jenkins.plugins.publish_over.BapPublisher$Performer.access$000(BapPublisher.java:205) at jenkins.plugins.publish_over.BapPublisher.perform(BapPublisher.java:158) at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:64) at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:37) at hudson.FilePath.act(FilePath.java:906) at hudson.FilePath.act(FilePath.java:879) at jenkins.plugins.publish_over.BPInstanceConfig.perform(BPInstanceConfig.java:138) at jenkins.plugins.publish_over.BPPlugin.perform(BPPlugin.java:111) at jenkins.plugins.publish_over_ssh.BapSshBuilderPlugin.perform(BapSshBuilderPlugin.java:64) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586) at hudson.model.Run.execute(Run.java:1593) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:247) Sep 30, 2013 12:01:19 AM jenkins.plugins.publish_over.BPInstanceConfig perform Warning: An exception was caught when invoking perform jenkins.plugins.publish_over.BapPublisherException: Exception when publishing, exception message [Failed to connect session for config [xyz (target host)]. Message [verify: false]] at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:68) at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:37) at hudson.FilePath.act(FilePath.java:906) at hudson.FilePath.act(FilePath.java:879) at jenkins.plugins.publish_over.BPInstanceConfig.perform(BPInstanceConfig.java:138) at jenkins.plugins.publish_over.BPPlugin.perform(BPPlugin.java:111) at jenkins.plugins.publish_over_ssh.BapSshBuilderPlugin.perform(BapSshBuilderPlugin.java:64) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586) at hudson.model.Run.execute(Run.java:1593) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:247) Caused by: jenkins.plugins.publish_over.BapPublisherException: Failed to connect session for config [xyz (target host)]. Message [verify: false] at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.connect(BapSshHostConfiguration.java:225) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:135) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:112) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:51) at jenkins.plugins.publish_over.BapPublisher$Performer.perform(BapPublisher.java:229) at jenkins.plugins.publish_over.BapPublisher$Performer.access$000(BapPublisher.java:205) at jenkins.plugins.publish_over.BapPublisher.perform(BapPublisher.java:158) at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:64) ... 15 more {noformat} Since jsch-0.1.50 this issue is fixed ( see the changelog of jsch http://www.jcraft.com/jsch/ChangeLog ). Currently, PublicOverSSHPlugin uses jsch-0.1.45.
    via by ismail demirel,
  • JSch is a pure Java implementation of SSH2. ()
    via by Unknown author,
  • We see seemingly random connection failures: FATAL: CVS authentication failure while running rlog command java.lang.RuntimeException: CVS authentication failure while running rlog command at hudson.scm.AbstractCvs.getRemoteLogForModule(AbstractCvs.java:630) at hudson.scm.AbstractCvs.calculateChangeLog(AbstractCvs.java:696) at hudson.scm.AbstractCvs.postCheckout(AbstractCvs.java:715) at hudson.scm.CVSSCM.checkout(CVSSCM.java:359) at hudson.model.AbstractProject.checkout(AbstractProject.java:1367) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:674) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:579) at hudson.model.Run.execute(Run.java:1575) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) Caused by: org.netbeans.lib.cvsclient.connection.AuthenticationException: SSH connection failed. at org.netbeans.lib.cvsclient.connection.SSHConnection.open(SSHConnection.java:141) at org.netbeans.lib.cvsclient.Client$1.run(Client.java:374) at java.lang.Thread.run(Thread.java:722) Caused by: com.jcraft.jsch.JSchException: verify: false at com.jcraft.jsch.Session.connect(Session.java:307) at com.jcraft.jsch.Session.connect(Session.java:160) at org.netbeans.lib.cvsclient.connection.SSHConnection.open(SSHConnection.java:139) ... 2 more There is a (fixed in 1.50) jsch bug, which seems related. I updated our Jsch yesterday and since then no more connection errors occurred (Before it occurred at least a few times a day, so I'm pretty confident that 1.50 fixed the issue).
    via by Sascha Vogt ,
  • GUI Locking Up - LogMX forum
    via by Unknown author,
  • JSch is a pure Java implementation of SSH2. ()
    via by Unknown author,
    • com.jcraft.jsch.JSchException: verify: false at com.jcraft.jsch.Session.connect(Session.java:305) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.connect(BapSshHostConfiguration.java:221) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:135) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:112) at jenkins.plugins.publish_over_ssh.BapSshHostConfiguration.createClient(BapSshHostConfiguration.java:51) at jenkins.plugins.publish_over.BapPublisher$Performer.perform(BapPublisher.java:229) at jenkins.plugins.publish_over.BapPublisher$Performer.access$000(BapPublisher.java:205) at jenkins.plugins.publish_over.BapPublisher.perform(BapPublisher.java:158) at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:64) at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:37) at hudson.FilePath.act(FilePath.java:906) at hudson.FilePath.act(FilePath.java:879) at jenkins.plugins.publish_over.BPInstanceConfig.perform(BPInstanceConfig.java:138) at jenkins.plugins.publish_over.BPPlugin.perform(BPPlugin.java:111) at jenkins.plugins.publish_over_ssh.BapSshBuilderPlugin.perform(BapSshBuilderPlugin.java:64) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586) at hudson.model.Run.execute(Run.java:1593) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:247)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    jf-ast
    10 times, last one,
    jstrayer
    3 times, last one,
    Unknown visitor1 times, last one,
    98 more bugmates