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

NullPointerException when the "EC2 Key Pair's Private Key" is missing

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • ec2-plugin
    • None
    • ec2-plugin 1.36
      jenkins 2.32.2.1

    Description

      It would be nice to have a better exception message if the ec2 Private Key is missing.

      SEVERE: Timer task hudson.slaves.NodeProvisioner$NodeProvisionerInvoker@7506948a failed
      java.lang.NullPointerException
      	at jenkins.bouncycastle.api.PEMEncodable.decode(PEMEncodable.java:197)
      	at jenkins.bouncycastle.api.PEMEncodable.decode(PEMEncodable.java:133)
      	at hudson.plugins.ec2.EC2PrivateKey.getFingerprint(EC2PrivateKey.java:65)
      	at hudson.plugins.ec2.EC2PrivateKey.find(EC2PrivateKey.java:96)
      	at hudson.plugins.ec2.SlaveTemplate.getKeyPair(SlaveTemplate.java:863)
      	at hudson.plugins.ec2.SlaveTemplate.provisionOndemand(SlaveTemplate.java:450)
      	at hudson.plugins.ec2.SlaveTemplate.provision(SlaveTemplate.java:377)
      	at hudson.plugins.ec2.EC2Cloud.getNewOrExistingAvailableSlave(EC2Cloud.java:530)
      	at hudson.plugins.ec2.EC2Cloud.provision(EC2Cloud.java:547)
      	at hudson.slaves.NodeProvisioner$StandardStrategyImpl.apply(NodeProvisioner.java:701)
      	at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:307)
      	at hudson.slaves.NodeProvisioner.access$000(NodeProvisioner.java:60)
      	at hudson.slaves.NodeProvisioner$NodeProvisionerInvoker.doRun(NodeProvisioner.java:796)
      	at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:50)
      	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:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      
          <hudson.plugins.ec2.EC2Cloud plugin="ec2@1.36">
            <name>ec2-test-cloud</name>
            <useInstanceProfileForCredentials>false</useInstanceProfileForCredentials>
            <credentialsId></credentialsId>
            <privateKey>
              <privateKey>{AQAAABAAAAAQSxxfs5GelmvUlICPrsH5ezTitoOwN25Nc9Jj6X6X7XU=}</privateKey>
            </privateKey>
            <instanceCap>2147483647</instanceCap>
            <templates>
              <hudson.plugins.ec2.SlaveTemplate>
                <ami>test-1</ami>
                <description>test-1</description>
                <zone></zone>
                <securityGroups></securityGroups>
                <remoteFS></remoteFS>
                <type>T1Micro</type>
                <ebsOptimized>false</ebsOptimized>
                <labels></labels>
                <mode>NORMAL</mode>
                <initScript></initScript>
                <tmpDir></tmpDir>
                <userData></userData>
                <numExecutors></numExecutors>
                <remoteAdmin></remoteAdmin>
                <jvmopts></jvmopts>
                <subnetId></subnetId>
                <idleTerminationMinutes>30</idleTerminationMinutes>
                <iamInstanceProfile></iamInstanceProfile>
                <useEphemeralDevices>false</useEphemeralDevices>
                <customDeviceMapping></customDeviceMapping>
                <instanceCap>2147483647</instanceCap>
                <stopOnTerminate>false</stopOnTerminate>
                <usePrivateDnsName>false</usePrivateDnsName>
                <associatePublicIp>false</associatePublicIp>
                <useDedicatedTenancy>false</useDedicatedTenancy>
                <amiType class="hudson.plugins.ec2.UnixData">
                  <rootCommandPrefix></rootCommandPrefix>
                  <sshPort></sshPort>
                </amiType>
                <launchTimeout>2147483647</launchTimeout>
                <connectBySSHProcess>false</connectBySSHProcess>
                <connectUsingPublicIp>false</connectUsingPublicIp>
              </hudson.plugins.ec2.SlaveTemplate>
            </templates>
            <region>ap-south-1</region>
          </hudson.plugins.ec2.EC2Cloud>
      

      Attachments

        Issue Links

          Activity

            Code changed in jenkins
            User: Cyrille Le Clerc
            Path:
            src/main/java/hudson/plugins/ec2/EC2PrivateKey.java
            src/test/java/hudson/plugins/ec2/EC2PrivateKeyTest.java
            http://jenkins-ci.org/commit/ec2-plugin/0fdf52217901a88c0091362299dcb507701239c4
            Log:
            JENKINS-41824 Meaningful exception message if the EC2 KeyPair private key is missing/empty: `IOException("This private key cannot be empty")` instead of `NullPointerException() (#226)

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Cyrille Le Clerc Path: src/main/java/hudson/plugins/ec2/EC2PrivateKey.java src/test/java/hudson/plugins/ec2/EC2PrivateKeyTest.java http://jenkins-ci.org/commit/ec2-plugin/0fdf52217901a88c0091362299dcb507701239c4 Log: JENKINS-41824 Meaningful exception message if the EC2 KeyPair private key is missing/empty: `IOException("This private key cannot be empty")` instead of `NullPointerException() (#226)

            People

              francisu Francis Upton
              cleclerc Cyrille Le Clerc
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: