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

Workspace directory names mangled in multibranch pipeline

    XMLWordPrintable

Details

    Description

      Apparently after a recent update of plugins, our Multibranch Pipeline jobs started putting their workspaces in mangled locations. They used to be, for example, in D:\jenkins\cm-jenkins-09\my-pipline-job\my-branch-name and now they're like D:\jenkins\cm-jenkins-09\ine-job_my-banch-name-5P5URKHPJXWGGVIWDQOJBB3N7RJECAQJGFTDCVOPY3PABO7LNTIQ

      There are several problems with this:

      1. They're difficult to read with all that garbage at the end, and the beginning of the name sometimes cut off
      2. They're not organized within the parent job like they used to be
      3. This is causing files within them to have extremely long paths such that Windows won't actually let us delete them (Jenkins, CMD, and Windows Explorer all fail to delete them)

      Let me know if I can provide any other information to help solve this. This is a private Jenkins install so I can't point you to it.

      Attachments

        Issue Links

          Activity

            kpop kpop added a comment -

            godskalk, I agree: less is certainly better, but name clashes should be avoided.

            kpop kpop added a comment - godskalk , I agree: less is certainly better, but name clashes should be avoided.
            sdbates sascha bates added a comment -

            My workaround for this was to define a jobName and then use the jobName in the workspace. The jobName var was also to account for feature branches and builds around several different microservices that might also have the same Jira id attached to them.

            Our feature branch work is all short lived and named feature/jira-12345-some-description. Our services are named my-service-name. The below lines result in a 'my-service-name-jira-12345' workspace name. 99% of the time we don't need to look at workspaces anyway, but this makes the console log readable as well as making it possible to write directory cleanup patterns based on naming.
             
             
             
            def jobName = JOB_NAME.replaceAll(/\/\w+%2F/,'-').toLowerCase()
            ansiColor( 'xterm' ) {
              timestamps {try {node() {
                ws( "workspace/${jobName}" ) {
                  stage( 'Pull Github Repository' ) {
             

            sdbates sascha bates added a comment - My workaround for this was to define a jobName and then use the jobName in the workspace. The jobName var was also to account for feature branches and builds around several different microservices that might also have the same Jira id attached to them. Our feature branch work is all short lived and named feature/jira-12345-some-description. Our services are named my-service-name. The below lines result in a 'my-service-name-jira-12345' workspace name. 99% of the time we don't need to look at workspaces anyway, but this makes the console log readable as well as making it possible to write directory cleanup patterns based on naming.       def jobName = JOB_NAME.replaceAll(/\/\w+%2F/,'-').toLowerCase() ansiColor( 'xterm' ) {   timestamps { try { node() {     ws( "workspace/${jobName}" ) {       stage( 'Pull Github Repository' ) {  
            jglick Jesse Glick added a comment -

            This issue became obsolete with the release of the fix of JENKINS-2111.

            jglick Jesse Glick added a comment - This issue became obsolete with the release of the fix of JENKINS-2111 .
            suemiao Suemiao Rossignol added a comment - - edited

            I am using Jenkins 2.150.2 version but still  hitting this issue?

            I also install short workspace plugins without any luck.

            Is this truly fixed?

            suemiao Suemiao Rossignol added a comment - - edited I am using Jenkins 2.150.2 version but still  hitting this issue? I also install short workspace plugins without any luck. Is this truly fixed?
            jglick Jesse Glick added a comment -

            suemiao please do not reopen. If necessary, file a separate (but linked) bug report with complete steps to reproduce from scratch as well as FINE logs from jenkins.branch.WorkspaceLocatorImpl.

            jglick Jesse Glick added a comment - suemiao please do not reopen. If necessary, file a separate (but linked) bug report with complete steps to reproduce from scratch as well as FINE logs from jenkins.branch.WorkspaceLocatorImpl .

            People

              Unassigned Unassigned
              tyrelh Tyrel Haveman
              Votes:
              76 Vote for this issue
              Watchers:
              102 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: