-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
terraform crashes while creating emr cluster using cloudformation template #5487
Comments
Hi @pmann91 It looks like the API happened to return no stacks via |
Hi @radeksimko, |
Hi @radeksimko I was working on it and found that the above Terraform script executes successfully if |
I was able to reproduce similar problem with the following config: resource "aws_cloudformation_stack" "full" {
name = "tf-full-stack"
template_body = <<STACK
{
"Parameters" : {
"VpcCIDR" : {
"Description" : "CIDR to be used for the VPC",
"Type" : "String"
}
},
"Resources" : {
"MyVPC": {
"Type" : "AWS::EC2::VPC",
"Properties" : {
"CidrBlock" : {"Ref": "VpcCIDR"},
"Tags" : [
{"Key": "Name", "Value": "Primary_CF_VPC"}
]
}
},
"StaticVPC": {
"Type" : "AWS::EC2::VPC",
"Properties" : {
"CidrBlock" : {"Ref": "VpcCIDR"},
"Tags" : [
{"Key": "Name", "Value": "Static_CF_VPC"}
]
}
},
"InstanceRole" : {
"Type" : "AWS::IAM::Role",
"Properties" : {
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [ {
"Effect": "Allow",
"Principal": { "Service": "ec2.amazonaws.com" },
"Action": "sts:AssumeRole"
} ]
},
"Path" : "/",
"Policies" : [ {
"PolicyName": "terraformtest",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [ {
"Effect": "Allow",
"Action": [ "ec2:DescribeSnapshots" ],
"Resource": [ "*" ]
} ]
}
} ]
}
}
}
}
STACK
parameters {
VpcCIDR = "10.0.0.0/16"
}
policy_body = <<POLICY
{
"Statement" : [
{
"Effect" : "Deny",
"Action" : "Update:*",
"Principal": "*",
"Resource" : "LogicalResourceId/StaticVPC"
},
{
"Effect" : "Allow",
"Action" : "Update:*",
"Principal": "*",
"Resource" : "*"
}
]
}
POLICY
capabilities = ["CAPABILITY_IAM"]
notification_arns = ["${aws_sns_topic.cf-updates.arn}"]
on_failure = "DELETE"
timeout_in_minutes = 1
tags {
First = "Mickey"
Second = "Mouse"
}
}
resource "aws_sns_topic" "cf-updates" {
name = "tf-cf-notifications"
} which lead me to this error:
The reason this happened is because the stack creation exceeds given timeout and CloudFormation then starts deleting it because of When I took your example, I was also able to reproduce an error, but a graceful error:
i.e. not the @pmann91 Can you please double check you provided the exact config that caused the crash? |
Since the CloudFormation API (not the Go SDK) is responsible for parsing the actual JSON definition for the stack, I don't believe the version of SDK would be causing such problems. |
@radeksimko , Thanks for the detail i understood it now. |
Hey @radeksimko , I have double checked the config and its same. Even tried executing the same script again but got the same crash report. |
@pmann91 It is good (at least for debugging purposes) that you're getting this error consistently and not intermittently. However I was really not able to reproduce it even after The last difference I can think of is region (I'm using I have prepared a "trap" for these kind of situations and I can further increase the logging verbosity around this. Would you be able to compile the code from my PR/branch and try rerunning your example? If not, I can send you a binary - I just need to know what platform you run on. I'm afraid that I won't be able to get to the bottom of it without your help (since I cannot reproduce it). |
Region: us-west-2 If you can provide the library, I can re-execute and check for results. |
tested config on us-west-2. fails with "cluster failed stabilize". What does it mean? |
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. |
Hi,
Terraform crashes while creating emr cluster using cloudformation template giving unexpected EOF error.
version being used:
script:
crash log:
While on the prompt it shows failure in creating the emr cluster, the cluster is properly created and working when seen on UI.
The text was updated successfully, but these errors were encountered: