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

userData field triggers an NPE when not explicitly initialized to "" (empty string)

    XMLWordPrintable

    Details

    • Similar Issues:
    • Sprint:
      Evergreen - Milestone 2
    • Released As:
      ec2-plugin 1.40

      Description

      When configuring an EC2 cloud using CasC, one must explicitly set userData to avoid getting an NPE during provisioning.

      Here is the working yaml

      ---
      jenkins:   clouds:     - amazonEC2:
              cloudName: "ec2"
              instanceCapStr: 20
              zone: "us-east-1"
              useInstanceProfileForCredentials: true
              privateKey: "${PRIVATE_KEY}"
              templates:           - description: "EC2 Agent"
                  ami: "ami-0c6bb742864ffa3f3"
                  labels: "agent"
                  type: "T2Xlarge"
                  remoteFS: "/home/ec2-user"
                  remoteAdmin: "ec2-user"
                  ################            
                  # FIXME: without this, there's an NPE during provisioning
                  userData: "" 
      

      Expected behaviour

      If I do not need any userData, I should just be able to not specify it like above.

      (the workaround being easy and obvious is the reason I put this as low priority).

        Attachments

          Activity

          Hide
          ndeloof Nicolas De Loof added a comment -

          ec2 plugin should trimToEmpty or implement a null check

          Show
          ndeloof Nicolas De Loof added a comment - ec2 plugin should trimToEmpty or implement a null check

            People

            Assignee:
            ndeloof Nicolas De Loof
            Reporter:
            batmat Baptiste Mathus
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: