-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
user-data sometimes corrupted #14314
Comments
I am having a similar problem. AWS User Data is just holding a simple text value of the hostname supplied from a variable. The variable is available and used for other purposes and is fine. Looks like it has been encrypted or something. When I look at the instance in AWS console it says this about the user data: An error occurred fetching user data (URIError) : URI malformed resource "aws_instance" "TestNode" { An example of the user data as supplied to a script from the variable: CSP_HOSTNAME = q▒L▒▒▒hu▒5 From show command: user_data = 666579a558eaaf2ccc9100c6201d4713e3f6ad23 I changed backends and ran this fresh as I saw one issue that it could be a state issue, but that didn't help. |
This look like it has been outlined in the CHANGELOG under breaking changes: https://github.com/hashicorp/terraform/blob/master/CHANGELOG.md#094-26th-april-2017 |
@majormoses I don't think this is due to this change as the corruption does not always occurs and tainting and recreating the aws_instance resource fixes the issue when it occurs... |
hmm then this is a bug, I just upgraded to 0.9.5 and have not seen anything like this yet. Have you seen this happen with launch_config user_data as well? If I see anything that seems like this I will report back. We only use launch_config and auto_scaling groups so I will let you know if I see the same at some point with them. |
@majormoses we are not using auto_scaling groups yet, so I can't tell if it works or not |
ok I will report back if I see it then, it might be limited to only |
I am seeing it in user_data for a launch configuration as well. We use data template_file to read and transform the user data. We are noticing that in 0.9.5 we see user data changes on every apply. I can understand why this happened once after upgrading from 0.9.4 to 0.9.5 but it is happening repeatedly on 0.9.5. I have worked around it by using using lifecycle ignore_changes = ["user_data"] for now. |
I have not seen this yet and the only difference that I have is that we are not using a template and passing in user data directly. |
FYI, I believe hashicorp/terraform-provider-aws#850 (merged) should fix the behavior you're seeing. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
v0.9.4
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Cloud-init should always get the correct user_data
Actual Behavior
Somehow, sometimes cloud-init does not apply the configuration. When I log into an instance that failed and try to get the user_data, it looks like the metadata does not serves un gzipped content...
If I taint the
aws_instance
resource and apply it again (without changing thetemplate_cloudinit_config
datasource it works...I'm not sure if it's a bug in aws metadata or in terraform as I don't understand in details how user_data works.
Unfortunately I can't always reproduce the issue...
The text was updated successfully, but these errors were encountered: