问题
I have a Jenkins instance where I am not able to use labels, builds are triggered but get stuck at "pending—master is offline". I have disabled the master (executor # : 0) as I do not wish to use it.
Instead I would expect the build to go to the next available node with the label mentioned in the pipeline.
node("mylabel"){
echo " jenkins pipeline for mylabel nodes"
}
This works in a clean install of jenkins so I can only assume this is a configuration/compatibility issue on my master instance.
Could it be a permission issue?
more info about my master instance :
- I have used in the past the nodeLabel (with freestyle jobs) and have removed it (and removed all extra instructions in my jobs once removed via the management view).
- I am using the Role-based Authorization Strategy and have defined roles for each projects in jenkins.
- Note that I am behind a firewall (no internet access during execution) using Jenkins 2.73.2
EDIT 1: another syntax - same issue observed.
pipeline {
agent{
label "mylabel"
echo " jenkins pipeline for mylabel node"
}
}
回答1:
I found the issue occurred because I am not able to bypass the master node using the above pipeline. I understand that before the label selection there is a need for a default node to be available to run instructions.
来源:https://stackoverflow.com/questions/46833618/jenkins-labels-getting-pending-master-is-offline-while-trying-to-execute-on