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

Provisioning Windows agent being terminated when started after stopped from idle time

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • ec2-plugin

      I'm having an issue with provisioning windows machines.

      When provisioning for the first time, the plugin works great and after some time, the windows agent is set and running.

      After the idle timeout is due, the machine is set to disconnect/stop (not terminate) - After triggering a new job, this same instance is started, it appears as started in my AWS console, but right after, it is shut down and then a new instance gets created from scratch...

      Can someone help me? Is this a known issue?

      Below are the logs:

       

      Before a timeout occurs:

      set 28 22:36:54 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:36:54.715+0000 [id=11258]        INFO        hudson.plugins.ec2.EC2Cloud$2#call: Attempt 0: SlaveTemplate{description='Jenkins Windows AMI', labels='windows'}. Node EC2 (TestJenkins) - Jenkins Windows AMI (i-09765e59ebafbd653) is neither pending, neither running, it's stopped. Will try again after 5s
      set 28 22:36:57 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:36:57.097+0000 [id=11249]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: Found invalid crumb 0b4db3b11ca542a77b0b2e7240c9bb4ff31035459cd582c5e90061c28d55bad7. If you are calling this URL with a script, please use the API Token instead. More information: https://www.jenkins.io/redirect/crumb-cannot-be-used-for-script
      set 28 22:36:57 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:36:57.097+0000 [id=11249]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: No valid crumb was included in request for /ajaxBuildQueue by exactlylabs@okdinosaur.gg. Returning 403.
      set 28 22:36:57 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:36:57.309+0000 [id=11253]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: Found invalid crumb 0b4db3b11ca542a77b0b2e7240c9bb4ff31035459cd582c5e90061c28d55bad7. If you are calling this URL with a script, please use the API Token instead. More information: https://www.jenkins.io/redirect/crumb-cannot-be-used-for-script
      set 28 22:36:57 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:36:57.309+0000 [id=11253]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: No valid crumb was included in request for /ajaxExecutors by exactlylabs@okdinosaur.gg. Returning 403.
      set 28 22:37:02 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:02.101+0000 [id=11254]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: Found invalid crumb 0b4db3b11ca542a77b0b2e7240c9bb4ff31035459cd582c5e90061c28d55bad7. If you are calling this URL with a script, please use the API Token instead. More information: https://www.jenkins.io/redirect/crumb-cannot-be-used-for-script
      set 28 22:37:02 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:02.101+0000 [id=11254]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: No valid crumb was included in request for /ajaxBuildQueue by exactlylabs@okdinosaur.gg. Returning 403.
      set 28 22:37:02 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:02.313+0000 [id=11254]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: Found invalid crumb 0b4db3b11ca542a77b0b2e7240c9bb4ff31035459cd582c5e90061c28d55bad7. If you are calling this URL with a script, please use the API Token instead. More information: https://www.jenkins.io/redirect/crumb-cannot-be-used-for-script
      set 28 22:37:02 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:02.313+0000 [id=11254]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: No valid crumb was included in request for /ajaxExecutors by exactlylabs@okdinosaur.gg. Returning 403.
      set 28 22:37:07 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:07.098+0000 [id=11215]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: Found invalid crumb 0b4db3b11ca542a77b0b2e7240c9bb4ff31035459cd582c5e90061c28d55bad7. If you are calling this URL with a script, please use the API Token instead. More information: https://www.jenkins.io/redirect/crumb-cannot-be-used-for-script
      set 28 22:37:07 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:07.098+0000 [id=11215]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: No valid crumb was included in request for /ajaxBuildQueue by exactlylabs@okdinosaur.gg. Returning 403.
      set 28 22:37:07 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:07.313+0000 [id=11254]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: Found invalid crumb 0b4db3b11ca542a77b0b2e7240c9bb4ff31035459cd582c5e90061c28d55bad7. If you are calling this URL with a script, please use the API Token instead. More information: https://www.jenkins.io/redirect/crumb-cannot-be-used-for-script
      set 28 22:37:07 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:07.313+0000 [id=11254]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: No valid crumb was included in request for /ajaxExecutors by exactlylabs@okdinosaur.gg. Returning 403.
      set 28 22:37:12 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:12.098+0000 [id=10799]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: Found invalid crumb 0b4db3b11ca542a77b0b2e7240c9bb4ff31035459cd582c5e90061c28d55bad7. If you are calling this URL with a script, please use the API Token instead. More information: https://www.jenkins.io/redirect/crumb-cannot-be-used-for-script
      set 28 22:37:12 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:12.098+0000 [id=10799]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: No valid crumb was included in request for /ajaxBuildQueue by exactlylabs@okdinosaur.gg. Returning 403.
      set 28 22:37:12 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:12.313+0000 [id=10799]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: Found invalid crumb 0b4db3b11ca542a77b0b2e7240c9bb4ff31035459cd582c5e90061c28d55bad7. If you are calling this URL with a script, please use the API Token instead. More information: https://www.jenkins.io/redirect/crumb-cannot-be-used-for-script
      set 28 22:37:12 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:12.313+0000 [id=10799]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: No valid crumb was included in request for /ajaxExecutors by exactlylabs@okdinosaur.gg. Returning 403.
      set 28 22:37:14 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:14.930+0000 [id=11258]        INFO        hudson.plugins.ec2.EC2Cloud$2#call: SlaveTemplate{description='Jenkins Windows AMI', labels='windows'} Node EC2 (TestJenkins) - Jenkins Windows AMI (i-09765e59ebafbd653) moved to RUNNING state in 20 seconds and is ready to be connected by Jenkins
      set 28 22:37:17 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:17.100+0000 [id=11246]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: Found invalid crumb 0b4db3b11ca542a77b0b2e7240c9bb4ff31035459cd582c5e90061c28d55bad7. If you are calling this URL with a script, please use the API Token instead. More information: https://www.jenkins.io/redirect/crumb-cannot-be-used-for-script
      set 28 22:37:17 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:17.101+0000 [id=11246]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: No valid crumb was included in request for /ajaxBuildQueue by exactlylabs@okdinosaur.gg. Returning 403.
      set 28 22:37:17 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:17.315+0000 [id=10660]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: Found invalid crumb 0b4db3b11ca542a77b0b2e7240c9bb4ff31035459cd582c5e90061c28d55bad7. If you are calling this URL with a script, please use the API Token instead. More information: https://www.jenkins.io/redirect/crumb-cannot-be-used-for-script
      set 28 22:37:17 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:17.315+0000 [id=10660]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: No valid crumb was included in request for /ajaxExecutors by exactlylabs@okdinosaur.gg. Returning 403. 

      Then there's an exception, it says that provisioned successfully, but right after it terminates it:

       

      
      c2.win.WinConnection#pingFailingIfSSHHandShakeError: Failed to verify connectivity to Windows agent
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]: java.net.SocketTimeoutException: connect timed out
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at java.base/java.net.Socket.connect(Socket.java:609)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at com.hierynomus.protocol.commons.socket.ProxySocketFactory.createSocket(ProxySocketFactory.java:87)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at com.hierynomus.protocol.commons.socket.ProxySocketFactory.createSocket(ProxySocketFactory.java:63)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at com.hierynomus.smbj.transport.tcp.direct.DirectTcpTransport.connect(DirectTcpTransport.java:88)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at com.hierynomus.smbj.connection.Connection.connect(Connection.java:139)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at com.hierynomus.smbj.SMBClient.getEstablishedOrConnect(SMBClient.java:96)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at com.hierynomus.smbj.SMBClient.connect(SMBClient.java:71)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at hudson.plugins.ec2.win.WinConnection.pingFailingIfSSHHandShakeError(WinConnection.java:135)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at hudson.plugins.ec2.win.EC2WindowsLauncher.connectToWinRM(EC2WindowsLauncher.java:190)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at hudson.plugins.ec2.win.EC2WindowsLauncher.launchScript(EC2WindowsLauncher.java:52)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:48)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:298)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:48)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:82)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      set 28 22:37:20 ip-10-0-0-50 jenkins[27712]:         at java.base/java.lang.Thread.run(Thread.java:829)
      set 28 22:37:22 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:22.098+0000 [id=11246]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: Found invalid crumb 0b4db3b11ca542a77b0b2e7240c9bb4ff31035459cd582c5e90061c28d55bad7. If you are calling this URL with a script, please use the API Token instead. More information: https://www.jenkins.io/redirect/crumb-cannot-be-used-for-script
      set 28 22:37:22 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:22.098+0000 [id=11246]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: No valid crumb was included in request for /ajaxBuildQueue by exactlylabs@okdinosaur.gg. Returning 403.
      set 28 22:37:22 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:22.311+0000 [id=11249]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: Found invalid crumb 0b4db3b11ca542a77b0b2e7240c9bb4ff31035459cd582c5e90061c28d55bad7. If you are calling this URL with a script, please use the API Token instead. More information: https://www.jenkins.io/redirect/crumb-cannot-be-used-for-script
      set 28 22:37:22 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:22.311+0000 [id=11249]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: No valid crumb was included in request for /ajaxExecutors by exactlylabs@okdinosaur.gg. Returning 403.
      set 28 22:37:23 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:23.527+0000 [id=38]        WARNING        hudson.model.AbstractCIBase#updateNewComputer: Node EC2 (TestJenkins) - Jenkins Windows AMI (i-09765e59ebafbd653) is not a new node skipping
      set 28 22:37:23 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:23.530+0000 [id=38]        INFO        hudson.slaves.NodeProvisioner#update: EC2 (TestJenkins) - Jenkins Windows AMI provisioning successfully completed. We have now 3 computer(s)
      set 28 22:37:27 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:27.097+0000 [id=10734]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: Found invalid crumb 0b4db3b11ca542a77b0b2e7240c9bb4ff31035459cd582c5e90061c28d55bad7. If you are calling this URL with a script, please use the API Token instead. More information: https://www.jenkins.io/redirect/crumb-cannot-be-used-for-script
      set 28 22:37:27 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:27.097+0000 [id=10734]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: No valid crumb was included in request for /ajaxBuildQueue by exactlylabs@okdinosaur.gg. Returning 403.
      set 28 22:37:27 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:27.947+0000 [id=11215]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: Found invalid crumb 0b4db3b11ca542a77b0b2e7240c9bb4ff31035459cd582c5e90061c28d55bad7. If you are calling this URL with a script, please use the API Token instead. More information: https://www.jenkins.io/redirect/crumb-cannot-be-used-for-script
      set 28 22:37:27 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:27.947+0000 [id=11215]        WARNING        hudson.security.csrf.CrumbFilter#doFilter: No valid crumb was included in request for /ajaxExecutors by exactlylabs@okdinosaur.gg. Returning 403.
      set 28 22:37:30 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:30.237+0000 [id=11258]        INFO        h.plugins.ec2.EC2OndemandSlave#lambda$terminate$0: Terminated EC2 instance (terminated): i-09765e59ebafbd653
      set 28 22:37:30 ip-10-0-0-50 jenkins[27712]: 2022-09-28 22:37:30.239+0000 [id=11258]        INFO        h.plugins.ec2.EC2OndemandSlave#lambda$terminate$0: Removed EC2 instance from jenkins controller: i-09765e59ebafbd653
      

            thoulen FABRIZIO MANFREDI
            mendes11 Rafael Bachiega
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: