-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot get EC2 user data after enabled IMDSv2 #498
Comments
it was introduced a year ago in: which version of scylla AMI you are using ? |
5.2.10 @fruch |
Will it be backport to any 5.2 version? |
I am encountering this on 5.4.0 scylla AMI as well, on both the scylla_post_start and scylla-image-setup services |
I presume it's because the fetched token wasn't used in scylla-machine-image/lib/scylla_cloud.py Line 819 in 26b93d5
scylla-machine-image/lib/scylla_cloud.py Line 821 in 26b93d5
This bug was likely only noticed recently as EC2 defaults to IMDSv2-only since November 2023 https://aws.amazon.com/blogs/aws/amazon-ec2-instance-metadata-service-imdsv2-by-default/ |
We should consider setting the v2 usage in the AMI once this issue is fixed https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html |
Thanks for spotting it out, seems you are correct, and some calls were missed |
scylladb/seastar#1051 (and we have some others, that are not completely IMDSv2 friendly) |
exactly why I've suggested enabling in the AMI, to flush all those out. |
Will this issue get fixed any time soon? |
@syuu1228 ping |
user_data() is mistakenly unsupported IMDSv2, since it's not using __instance_metadata(). Fixed the code to use __instance_metadata(). Fixes scylladb#498
user_data() is mistakenly unsupported IMDSv2, since it's not using __instance_metadata(). Fixed the code to use __instance_metadata(). Fixes scylladb#498
user_data() is mistakenly unsupported IMDSv2, since it's not using __instance_metadata(). Fixed the code to use __instance_metadata(). Also, while testing this code, scylla_configure.py causes "binascii.Error: Incorrect padding" on base64.b64decode(post_configuration_script). It seems because running b64decode() on already decoded string, so dropped the line and just use post_configuration_script directly. Fixes scylladb#498
user_data() is mistakenly unsupported IMDSv2, since it's not using __instance_metadata(). Fixed the code to use __instance_metadata(). Fixes scylladb#498
user_data() is mistakenly unsupported IMDSv2, since it's not using __instance_metadata(). Fixed the code to use __instance_metadata(). Fixes #498
@vincentwenatsa once this fix is promoted. we will backport to 5.4 and 5.2, it will be part of next release |
On scylladb#498, status of scylla-image-post-start.service is NOT "failed" even the script causing error, because scylla_post_start.py catches all exceptions and just logging it, so the script finishes without error. To getting notify users the script failed operation during running, we should sys.exit(1) when the exception catched. fixes scylladb#505
On scylladb#498, status of scylla-image-post-start.service is NOT "failed" even the script causing error, because scylla_post_start.py catches all exceptions and just logging it, so the script finishes without error. To getting notify users the script failed operation during running, we should sys.exit(1) when the exception catched. fixes scylladb#505
On scylladb#498, status of scylla-image-post-start.service is NOT "failed" even the script causing error, because scylla_post_start.py catches all exceptions and just logging it, so the script finishes without error. To getting notify users the script failed operation during running, we should sys.exit(1) when the exception catched. fixes scylladb#505 Signed-off-by: Takuya ASADA <[email protected]>
On #498, status of scylla-image-post-start.service is NOT "failed" even the script causing error, because scylla_post_start.py catches all exceptions and just logging it, so the script finishes without error. To getting notify users the script failed operation during running, we should sys.exit(1) when the exception catched. fixes #505
perftune's __check_host_type method uses IMDSv1 for retrieving instance metadata. It turns out that - as described in scylladb/scylladb#10490 - Ec2 instances may have only IMDSv2 HTTP calls allowed. When requests to IMDSv1 fail, calling is_aws_i3_non_metal_instance() will evaluate to False, which means that i3.nonmetal instance types will get tuned as if they weren't i3 instances. To fix the problem, import IMDSv2 implementation from scylla-machine-image. Fixes scylladb#1051 related scylladb/scylla-machine-image#498 related scylladb/scylladb#10490
perftune's __check_host_type method uses IMDSv1 for retrieving instance metadata. It turns out that - as described in scylladb/scylladb#10490 - Ec2 instances may have only IMDSv2 HTTP calls allowed. When requests to IMDSv1 fail, calling is_aws_i3_non_metal_instance() will evaluate to False, which means that i3.nonmetal instance types will get tuned as if they weren't i3 instances. To fix the problem, import IMDSv2 implementation from scylla-machine-image. Fixes scylladb#1051 related scylladb/scylla-machine-image#498 related scylladb/scylladb#10490
perftune's __check_host_type method uses IMDSv1 for retrieving instance metadata. It turns out that - as described in scylladb/scylladb#10490 - Ec2 instances may have only IMDSv2 HTTP calls allowed. When requests to IMDSv1 fail, calling is_aws_i3_non_metal_instance() will evaluate to False, which means that i3.nonmetal instance types will get tuned as if they weren't i3 instances. To fix the problem, import IMDSv2 implementation from scylla-machine-image. Fixes scylladb#1051 related scylladb/scylla-machine-image#498 related scylladb/scylladb#10490
perftune's __check_host_type method uses IMDSv1 for retrieving instance metadata. It turns out that - as described in scylladb/scylladb#10490 - Ec2 instances may have only IMDSv2 HTTP calls allowed. When requests to IMDSv1 fail, calling is_aws_i3_non_metal_instance() will evaluate to False, which means that i3.nonmetal instance types will get tuned as if they weren't i3 instances. To fix the problem, import IMDSv2 implementation from scylla-machine-image. Fixes scylladb#1051 related scylladb/scylla-machine-image#498 related scylladb/scylladb#10490
perftune's __check_host_type method uses IMDSv1 for retrieving instance metadata. It turns out that - as described in scylladb/scylladb#10490 - Ec2 instances may have only IMDSv2 HTTP calls allowed. When requests to IMDSv1 fail, calling is_aws_i3_non_metal_instance() will evaluate to False, which means that i3.nonmetal instance types will get tuned as if they weren't i3 instances. To fix the problem, import IMDSv2 implementation from scylla-machine-image. Fixes scylladb#1051 related scylladb/scylla-machine-image#498 related scylladb/scylladb#10490
Dec 19 15:38:09 ip-172-19-20-73 scylla_post_start.py[3760]: 2023-12-19 15:38:09,968 - [user_data] - WARNING - Error getting user data: HTTP Error 401: Unauthorized. Will use defaults!
Dec 19 15:38:09 ip-172-19-20-73 scylla_post_start.py[3760]: Error getting user data: HTTP Error 401: Unauthorized. Will use defaults!
the scylla_post_start.py script failed to fetch user data after enabled IMDSv2. It needs to fetch a IMDSv2 token https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
The text was updated successfully, but these errors were encountered: