- 1 year ago
Jenkins with "agent none" on pipeline stage fails
If you're using the agent none
directive in a Jenkins pipeline stage and the stage is failing, there are a few things you can check to troubleshoot the issue:
Verify that your Jenkins installation has enough executor slots available. If you've set the
agent none
directive, it means that the stage won't run on any of the Jenkins agents, and will instead run on the Jenkins master itself. This means that you need to have enough executor slots available on the master for the stage to run. You can check the number of executor slots available in the Jenkins master by going to Manage Jenkins > Manage Nodes and Clouds and looking at the Executors column.Check the logs for any error messages that might indicate why the stage is failing. When you run a pipeline stage with
agent none
, any errors that occur during the stage will be logged to the Jenkins console output. Make sure to check the console output for any error messages that might help you identify the problem.Check that any dependencies or tools required by the stage are installed on the Jenkins master. When you use
agent none
, the stage will run on the Jenkins master, which means that any dependencies or tools required by the stage need to be installed on the master. Make sure that any necessary software is installed and configured correctly.Try running the stage with a different
agent
directive to see if it works. If you're having trouble getting the stage to work withagent none
, try running the stage with a differentagent
directive, such asagent any
oragent label
. This can help you narrow down whether the problem is with the stage itself, or with theagent none
directive.
By following these troubleshooting steps, you should be able to identify and resolve any issues that are preventing your Jenkins pipeline stage from running with agent none
.