jenkinsci / jenkinsci/ec2-plugin
[JENKINS-72228] Amazon EC2 Plugin - Cannot save live node config if "Instance Metadata Supported?" (metadataSupported) is checked
- Dominant language
- Java
- Stars
- 292
- Forks
- 709
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 4
Description
Jenkins Amazon EC2 plugin version 1628.v6d7b_fc58b_a_1d "can't save instance config" bug can be reproduced by -
- As noted in "Environment" section above, ensure in Cloud configuration for launching an EC2 node: ensure "Instance Metadata Supported?" is checked (enabled)
- Launch a node
- Edit that node's config, change any setting except "Instance Metadata Supported?", and click "Save"
- Angry Jenkins shows up
- Go back and uncheck "Instance Metadata Supported?" and click "Save" - it will work this time
The logs show a large stack trace, of which this is the pertinent part:
Caused: java.lang.IllegalArgumentException: Failed to convert the metadataSupported parameter of the constructor public hudson.plugins.ec2.EC2OndemandSlave
Effect of the bug: You are unable to change the node configuration after launch, and keep "Instance Metadata Supported?" sub-options enabled at the same time
---
Originally reported by dkhaykin, imported from: Amazon EC2 Plugin - Cannot save live node config if "Instance Metadata Supported?" (metadataSupported) is checked
Raw content of original issue
Jenkins Amazon EC2 plugin version 1628.v6d7b_fc58b_a_1d "can't save instance config" bug can be reproduced by -
- As noted in "Environment" section above, ensure in Cloud configuration for launching an EC2 node: ensure "Instance Metadata Supported?" is checked (enabled)
- Launch a node
- Edit that node's config, change any setting except "Instance Metadata Supported?", and click "Save"
- Angry Jenkins shows up
- Go back and uncheck "Instance Metadata Supported?" and click "Save" - it will work this time
The logs show a large stack trace, of which this is the pertinent part:
Caused: java.lang.IllegalArgumentException: Failed to convert the metadataSupported parameter of the constructor public hudson.plugins.ec2.EC2OndemandSlave
Effect of the bug: You are unable to change the node configuration after launch, and keep "Instance Metadata Supported?" sub-options enabled at the same time
environment
```
Relevant Environemnt:
- OS: Amazon Linux 2
- Jenkins Version: 2.414.3
- Amazon EC2 plugin version: 1628.v6d7b_fc58b_a_1d
Java Version:
- openjdk 11.0.20.1 2023-08-22 LTS
- OpenJDK Runtime Environment Corretto-11.0.20.9.1 (build 11.0.20.1+9-LTS)
- OpenJDK 64-Bit Server VM Corretto-11.0.20.9.1 (build 11.0.20.1+9-LTS, mixed mode)
Cloud configuration (https://your-jenkins-url/manage/cloud/your-cloud/configure) -> AMI section:
- Ensure "Instance Metadata Supported?" is checked (enabled)
```
Contributor guide
Research direction
Start at the EC2OndemandSlave constructor and trace how the metadataSupported parameter is converted when saving a launched node's configuration. Reproduce the issue with Instance Metadata Supported? enabled, then verify that changing another setting saves successfully while the metadata sub-options remain enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, java
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100