aws / aws/aws-cdi-sdk

IMDSv2 problem with CDI test programs

Open
#136 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
63
Forks
19
PR merge metrics
No merged PRs in 30d

Description

Instances with IMDSv2 required throw errors with `cdi_test_min` and `cdi_test`, for example:

```
[root@ip-xxx-xxx-xxx-xxx aws-cdi-sdk]# ./build/debug/bin/cdi_test_min_rx --rx AVM --local_ip xxx.xxx.xxx.xxx --dest_port xxxx
[2024-06-07T22:42:12.578728Z] [main:240] Initializing test.
[2024-06-07T22:42:12.586850Z] [ProcessFormattedStatement:308] AWS-SDK: [[ERROR] 2024-06-07 22:42:12.586 EC2MetadataClient [140486344184576] Http request to retrieve credentials failed with error code 401].
[2024-06-07T22:42:12.586895Z] [ProcessFormattedStatement:308] AWS-SDK: [[ERROR] 2024-06-07 22:42:12.586 EC2MetadataClient [140486344184576] Can not retrieve resource from http://169.254.169.254/latest/meta-data/placement/availability-zone-id].
[2024-06-07T22:42:12.586916Z] WARNING: [MetricsGatherer:502] Retrieval of availability-zone-id failed, falling back to availability-zone
[2024-06-07T22:42:12.587552Z] [ProcessFormattedStatement:308] AWS-SDK: [[ERROR] 2024-06-07 22:42:12.587 EC2MetadataClient [140486344184576] Http request to retrieve credentials failed with error code 401].
[2024-06-07T22:42:12.587611Z] [ProcessFormattedStatement:308] AWS-SDK: [[ERROR] 2024-06-07 22:42:12.587 EC2MetadataClient [140486344184576] Can not retrieve resource from http://169.254.169.254/latest/meta-data/placement/availability-zone].
[2024-06-07T22:42:12.588386Z] [ProcessFormattedStatement:308] AWS-SDK: [[ERROR] 2024-06-07 22:42:12.588 EC2MetadataClient [140486344184576] Http request to retrieve credentials failed with error code 401].
[2024-06-07T22:42:12.588407Z] [ProcessFormattedStatement:308] AWS-SDK: [[ERROR] 2024-06-07 22:42:12.588 EC2MetadataClient [140486344184576] Can not retrieve resource from http://169.254.169.254/latest/meta-data/instance-id].
[2024-06-07T22:42:12.729067Z] [ProcessFormattedStatement:308] AWS-SDK: [[ERROR] 2024-06-07 22:42:12.728 AWSJsonClient [140486344184576] HTTP response code: 400Resolved remote host IP address: 52.203.81.111Request ID: c0629436-3def-4073-80de-950ec9a2cb1dException name: ParamValidationErrorError message: Unable to parse ExceptionName: ParamValidationError Message: Parameter validation failed: [Invalid length for parameter AvailabilityZone, value: 0, valid range: 1-128 Invalid length for parameter Ec2InstanceId, value: 0, valid range: 1-128]7 response headers:content-length : 249content-type : application/jsondate : Fri, 07 Jun 2024 22:42:12 GMTx-amz-apigw-id : ZBLuxHzeoAMEIIQ=x-amzn-errortype : ParamValidationErrorx-amzn-requestid : c0629436-3def-4073-80de-950ec9a2cb1dx-amzn-trace-id : Root=1-66638cc4-6179da506f439844656d2c01].
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with cdi_test_min_rx or cdi_test on an instance that requires IMDSv2, using the command shown in the report. Trace the initialization path and MetricsGatherer calls that retrieve availability-zone-id, availability-zone, and instance-id. Done means the test programs initialize without the 401 and empty-parameter errors while IMDSv2 remains required.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, c
Domain
cloud, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.