jenkins & labels getting : pending—master is offline while trying to execute on non-master nodes

社会主义新天地 提交于 2019-12-24 21:04:54

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!