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

A recent update breaks builds by escaping slashes to percent signs in workspace paths

    XMLWordPrintable

Details

    • 2.1.2

    Description

      After a recent update, slashes in git branches (e.g. bugfix/branch-description) are escaped into workspace path names using %2F, as in wkspacepath/bugfix%2Fbranch-description. This breaks the build on my windows machine. The slashes used to be translated to underscores.

      Attachments

        Issue Links

          Activity

            Deat Community,

            I'm facing the same problem with my multibranch pipeline project: "feature/branch" from a git repository is transformed to "feature%2Fbranch" which causes build to fail because the build process cannot find the files. As mentionned above, I did an update of Jenkins and the branch API plugin but the problem is still remaining.

             

            I'm working with:

            Jenkins version 2.190.3

            Branch API Plugin Version 2.5.5

            I saw tat PR#137 should solve the problem. Is this PR already merged, i.e. available in the latest release of Jenkins Branch API Plugin available? If yes, I think that the issue is still active and not resolved.

            Any update about this issue?

            Find also attached to this message two screenshot conerning the issue: the Branch name on git and the result on the Jenkins Workspace.

             

            phkoc Philippe Kocher added a comment - Deat Community, I'm facing the same problem with my multibranch pipeline project: "feature/branch" from a git repository is transformed to "feature%2Fbranch" which causes build to fail because the build process cannot find the files. As mentionned above, I did an update of Jenkins and the branch API plugin but the problem is still remaining.   I'm working with: Jenkins version 2.190.3 Branch API Plugin Version 2.5.5 I saw tat PR#137 should solve the problem. Is this PR already merged, i.e. available in the latest release of Jenkins Branch API Plugin available? If yes, I think that the issue is still active and not resolved. Any update about this issue? Find also attached to this message two screenshot conerning the issue: the Branch name on git and the result on the Jenkins Workspace.  
            jhuels Josh Huels added a comment -

            Also seeing the same issue as Philippe Kocher.  This is occurring on a Jenkins Agent running multi-branch pipelines.

             

             
            Jenkins ver. 2.190.2

             Branch API Plugin 2.1.2

             

            From reading all of these other tickets, the steps to debug only relate to running builds from master.  This is occurring for me from agents.

            On the agent, `println jenkins.branch.WorkspaceLocatorImpl.PATH_MAX` returns 80.

            `println jenkins.branch.WorkspaceLocatorImpl.MODE` returns MULTIBRANCH_ONLY.

             

            jhuels Josh Huels added a comment - Also seeing the same issue as Philippe Kocher.  This is occurring on a Jenkins Agent running multi-branch pipelines.     Jenkins ver. 2.190.2  Branch API Plugin 2.1.2   From reading all of these other tickets, the steps to debug only relate to running builds from master.  This is occurring for me from agents. On the agent, `println jenkins.branch.WorkspaceLocatorImpl.PATH_MAX` returns 80. `println jenkins.branch.WorkspaceLocatorImpl.MODE` returns MULTIBRANCH_ONLY.  
            jrichards Jeff Richards added a comment -

            I also had this problem.  

            In my case, I was running jenkins in a linux environment, Jenkins version 2.190.3 Branch API Plugin Version 2.5.5.  This is a multibranch pipeline buidl environment with agents doing the building. In my case interestingly this was only happening on 1 of three nodes (it took me hours to figure THAT out).

            After much searching what I found was that when I reviewed the node log for the failing node (Manage Jenkins -> Manage Nodes -> click on node in question -> Log, I found that the /home/jenkins/workspace/workspace.txt file was noted as being corrupt.  For whatever reason this meant that when the build was attempted on that node, the build directory was not the usual workspace directory (which has all branch name slashes (encoded as %2F) cases  replaced with underscores).

            In my case, I just creaed a new workspace.txt file and then disconnected and reconnected the node.  And... things started working again.

            So, if you're experiencing this, review the node logs.  

            As a suggestion for improving jenkins, I would suggest that if the workspaces.txt file is corrupt, the node should be taken offline.  At least then the admin has a clue that this is a node based issue, and that the node needs manual intervention for things to get back to normal.

             

            jrichards Jeff Richards added a comment - I also had this problem.   In my case, I was running jenkins in a linux environment, Jenkins version 2.190.3 Branch API Plugin Version 2.5.5.  This is a multibranch pipeline buidl environment with agents doing the building. In my case interestingly this was only happening on 1 of three nodes (it took me hours to figure THAT out). After much searching what I found was that when I reviewed the node log for the failing node (Manage Jenkins -> Manage Nodes -> click on node in question -> Log, I found that the /home/jenkins/workspace/workspace.txt file was noted as being corrupt.  For whatever reason this meant that when the build was attempted on that node, the build directory was not the usual workspace directory (which has all branch name slashes (encoded as %2F) cases  replaced with underscores). In my case, I just creaed a new workspace.txt file and then disconnected and reconnected the node.  And... things started working again. So, if you're experiencing this, review the node logs.   As a suggestion for improving jenkins, I would suggest that if the workspaces.txt file is corrupt, the node should be taken offline.  At least then the admin has a clue that this is a node based issue, and that the node needs manual intervention for things to get back to normal.  
            jglick Jesse Glick added a comment -

            I would suggest that if the workspaces.txt file is corrupt, the node should be taken offline.

            Better to file this as an Enhancement with label robustness in this component and Link to this issue.

            Of course better would be to automatically correct a corrupted file, and better still would be to figure out what corrupted it to begin with. What did the supposedly corrupt file contain? Any known steps to reproduce? Etc.

            jglick Jesse Glick added a comment - I would suggest that if the workspaces.txt file is corrupt, the node should be taken offline. Better to file this as an Enhancement with label robustness in this component and Link to this issue. Of course better would be to automatically correct a corrupted file, and better still would be to figure out what corrupted it to begin with. What did the supposedly corrupt file contain? Any known steps to reproduce? Etc.
            jrichards Jeff Richards added a comment -

            jglick, thanks for the pointer, created JENKINS-60785

            jrichards Jeff Richards added a comment - jglick , thanks for the pointer, created  JENKINS-60785

            People

              jglick Jesse Glick
              godskalk Øyvind R
              Votes:
              2 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: