Skip to content

Null pointer exception when running in Jenkins declarative pipeline - plugin version 4.0.1Β #83

Open
@ewh0005

Description

I have recently updated from plugin version 4.0.0 to 4.0.1, and I am now getting a null pointer exception in my Jenkins declarative pipeline using the new version of the plugin.

Here is the exception:

java.lang.NullPointerException
	at org.jenkinsci.plugins.fodupload.steps.FortifyStaticAssessment.perform(FortifyStaticAssessment.java:171)
	at org.jenkinsci.plugins.fodupload.steps.FortifyStaticAssessment$Execution.run(FortifyStaticAssessment.java:233)
	at org.jenkinsci.plugins.fodupload.steps.FortifyStaticAssessment$Execution.run(FortifyStaticAssessment.java:221)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834) 

It seems to indicate that there is no username in line 171 of this file: https://github.com/jenkinsci/fortify-on-demand-uploader-plugin/blob/master/src/main/java/org/jenkinsci/plugins/fodupload/steps/FortifyStaticAssessment.java

However, I am passing a username (and personal access token) pulled from the Jenkins credential store:

withCredentials([usernamePassword(credentialsId: "${uploadOptions.fortifyPatCredentials}", passwordVariable: 'FORTIFY_CRED_PSW', usernameVariable: 'FORTIFY_CRED_USR')]) {
   fodStaticAssessment bsiToken: "${bsiToken}", entitlementPreference: 'SubscriptionOnly', inProgressScanActionType: 'DoNotStartScan', overrideGlobalConfig: true, 
      personalAccessToken: "${FORTIFY_CRED_PSW}", remediationScanPreferenceType: 'RemediationScanIfAvailable', srcLocation: "${WORKSPACE}", tenantId: "${globalVars.FORTIFY_TENANT}", username: "${FORTIFY_CRED_USR}"
}

This code worked in 4.0.0, but now gives the NPE in 4.0.1.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions