Status: Resolved (View Workflow)
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.
- is related to
JENKINS-60785 corrupt workspaces.txt file on agent, changes multibranch builds to use workspace directory with slash converted to %2F, causing errors
- relates to
JENKINS-21942 Unreliable defaulting of Jenkins.workspaceDir
JENKINS-44360 '%' in branch name causes GitHub multi-branch job failures
JENKINS-54640 Workspace folders are not unique
JENKINS-2111 removing a job (including multibranch/org folder branches/repos) does not remove the workspace
- links to
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.
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.
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, thanks for the pointer, created JENKINS-60785
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.