Skip to content

getting NullPointerException while trying to use xray #185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
stephanerenou opened this issue Oct 23, 2018 · 3 comments
Open

getting NullPointerException while trying to use xray #185

stephanerenou opened this issue Oct 23, 2018 · 3 comments

Comments

@stephanerenou
Copy link

During my pipeline, I am trying to use xray and on some occasions I am getting:
java.lang.NullPointerException
at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryXrayClient.parseXrayScanResponse(ArtifactoryXrayClient.java:78)
at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryXrayClient.execute(ArtifactoryXrayClient.java:101)
at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryXrayClient.xrayScanBuild(ArtifactoryXrayClient.java:57)
at org.jfrog.hudson.pipeline.steps.XrayScanBuildStep$Execution.run(XrayScanBuildStep.java:79)
at org.jfrog.hudson.pipeline.steps.XrayScanBuildStep$Execution.run(XrayScanBuildStep.java:45)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
at hudson.security.ACL.impersonate(ACL.java:290)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
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:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

@anguswilliams
Copy link

I'm getting the same error also scanning docker build artefacts:

java.lang.NullPointerException
	at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryXrayClient.parseXrayScanResponse(ArtifactoryXrayClient.java:78)
	at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryXrayClient.execute(ArtifactoryXrayClient.java:101)
	at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryXrayClient.xrayScanBuild(ArtifactoryXrayClient.java:57)
	at org.jfrog.hudson.pipeline.scripted.steps.XrayScanBuildStep$Execution.run(XrayScanBuildStep.java:79)
	at org.jfrog.hudson.pipeline.scripted.steps.XrayScanBuildStep$Execution.run(XrayScanBuildStep.java:45)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
	at hudson.security.ACL.impersonate(ACL.java:290)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
	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:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

@barbelity
Copy link
Contributor

@stephanerenou @anguswilliams,
The NullPointerException you are receiving seem to be caused by an unexpected scan-response received at Jenkins. I have committed a fix which should prevent this exception from throwing.
From this commit, such response will be printed to the build log, and the scan will retry. That way, your build will not fail and we will be able to understand what was received from the scan.

I have created a snapshot version of Jenkins Artifactory Plug-in including this fix, which can be downloaded from here. For better troubleshooting, in future comments please specify your versions of Artifactory and Jenkins Artifactory Plugin.

Please let us know if this fix solves your issue.

@stephanerenou
Copy link
Author

Thanks for the feedback. Unfortunately the environment where we are facing this is a production env where we cannot deploy for the moment snapshot. I guess this would also be part of your next release so I hope to be able to capture those logs at that time and I hope that I would still be able to reproduce that case then.
Sorry about that.

RobiNino pushed a commit to RobiNino/build-info that referenced this issue Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants