Concurrent builds failing when executing powershell scripts

Here is an example of my current issue:

Jenkins Pipeline executes a powershell script on an AWS RHEL 8.7 build agent.
Build 1 and Build 2 are building in their own workspaces.

  1. As a feature branch is created
  2. Build 1 will execute PowerShell script correctly.
  3. As Build 1 is building, Build 2 begins its build.
  4. Either Build 1 or Build 2 execution of powershell script fails.
  • Function of PS script such as Get-Content no longer works. Cannot find path.
  1. Manually cancel Build 2 Build
  2. Build 1 PowerShell script execution returns to working.

Any idea what the root cause of this issue is?

Do you have a log of the issue and can you share the Jenkinsfile? It would be REALLY hard to guess based on the existing information. One thing to maybe look for is if you are setting a specific workspace instead of letting Jenkins manage the workspace directory. This could cause conflicts with two builds running at the same time.

Are the builds running simultaneously on the same agent? if yes there is a conflict when accessing the agent