hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
42.35k stars 9.49k forks source link

Terraform Cloud crash while running the plan #28572

Closed ahaffar closed 3 years ago

ahaffar commented 3 years ago

Terraform Version

 Terraform Cloud with 0.15.0
...

Terraform Configuration Files

  + resource "aws_mq_broker" "_" {

    }
  + resource "aws_security_group" "default" {

    }
  + resource "aws_security_group_rule" "default_ingress" {

    }
  + resource "aws_security_group_rule" "default_ingress" {

    }

Plan: 4 to add, 0 to change, 0 to destroy.
...

Debug Output

panic: value is marked, so must be unmarked first

goroutine 766 [running]:
github.com/zclconf/go-cty/cty.Value.assertUnmarked(...)
    /go/pkg/mod/github.com/zclconf/go-cty@v1.8.1/cty/marks.go:123
github.com/zclconf/go-cty/cty.Value.ElementIterator(0x2c2e840, 0xc002bf5e90, 0x24e3220, 0xc002bc8780, 0x1, 0xc002c8e200)
    /go/pkg/mod/github.com/zclconf/go-cty@v1.8.1/cty/value_ops.go:1111 +0x4f
github.com/hashicorp/terraform/terraform.getValMarks(0xc0027b83f0, 0x2c2e808, 0xc002c8e1d0, 0x23f4a00, 0xc002d3aa50, 0x0, 0x0, 0x0, 0x5020107, 0x2, ...)
    /home/circleci/project/project/terraform/evaluate.go:998 +0x748
github.com/hashicorp/terraform/terraform.markProviderSensitiveAttributes(0xc0027b83f0, 0x2c2e808, 0xc002c8e1d0, 0x23f4a00, 0xc002d3aa50, 0x0, 0xd, 0x3b8d338, 0x1)
    /home/circleci/project/project/terraform/evaluate.go:960 +0x6e
github.com/hashicorp/terraform/terraform.(*evaluationStateData).GetResource(0xc00070ec60, 0x4d, 0xc000433e70, 0xd, 0x3b8d338, 0x1, 0xc000906f00, 0x37, 0x6, 0xb, ...)
    /home/circleci/project/project/terraform/evaluate.go:787 +0x1333
github.com/hashicorp/terraform/lang.(*Scope).evalContext(0xc00098a140, 0xc0002eb3b0, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x901cb7, 0xc0002eb040)
    /home/circleci/project/project/lang/eval.go:360 +0x206d
github.com/hashicorp/terraform/lang.(*Scope).EvalContext(...)
    /home/circleci/project/project/lang/eval.go:238
github.com/hashicorp/terraform/lang.(*Scope).EvalExpr(0xc00098a140, 0x2c2d6c0, 0xc000abd1a0, 0x2c2e760, 0x3ce7388, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /home/circleci/project/project/lang/eval.go:163 +0xb6
github.com/hashicorp/terraform/terraform.(*BuiltinEvalContext).EvaluateExpr(0xc000dabd40, 0x2c2d6c0, 0xc000abd1a0, 0x2c2e760, 0x3ce7388, 0x0, 0x0, 0x40, 0x7f118eef15b8, 0x40, ...)
    /home/circleci/project/project/terraform/eval_context_builtin.go:280 +0xbb
github.com/hashicorp/terraform/terraform.(*NodeApplyableOutput).Execute(0xc003296a40, 0x2c64590, 0xc000dabd40, 0xc00004c001, 0xc0008fdd18, 0x40bb05, 0x243e3e0)
    /home/circleci/project/project/terraform/node_output.go:272 +0x8e4
github.com/hashicorp/terraform/terraform.(*ContextGraphWalker).Execute(0xc00123fd40, 0x2c64590, 0xc000dabd40, 0x7f1167d82420, 0xc003296a40, 0x0, 0x0, 0x0)
    /home/circleci/project/project/terraform/graph_walk_context.go:127 +0xbf
github.com/hashicorp/terraform/terraform.(*Graph).walk.func1(0x2610140, 0xc003296a40, 0x0, 0x0, 0x0)
    /home/circleci/project/project/terraform/graph.go:59 +0xba2
github.com/hashicorp/terraform/dag.(*Walker).walkVertex(0xc00110b7a0, 0x2610140, 0xc003296a40, 0xc003296b00)
    /home/circleci/project/project/dag/walk.go:381 +0x288
created by github.com/hashicorp/terraform/dag.(*Walker).Update
    /home/circleci/project/project/dag/walk.go:304 +0x1246

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Terraform crashed! This is always indicative of a bug within Terraform.
A crash log has been placed at "crash.598921585.log" relative to your current
working directory. It would be immensely helpful if you could please
report the crash with Terraform[1] so that we can fix this.

When reporting bugs, please include your terraform version. That
information is available on the first line of crash.log. You can also
get it by running 'terraform --version' on the command line.

SECURITY WARNING: the "crash.598921585.log" file that was created may contain 
sensitive information that must be redacted before it is safe to share 
on the issue tracker.

[1]: https://github.com/hashicorp/terraform/issues

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Crash Output

I don't know how to locate the crash.log in TF Cloud workspace

Expected Behavior

TF Cloud Run is applied successfully

Actual Behavior

All resources in the plan are created and their IDs are generated, but the apply didn't complete successfully and reported a crash

Steps to Reproduce

Please list the full steps required to reproduce the issue, for example:

  1. terraform init
  2. terraform apply
ahaffar commented 3 years ago

Just need to add one more note.

The resources are created successfully, but not been detected by the terraform plan and those resources are not there in the state.

jbardin commented 3 years ago

Duplicate of #28370

github-actions[bot] commented 3 years ago

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.