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

    XMLWordPrintable

Details

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

    Description

      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?

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: