Jenkins Sh Step hangs while running a pipeline job

I am currently running a Jenkinsfile pipeline that successfully built on the frontend of the application, but with the backend I am having the errors below:

process apparently never started in /var/lib/jenkins/workspace/Dev2_Backend_Pipeline_test-cicd@2@tmp/durable-b193d42e
(running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code -2
Finished: FAILURE

Hello @tomi2077 and welcome to this community :wave:

As the error suggests, you can temporarily enable launch diagnostics by adding the -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true option to the Jenkins startup configuration. This might provide additional information about the problem.

You maybe could increase logging, like adding additional logging statements to your Jenkinsfile to capture more detailed information during the build process. This could help identify where the problem is occurring.

Don’t forget to review the system logs. Have a look at the Jenkins system logs and any other relevant logs (build logs, agent logs, …) for any error messages or stack traces that might provide insights into the cause of the failure.