Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-10362

Groovy Shell command fails if the home directory isn't writable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • cli
    • None

      % java -jar jenkins-cli.jar groovysh
      FATAL: org.codehaus.groovy.runtime.InvokerInvocationException: java.io.FileNotFoundException: /path/to/home/.groovy/groovysh.history (No such file or directory)
      org.codehaus.groovy.runtime.InvokerInvocationException: java.io.FileNotFoundException: /path/to/home/.groovy/groovysh.history (No such file or directory)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:92)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234)
      	at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:2374)
      	at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:3279)
      	at org.codehaus.groovy.tools.shell.InteractiveShellRunner.setProperty(InteractiveShellRunner.groovy)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.setGroovyObjectProperty(ScriptBytecodeAdapter.java:530)
      	at org.codehaus.groovy.tools.shell.Groovysh.run(Groovysh.groovy:409)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:225)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:150)
      	at org.codehaus.groovy.tools.shell.Groovysh.run(Groovysh.groovy:372)
      	at hudson.cli.GroovyshCommand.main(GroovyshCommand.java:70)
      	at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:68)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	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:270)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:662)
      Caused by: java.io.FileNotFoundException: /opt/cloudbees/metanectar/.groovy/groovysh.history (No such file or directory)
      	at java.io.FileOutputStream.open(Native Method)
      	at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
      	at java.io.FileOutputStream.<init>(FileOutputStream.java:145)
      	at java.io.FileWriter.<init>(FileWriter.java:73)
      	at jline.History.setHistoryFile(History.java:45)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234)
      	at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:2374)
      	at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:3279)
      	at org.codehaus.groovy.runtime.InvokerHelper.setProperty(InvokerHelper.java:179)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.setProperty(ScriptBytecodeAdapter.java:483)
      	at org.codehaus.groovy.tools.shell.InteractiveShellRunner.setHistoryFile(InteractiveShellRunner.groovy:82)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      	... 32 more
      

          [JENKINS-10362] Groovy Shell command fails if the home directory isn't writable

          There are no comments yet on this issue.

            Unassigned Unassigned
            paulsandoz Paul Sandoz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: