NixOS AWS | 79 Members | |
| 20 Servers |
| Sender | Message | Time |
|---|---|---|
| 22 Oct 2024 | ||
| To quote the Amazon docs: > The latest versions of the AWS CLI and AWS SDKs support IMDSv2. To use IMDSv2, make sure that your EC2 instances have the latest versions of the CLI and SDKs. | 00:44:06 | |
| It'd be interesting to look at both `aws EC2 run-instances` and nixops in debug mode to see the exact request. But I'm pretty sure it's gonna be the API version parameter that is causing issues | 00:53:28 | |
| * It'd be interesting to look at both `aws EC2 run-instances` and nixops in debug mode to see the exact request differences. But I'm pretty sure it's gonna be the API version parameter that is causing issues | 00:53:44 | |
In reply to @arianvp:matrix.org Oh sure it is. Doesn't mean that all the startups using it to manage their infra evaporate though :D I'm checking your replies now, very helpful, one moment | 00:53:45 | |
| If updating nixops is not an option I'm afraid you'll have to upload a custom AMI with that setting unset :( | 00:57:09 | |
| But that'll get you into trouble as well as the ec2 nixos modules rely on IMDSv2 these days | 00:59:38 | |
| Wait nah that's fine | 01:00:52 | |
| IMDSv2 works on IMDSv1 images. | 01:01:02 | |
| Just not the other way around | 01:01:06 | |
In reply to @arianvp:matrix.org Yes, I saw that. My plan is to answer that StackOverflow question eventually.
The key thing is it can't' just be NixOps alone. Because NixOps (and the same curl command) launches the old instance but not the new. So it's not a plain AWS API removal. This is the curl (credentials removed):
Indeed | 01:01:15 | |
In reply to @arianvp:matrix.org* Yes, I saw that. My plan is to answer that StackOverflow question eventually.
The key thing is it can't' just be NixOps alone. Because NixOps (and the same curl command) launches the old instance but not the new. So it's not a plain AWS API removal. This is the curl (credentials removed):
Indeed | 01:01:54 | |
| So I think you pinpointed it exactly | 01:02:06 | |
In reply to @nh2:matrix.orgThat Imdssupport:V2 Option on the AMI causes an implicit MetadataOptions parameter to be passed to RunInstances, and i guess the API version of nixops doesn't support that parameter | 01:02:44 | |
| * That Imdssupport:V2 Option on the AMI causes an implicit MetadataOptions parameter to be passed to RunInstances when you use the AMi, and i guess the API version of nixops doesn't support that parameter | 01:03:06 | |
| The old AMI doesn't have that option set, so there is no implicit unsupported parameter | 01:05:54 | |
| Right. Bit of a brutal error message, The parameter MetadataOptions is not recognized; AWS could at least say it's an implicit parameter added by the Version. | 01:06:05 | |
| Yeh this is something somewhere internally going wrong and then that error bubbling up 😅 | 01:07:09 | |
| Classic AWS error message | 01:07:23 | |
| Not as good as Microsoft, where on OneDrive, if you download a large folder as a streamed ZIP, they randomly replace files by text files that contain internal error messages whent that machine OOMs, happens in ~30% of files I download from Microsoft | 01:08:19 | |
The slightly annoying thing here is that this part of NixOps uses boto, not boto3.I'll have a look whether I can get the request to work by convincing that to use a newer Version.Then afterwards I guess I have to see if I can get the thing updated to a newer nixops, or switch it out (it'll be a long work and risky though). | 01:09:00 | |
| Hope there are no coredumps in there lol | 01:09:02 | |
Arian: Do you know if there's a list/changelog of Versions for EC2? | 01:10:22 | |
| Currently checking https://stackoverflow.com/questions/60366935/find-latest-aws-api-version-for-locking-the-version | 01:11:11 | |
| https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html | 01:11:46 | |
| The latest version is 2016-11-15 | 01:11:58 | |
| They almost never make breaking changes. IMDSv2 was needed because enormous security hole | 01:12:45 | |
| But i guess that means updating nixops might be enough? | 01:12:56 | |
| Seems the lock file is from 2018 | 01:13:08 | |
| https://github.com/boto/botocore/tree/develop/botocore/data/ec2 | 01:15:57 | |
| Alternatively, maybe I should just build my own AMI, and turn off the option there. Because I don't actually need any specific AMI. It's only needed to boot, the machine, in a reproducible fashion (and ideallly one that doesn't rename all devices after reboot when systemd decides that it's another year again where all network interfaces shall be renamed). After nixops has deployed and rebooted, the software specified by by nixpkgs pin runs anway. | 01:16:04 | |