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

EC2 Plugin not working when AWS Keys are rotated

    Details

    • Similar Issues:
    • Released As:
      1.44

      Description

       

      When we use EC2 Plugin and specify AWS credentials to use to spin up instances, the plugin doesn't work when the AWS Credentials are rotated.

      It works when we manually go to Manage Jenkins -> Configure System -> Click Save button.

       

      ```

       

      WARNING: SlaveTemplate{ami='ami-067c8970c0b9a2d12', labels='wcs-build-agent-ec2'}. Exception during provisioning

      com.amazonaws.services.ec2.model.AmazonEC2Exception: AWS was not able to validate the provided access credentials (Service: AmazonEC2; Status Code: 401; Error Code: AuthFailure; Request ID: a290fa76-f0fa-48ad-b9e8-2e2d41d5bb37)

      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1695)

      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1350)

      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1101)

      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:758)

      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:732)

      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:714)

      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:674)

      at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:656)

      at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:520)

      at com.amazonaws.services.ec2.AmazonEC2Client.doInvoke(AmazonEC2Client.java:19296)

      at com.amazonaws.services.ec2.AmazonEC2Client.invoke(AmazonEC2Client.java:19263)

      at com.amazonaws.services.ec2.AmazonEC2Client.invoke(AmazonEC2Client.java:19252)

      at com.amazonaws.services.ec2.AmazonEC2Client.executeDescribeInstances(AmazonEC2Client.java:9457)

      at com.amazonaws.services.ec2.AmazonEC2Client.describeInstances(AmazonEC2Client.java:9429)

      at com.amazonaws.services.ec2.AmazonEC2Client.describeInstances(AmazonEC2Client.java:9469)

      at hudson.plugins.ec2.EC2Cloud.countCurrentEC2Slaves(EC2Cloud.java:383)

      at hudson.plugins.ec2.EC2Cloud.getPossibleNewSlavesCount(EC2Cloud.java:541)

      at hudson.plugins.ec2.EC2Cloud.getNewOrExistingAvailableSlave(EC2Cloud.java:559)

      at hudson.plugins.ec2.EC2Cloud.provision(EC2Cloud.java:594)

      at hudson.slaves.NodeProvisioner$StandardStrategyImpl.apply(NodeProvisioner.java:715)

      at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:320)

      at hudson.slaves.NodeProvisioner.access$000(NodeProvisioner.java:62)

      at hudson.slaves.NodeProvisioner$NodeProvisionerInvoker.doRun(NodeProvisioner.java:809)

      at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:72)

      at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)

      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)

      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)

      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)

      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

      at java.lang.Thread.run(Thread.java:748)
      ```

        Attachments

          Activity

          Hide
          raihaan Raihaan Shouhell added a comment -

          A fix for this was released in 1.44

          Show
          raihaan Raihaan Shouhell added a comment - A fix for this was released in 1.44
          Hide
          arun6445 Arun Gupta added a comment -

          We are using Jenkins 2.164.1 and this doesn't work in this version.

          Show
          arun6445 Arun Gupta added a comment - We are using Jenkins 2.164.1 and this doesn't work in this version.
          Hide
          raihaan Raihaan Shouhell added a comment -

          Arun Gupta you mean 1.44 does not solve your issue?

          Show
          raihaan Raihaan Shouhell added a comment - Arun Gupta you mean 1.44 does not solve your issue?
          Hide
          arun6445 Arun Gupta added a comment -

          Sorry, we will test it with latest version 1.44 of EC2 Plugin and get back.

          Show
          arun6445 Arun Gupta added a comment - Sorry, we will test it with latest version 1.44 of EC2 Plugin and get back.
          Hide
          raihaan Raihaan Shouhell added a comment -

          Arun Gupta Has it worked out for you?

          Show
          raihaan Raihaan Shouhell added a comment - Arun Gupta Has it worked out for you?
          Hide
          arun6445 Arun Gupta added a comment -

          Hi, yes the issue is resolved in the 1.44 version of the EC2 Plugin. Happy to get the ticket closed.

          Show
          arun6445 Arun Gupta added a comment - Hi, yes the issue is resolved in the 1.44 version of the EC2 Plugin. Happy to get the ticket closed.

            People

            • Assignee:
              thoulen FABRIZIO MANFREDI
              Reporter:
              arun6445 Arun Gupta
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: