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
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • 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

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

            People

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

              Dates

                Created:
                Updated:
                Resolved: