-
Notifications
You must be signed in to change notification settings - Fork 17
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
ucd-aws fails on hosts with no public key #55
Comments
+1 ^^ This is happening to me as well. The latest "best-practice" in AWS is to avoid SSH keys altogether, and instead simply assign an SSM Management role to the IAM Role of your EC2, and then access it through SSM Agent. At minimum, this "requirement" of a public key should be documented, if not amended/fixed/patched. For what it's worth, I lost 4 solid days of work and troubleshooting time, attempting to understand what the issue was. |
This will take some more thoughtful refactoring. It appears the meta-data API is returning HTTP 404 when SSH keys aren't configured. As this is technically an error code, and most likely the same one you'd get if we had a typo in the URI, we need to think more carefully about which errors should be fatal, instead of making a quick fix. |
Great point! Have you had a chance to consider? |
From the recent issues posted and discussed, it's clear we may want to consider rewriting the fetcher tool (a significant undertaking). That's not something we are going to do without having any idea whether it helps just a few people who may be off using alternative methods (e.g. creating custom images instead using other tools), or it's going to benefit e.g. hundreds of people. We have a lack of data to make this discussion easier right now. We also need to look at SSM's APIs as well. |
The consideration is much appreciated. I've stopped relying on I also installed and set up I worry that you might not catch or find signal/data on how many people this might benefit (or how many people this is a "pain" for). That's because most operators who prospect or attempt to run a "new" distro/AMI in AWS - and run into problems like these - will simply revert back to something like AL2, Ubuntu, or a RHEL variant, without ever reporting it. There are many, many aspects of ClearLinux which make it an excellent OS, but things like this are a deal-breaker/non-starter for a broad base of the decision-makers and builders that would be adopters and users of ClearLinux specifically in the Cloud segment, as a host OS (not as a container base OS). Just some suggestionsI'd recommend at least documenting this caveat somewhere in the ClearLinux docs, so that others - like me and @gmarkey - don't end up losing time and sleep when trying to figure out the issue. The caveat essentially being that you must configure your EC2 with an explicit SSH key, otherwise UserData breaks in AWS. And I'd also maybe suggest that - while you wait for data to make your decision and contemplate whether the effort is worth it - that maybe some more explicit/obvious logging is added to |
Hi, Just wanted to let you guys know, I spend 3 to 4 days just debugging this issue, and gave up. Thanks |
On EC2 instances without a public key,
ucd-data-fetch aws
outputsparse_headers(): Success
and exits with RC=1. Looking at the output of strace, it appears that it considers the missing key to be fatal and doesn't query other metadata or userdata endpoints.The way that the SSH user is added is also haphazard; it tried to concatenate this baked-in section of configuration with whatever it finds in userdata, making it impossible to use standard bash scripts rather than cloudinit format.
The text was updated successfully, but these errors were encountered: