[JIRA] (JENKINS-57357) NullPointerException due to non-backwars compatibility in hudson.plugins.EC2.SlaveTemplate.

6 views
Skip to first unread message

adrien.k.tateno@gmail.com (JIRA)

unread,
May 7, 2019, 12:01:03 PM5/7/19
to jenkinsc...@googlegroups.com
Adrien Tateno created an issue
 
Jenkins / Bug JENKINS-57357
NullPointerException due to non-backwars compatibility in hudson.plugins.EC2.SlaveTemplate.
Issue Type: Bug Bug
Assignee: FABRIZIO MANFREDI
Attachments: image-2019-05-07-10-52-22-920.png
Components: ec2-plugin
Created: 2019-05-07 16:00
Environment: Jenkins 2.172, ec2-plugin master (likely as of 2f348aa519338aac64dd19954b0b41a62a8ea6fc)
Priority: Major Major
Reporter: Adrien Tateno

Upon upgrading the ec2-plugin to master and restarting Jenkins, the EC2 nodes begin to fail connecting with the following exception

 

This is likely due to the recent change that allows configuring the strategy for determining the hostname/IP address of the node https://github.com/jenkinsci/ec2-plugin/pull/329.

https://wiki.jenkins.io/display/JENKINS/Hint+on+retaining+backward+compatibility suggests that it is necessary to define a readResolve() method when deprecating fields (in this case the boolean fields usePrivateDnsName connectUsingPublicIp) because when objects are loaded from XML their constructors are not invoked.

What likely happened here, is that the newly defined connectionStrategy was null when loaded from XML, causing the hostname/IP address determination to fail at instance startup time.

 

Matt Sicker
Daniel Garzon

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

adrien.k.tateno@gmail.com (JIRA)

unread,
May 7, 2019, 12:10:04 PM5/7/19
to jenkinsc...@googlegroups.com

adrien.k.tateno@gmail.com (JIRA)

unread,
May 7, 2019, 12:10:07 PM5/7/19
to jenkinsc...@googlegroups.com
Adrien Tateno updated an issue
Upon upgrading the ec2-plugin to master and restarting Jenkins, the EC2 nodes begin to fail connecting with the following exception

{{  

! image- Screen Shot 2019-05-07 -10-52-22-920 at 9 . 23.19 AM. png |thumbnail ! }}

 

This is likely due to the recent change that allows configuring the strategy for determining the hostname/IP address of the node [https://github.com/jenkinsci/ec2-plugin/pull/329].

[https://wiki.jenkins.io/display/JENKINS/Hint+on+retaining+backward+compatibility] suggests that it is necessary to define a {{readResolve()}} method when deprecating fields (in this case the boolean fields {{usePrivateDnsName connectUsingPublicIp}}) because when objects are loaded from XML their constructors are not invoked.


What likely happened here, is that the newly defined {{connectionStrategy}} was null when loaded from XML, causing the hostname/IP address determination to fail at instance startup time.

 

[~jvz]
[~dgarzon]

adrien.k.tateno@gmail.com (JIRA)

unread,
May 7, 2019, 12:11:01 PM5/7/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages