[JIRA] (JENKINS-39814) RejectedAccessException: unclassified method org.jfrog.hudson.pipeline.types.Docker withRegistry

32 views
Skip to first unread message

glon.sebastien@free.fr (JIRA)

unread,
Nov 17, 2016, 4:28:02 AM11/17/16
to jenkinsc...@googlegroups.com
sébastien glon created an issue
 
Jenkins / Bug JENKINS-39814
RejectedAccessException: unclassified method org.jfrog.hudson.pipeline.types.Docker withRegistry
Issue Type: Bug Bug
Assignee: Eyal Ben Moshe
Components: artifactory-plugin
Created: 2016/Nov/17 9:27 AM
Environment: Jenkins 2.28
Labels: jenkins2.0 artifactory-plugin
Priority: Minor Minor
Reporter: sébastien glon

If i user this pipeline code:

def server = Artifactory.server('artifactory_global')
def rtDocker = Artifactory.docker()

node {
docker.withRegistry("http://$

{registry}

", "admnexus" ) {
}
}

I get this error:

org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified method org.jfrog.hudson.pipeline.types.Docker withRegistry org.codehaus.groovy.runtime.GStringImpl java.lang.String org.jenkinsci.plugins.workflow.cps.CpsClosure2
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:113)
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:16)
at WorkflowScript.run(WorkflowScript:24)
at __cps.transform__(Native Method)
at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:48)
at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
at sun.reflect.GeneratedMethodAccessor178.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.ClosureBlock.eval(ClosureBlock.java:46)
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:18)
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:163)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:324)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:78)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:236)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:224)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:63)
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)

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

romang@jfrog.com (JIRA)

unread,
Nov 17, 2016, 4:53:05 AM11/17/16
to jenkinsc...@googlegroups.com
Roman Gurevitch commented on Bug JENKINS-39814
 
Re: RejectedAccessException: unclassified method org.jfrog.hudson.pipeline.types.Docker withRegistry

Thanks for reporting this issue, we were unable to reproduce this issue with the provided pipeline script.
Could you provide a full pipeline script example that causes this issue?

glon.sebastien@free.fr (JIRA)

unread,
Nov 17, 2016, 5:43:02 AM11/17/16
to jenkinsc...@googlegroups.com

node {
stage("test") {


def server = Artifactory.server('artifactory_global')
def rtDocker = Artifactory.docker()

rtDocker.withRegistry("https://maregistry/", "admnexus" )

{ rtDocker.pull("maregistry/library/hello-world") rtDocker.push("maregistry/library/hello-world", "maregistry/library/hello-world") }

}
}

romang@jfrog.com (JIRA)

unread,
Nov 17, 2016, 7:49:02 AM11/17/16
to jenkinsc...@googlegroups.com

There is a difference between the global variable docker and the defined variable rtDocker which is part of Artifactory jenkins plugin.
The correct usage in this instance is docker.withRegistry not rtDocker.withRegistry.

Please note that using docker.withRegistry is not designed to work with Artifactory.docker API.
Pushing image with Artifactory plugin require setting username and password or credentialsId for Artifactory docker instance and pushing the correct tagged image that includes the registry path, for example:
def rtDocker = Artifactory.docker credentialsId: "credentialsPluginId"
rtDocker.push("registry/imageName:version", "targetRepositoryNameInArtifactory")

More information can be found in the following link: https://wiki.jenkins-ci.org/display/JENKINS/Artifactory+-+Working+With+the+Pipeline+Jenkins+Plugin

glon.sebastien@free.fr (JIRA)

unread,
Nov 17, 2016, 9:17:01 AM11/17/16
to jenkinsc...@googlegroups.com

Is it possible to use credentialID and not hardCoded Login Password?

glon.sebastien@free.fr (JIRA)

unread,
Nov 17, 2016, 9:25:01 AM11/17/16
to jenkinsc...@googlegroups.com
sébastien glon edited a comment on Bug JENKINS-39814
Is it possible to use credentialID and not hardCoded Login Password?


On server global config, i have defined default credential but i always have an "unauthorized: authentication required' but this is the same user/password that i use on docker.push

romang@jfrog.com (JIRA)

unread,
Nov 17, 2016, 9:58:01 AM11/17/16
to jenkinsc...@googlegroups.com

Yes, our latest plugin version 2.8.1 supports credentials plugin.
Example can be found in the previous message and in our documentation.
Please contact our support for further configuration issues at: https://support.jfrog.com/

glon.sebastien@free.fr (JIRA)

unread,
Nov 17, 2016, 10:31:01 AM11/17/16
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages