Skip to content

[JENKINS-47458] Trilead-SSH2 fails with NPE when calling Connection#getReasonClosedCause() #22371

Closed

Description

@jenkins-infra-bot

Just caught it in SSH Slaves plugin tests on my local machine:

Caused by: java.lang.NullPointerException
	at com.trilead.ssh2.Connection.getReasonClosedCause(Connection.java:1556)
	at hudson.plugins.sshslaves.SSHLauncher.reportTransportLoss(SSHLauncher.java:1420)
	at hudson.plugins.sshslaves.SSHLauncher.afterDisconnect(SSHLauncher.java:1343)
	at hudson.slaves.SlaveComputer$3.run(SlaveComputer.java:603)
	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Tirlead code does not check whether "this.tm" field is null before returning getReasonClosedCause from "this.tm". Just a minor defect


Originally reported by oleg_nenashev, imported from: Trilead-SSH2 fails with NPE when calling Connection#getReasonClosedCause()
  • assignee: oleg_nenashev
  • status: Resolved
  • priority: Minor
  • component(s): core, trilead-api-plugin
  • resolution: Fixed
  • resolved: 2019-01-02T09:05:50+00:00
  • votes: 0
  • watchers: 2
  • imported: 2025-11-24
Raw content of original issue

Just caught it in SSH Slaves plugin tests on my local machine:

Caused by: java.lang.NullPointerException
	at com.trilead.ssh2.Connection.getReasonClosedCause(Connection.java:1556)
	at hudson.plugins.sshslaves.SSHLauncher.reportTransportLoss(SSHLauncher.java:1420)
	at hudson.plugins.sshslaves.SSHLauncher.afterDisconnect(SSHLauncher.java:1343)
	at hudson.slaves.SlaveComputer$3.run(SlaveComputer.java:603)
	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Tirlead code does not check whether "this.tm" field is null before returning getReasonClosedCause from "this.tm". Just a minor defect

Activity

  1. jenkins-infra-bot commented on Oct 16, 2017

    @jenkins-infra-bot
    Author
  2. jenkins-infra-bot commented on Dec 25, 2018

    @jenkins-infra-bot
    Author
    oleg_nenashev:

    jenkinsci/trilead-ssh2#25 was merged and released, but we need to upstream it to the core. CC ifernandezcalvo

  3. jenkins-infra-bot commented on Dec 28, 2018

    @jenkins-infra-bot
    Author
    ifernandezcalvo:
    • Original comment link
    • Raw content of original comment:

      The PRs to the core is in place

    The PRs to the core is in place

  4. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions