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

Jenkins with custom build record root dir: renaming a job should create the new build record dir if it does not already exist

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None

      We are using the (great) custom build record root directory feature, to store build records on an external location, at /some-static-path/${ITEM_FULLNAME}/builds

      So far so good.

      But when we rename a helloWorld job (which has build records) to helloWorld.newname, the rename succeeds, but throws this exception in the browser:

      Exception: failed to rename /some-static-path/helloWorld/builds to /some-static-path/helloWorld.newname/builds
      Stacktrace:
      java.io.IOException: failed to rename /some-static-path/helloWorld/builds to /some-static-path/helloWorld.newname/builds
      at hudson.model.Job.renameTo(Job.java:579)
      at hudson.model.Job.doDoRename(Job.java:1294)
      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.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288)
      at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:29)
      at org.kohsuke.stapler.Function$InterceptedFunction.invoke(Function.java:389)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:151)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:90)
      at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111)

      It seems the main issue here is that the 'new' external location directory at /some-static-path/helloWorld.newname/builds does not yet exist. Is it possible to do a 'mkdir -p' to create this directory, before doing the renameTo?

          [JENKINS-19764] Jenkins with custom build record root dir: renaming a job should create the new build record dir if it does not already exist

          Steve Roth created issue -
          Steve Roth made changes -
          Summary Original: Jenkins with custom build record root dir: renaming a job should rename the build record dir New: Jenkins with custom build record root dir: renaming a job should create the new build record dir if it does not already exist
          Daniel Beck made changes -
          Link New: This issue is related to JENKINS-17138 [ JENKINS-17138 ]
          Daniel Beck made changes -
          Assignee New: Daniel Beck [ danielbeck ]
          Daniel Beck made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Daniel Beck made changes -
          Remote Link New: This issue links to "PR 1377 (Web Link)" [ 11304 ]
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 151283 ] New: JNJira + In-Review [ 193856 ]
          Tadeusz Kosciuszko made changes -
          Link New: This issue is related to JENKINS-48188 [ JENKINS-48188 ]

            danielbeck Daniel Beck
            sroth Steve Roth
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: