jenkinsci / jenkinsci/ssh-credentials-plugin

[JENKINS-42280] Nullpointer on BasicSSHUserPrivateKey passphrase

Open
#300 2 comments 0 reactions 0 assignees View on GitHub
component:ssh-credentials-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
25
Forks
69
PR merge metrics
No merged PRs in 30d

Description

Hi,

When running the same script as mentioned in this ticket: JENKINS-34653">JENKINS-34653, I've got a new NullPointerException.

It looks like the passphrase field in the following file remains null while it actually should contain the password from the credentials.

https://github.com/jenkinsci/ssh-credentials-plugin/blob/384a93e3c188a1b01b1d92279bd5426dabb4e5ee/src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/impl/BasicSSHUserPrivateKey.java

In the script the variable credentials.passphrase is null and therefore invoking credentials.passphrase.plainText will result in a nullpointer.

The question is, why does credentials.passphrase remain null?

java.lang.NullPointerException: Cannot get property 'plainText' on null object

at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60)
at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:174)
at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296)
at Script1.run(Script1.groovy:34)

---
Originally reported by borisroman, imported from: Nullpointer on BasicSSHUserPrivateKey passphrase


  • status: Open
  • priority: Major
  • component(s): ssh-credentials-plugin
  • resolution: Unresolved
  • votes: 8
  • watchers: 7
  • imported: 20251215-193512

Raw content of original issue

Hi,

When running the same script as mentioned in this ticket: JENKINS-34653, I've got a new NullPointerException.

It looks like the passphrase field in the following file remains null while it actually should contain the password from the credentials.
https://github.com/jenkinsci/ssh-credentials-plugin/blob/384a93e3c188a1b01b1d92279bd5426dabb4e5ee/src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/impl/BasicSSHUserPrivateKey.java

In the script the variable credentials.passphrase is null and therefore invoking credentials.passphrase.plainText will result in a nullpointer.

The question is, why does credentials.passphrase remain null?


java.lang.NullPointerException: Cannot get property 'plainText' on null object

at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60)
at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:174)
at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296)
at Script1.run(Script1.groovy:34)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.