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

corrupt workspaces.txt file on agent, changes multibranch builds to use workspace directory with slash converted to %2F, causing errors


    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • branch-api-plugin
    • linux, multi-branch pipeline build with agents doing the building.
      Jenkins version 2.190.3 Branch API Plugin Version 2.5.5

      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. Agents  aredoing 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 created 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.

      From jglick,

      "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?"

      I've attached the corrupted workspaces.txt file. It looks like it was cut off mid way through writing a branch name.  Perhaps variable overrun, or an uncerimonious shut down created this issue.

            Unassigned Unassigned
            jrichards Jeff Richards
            1 Vote for this issue
            4 Start watching this issue