Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-11889

Suspended agents do not start accepting tasks when policy changed

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • 2.439

      If SimpleScheduledRetentionStrategy is used, the agent is regularly put to suspended state with setAcceptingTasks(false) according to schedule. If the policy is changed while the agent is suspended, suspended flag retain intact and the agent can't be used.

          [JENKINS-11889] Suspended agents do not start accepting tasks when policy changed

          I could fix it through groovy console by manually calling setAcceptingTasks(true). Sorry, don't remember exact command

          Vitalii Tymchyshyn added a comment - I could fix it through groovy console by manually calling setAcceptingTasks(true). Sorry, don't remember exact command

          Thomas Fürer added a comment -

          same issue here

          Thomas Fürer added a comment - same issue here

          Calin Marina added a comment - - edited

          hi ... I had the same problem and Vitalii's hint was very usefull ... I needed a bit through the javadoc to get the proper command though

          here it is in case other people need it:

          hudson.model.Hudson.instance.slaves.getNode("cloud_selenium2").toComputer().setAcceptingTasks(true)

          Calin Marina added a comment - - edited hi ... I had the same problem and Vitalii's hint was very usefull ... I needed a bit through the javadoc to get the proper command though here it is in case other people need it: hudson.model.Hudson.instance.slaves.getNode( "cloud_selenium2" ).toComputer().setAcceptingTasks( true )

          I saw this with version 1.551.

          Thomas Van Doren added a comment - I saw this with version 1.551.

          Andrew Barber added a comment - - edited

          It's 2016 and I still see this bug in 1.643. Groovy console command slightly changed

          ○ Jenkins.instance.getNode("node-name").toComputer().setAcceptingTasks(true)

          It's a shame that this type of issue has been sitting here so long.

          Andrew Barber added a comment - - edited It's 2016 and I still see this bug in 1.643. Groovy console command slightly changed ○ Jenkins.instance.getNode("node-name").toComputer().setAcceptingTasks(true) It's a shame that this type of issue has been sitting here so long.

          I see this issue on 1.651.1 LTS

          Christoph Vogtländer added a comment - I see this issue on 1.651.1 LTS

          Wilco Belgraver Thissen added a comment - - edited

          I believe I have this same issue with 2.9. Agent that goes down every night to avoid interference with the backup system. A few weeks ago on one of the last 1.6?? versions it started with now and then happening. I was hoping the upgrade would resolve it but it seems Friday evening it triggered again causing all our weekend builds not to run.

          Now working on a workaround by unsuspending it regularly with something like this:
          curl --user "Username:password" -d "script=Jenkins.instance.getNode('Node-Name').toComputer().setAcceptingTasks(true);" jenkinsurl/scriptText

          Wilco Belgraver Thissen added a comment - - edited I believe I have this same issue with 2.9. Agent that goes down every night to avoid interference with the backup system. A few weeks ago on one of the last 1.6?? versions it started with now and then happening. I was hoping the upgrade would resolve it but it seems Friday evening it triggered again causing all our weekend builds not to run. Now working on a workaround by unsuspending it regularly with something like this: curl --user "Username:password" -d "script=Jenkins.instance.getNode('Node-Name').toComputer().setAcceptingTasks(true);" jenkinsurl/scriptText

          Petr Barton added a comment - - edited

          This issue is also in Jenkins ver. 2.32.1 LTS

          Petr Barton added a comment - - edited This issue is also in Jenkins ver. 2.32.1 LTS

          Thanks, Andrew. Your console command fixed it for me. Bug still unfixed in 2.46.1 LTS.

          Aaron D. Marasco added a comment - Thanks, Andrew. Your console command fixed it for me. Bug still unfixed in 2.46.1 LTS.

          happening for me on 

          Jenkins ver. 2.73.2

          Um, How do I run a console command? (It's a rhetorical question, I'll go look it up.)

          John Muczynski added a comment - happening for me on  Jenkins ver. 2.73.2 Um, How do I run a console command? (It's a rhetorical question, I'll go look it up.)

            mawinter69 Markus Winter
            tivv Vitalii Tymchyshyn
            Votes:
            11 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved: