Steps to reproduce:
1: set up an SSH key under my username
2: verified that I am authenticated: java -jar jenkins-cli.jar -s
http://myserver/jenkins who-am-i
Authenticated as: myuser
Authorities:
authenticated
3: tried to run a trivial script via groovysh and got an error
java -jar jenkins-cli.jar -s
http://myserver/jenkins<http://vbuild06.atld1:8080/jenkins> groovysh
'jenkins.model.Jenkins.instance.pluginManager.plugins.each {
println("${it.longName} - ${it.version}") };'
Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
at $Proxy2.main(Unknown Source)
at hudson.cli.CLI.execute(CLI.java:271)
at hudson.cli.CLI._main(CLI.java:417)
at hudson.cli.CLI.main(CLI.java:322)
Caused by: hudson.remoting.ProxyException:
hudson.security.AccessDeniedException2: anonymous is missing the Administer
permission
at hudson.security.ACL.checkPermission(ACL.java:53)
at hudson.model.Node.checkPermission(Node.java:381)
at hudson.cli.GroovyshCommand.main(GroovyshCommand.java:61)
at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92)
at sun.reflect.GeneratedMethodAccessor5352.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:274)
at
hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:255)
at
hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:215)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:287)
at
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at hudson.cli.CliManagerImpl$1.call(CliManagerImpl.java:63)
at
hudson.remoting.InterceptingExecutorService$2.call(InterceptingExecutorService.java:95)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)