[HAP-762] If credentials plugin is used, Artifactory Pipeline integration throws an error Created: 18/Jun/16  Updated: 12/Dec/16  Resolved: 02/Aug/16

Status: Resolved
Project: Jenkins Artifactory Plug-in
Component/s: None
Affects Version/s: 2.5.1
Fix Version/s: 2.6.0

Type: Bug Priority: High
Reporter: Alexei Vainshtein Assignee: Alexei Vainshtein
Resolution: Fixed Votes: 3
Labels: None


 Description   

If in the manage Jenkins --> Artifactory section, configured to use Credentials plugin then upon running a pipeline build with the use of one of the servers that were configured a NPE is thrown:

java.lang.NullPointerException
	at com.cloudbees.plugins.credentials.matchers.IdMatcher.<init>(IdMatcher.java:49)
	at com.cloudbees.plugins.credentials.CredentialsMatchers.withId(CredentialsMatchers.java:112)
	at org.jfrog.hudson.util.plugins.PluginsUtils.credentialsLookup(PluginsUtils.java:61)
	at org.jfrog.hudson.CredentialsConfig.provideUsername(CredentialsConfig.java:68)
	at org.jfrog.hudson.pipeline.executors.GenericDownloadExecutor.downloadArtifacts(GenericDownloadExecutor.java:69)
	at org.jfrog.hudson.pipeline.executors.GenericDownloadExecutor.execution(GenericDownloadExecutor.java:52)
	at org.jfrog.hudson.pipeline.steps.DownloadStep$Execution.run(DownloadStep.java:60)
	at org.jfrog.hudson.pipeline.steps.DownloadStep$Execution.run(DownloadStep.java:44)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:137)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:113)
	at org.jfrog.hudson.pipeline.types.ArtifactoryServer.download(ArtifactoryServer.java:64)
	at org.jfrog.hudson.pipeline.types.ArtifactoryServer$download.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151)
	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:115)
	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:15)
	at WorkflowScript.run(WorkflowScript:12)
	at ___cps.transform___(Native Method)
	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:55)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:106)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:79)
	at sun.reflect.GeneratedMethodAccessor173.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.LocalVariableBlock$LocalVariable.get(LocalVariableBlock.java:33)
	at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
	at com.cloudbees.groovy.cps.impl.LocalVariableBlock.evalLValue(LocalVariableBlock.java:22)
	at com.cloudbees.groovy.cps.LValueBlock$BlockImpl.eval(LValueBlock.java:55)
	at com.cloudbees.groovy.cps.LValueBlock.eval(LValueBlock.java:16)
	at com.cloudbees.groovy.cps.Next.step(Next.java:58)
	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)
	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:276)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:78)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:185)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:183)
	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
	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)
Finished: FAILURE


 Comments   
Comment by A [ 23/Jun/16 ]

is there a simple workaround for this issue while we wait for the resolution?

Comment by Eyal Ben Moshe (Inactive) [ 23/Jun/16 ]

Unfortunately there's no workaround other than the code fix. We'll have the fix published here soon.

Comment by Eyal Ben Moshe (Inactive) [ 19/Jul/16 ]

Thanks for contributing this fix Alexei:
https://github.com/JFrogDev/jenkins-artifactory-plugin/pull/27

Comment by Eyal Ben Moshe (Inactive) [ 19/Jul/16 ]

A snapshot version of the plugin with the fix can be downloaded using this link:
http://repo.jfrog.org/artifactory/libs-snapshots-local/org/jenkins-ci/plugins/artifactory/2.6.0-SNAPSHOT/artifactory-2.6.0-20160719.143430-1.hpi

Comment by Robert Lazzurs [ 12/Dec/16 ]

Hello,

I have had the same issue appear in 1.8.2 and downgrading to 1.8.1 fixed the issue.

Thanks.

Generated at Tue May 21 21:23:21 UTC 2019 using JIRA 7.6.3#76005-sha1:8a4e38d34af948780dbf52044e7aafb13a7cae58.