Skip to content
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

unexpected EOF: panic: runtime error: invalid memory address or nil pointer dereference #3083

Closed
beanaroo opened this issue Jan 21, 2018 · 5 comments · Fixed by #3171
Closed
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/elasticbeanstalk Issues and PRs that pertain to the elasticbeanstalk service.
Milestone

Comments

@beanaroo
Copy link
Contributor

beanaroo commented Jan 21, 2018

Terraform Version

Terraform v0.11.2
+ provider.aws v1.7.1

Affected Resource(s)

  • aws_elastic_beanstalk_application: unexpected EOF
  • aws_key_pair: unexpected EOF
  • aws_iam_policy: unexpected EOF
  • aws_vpc: unexpected EOF
  • aws_sns_topic: unexpected EOF
  • aws_elastic_beanstalk_application: unexpected EOF
  • aws_s3_bucket: unexpected EOF
  • aws_db_parameter_group: unexpected EOF

Terraform Configuration Files

terraform.zip.gpg

Debug Output

plan.log.gpg

Panic Output

crash.log.gpg

Expected Behavior

Plan should succeed

Actual Behavior

Panics

Steps to Reproduce

  1. terraform init
  2. terraform plan

Important Factoids

Version 1.7.0 works as expected.
1.7.1. causes the panic.

@radeksimko radeksimko added bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/elasticbeanstalk Issues and PRs that pertain to the elasticbeanstalk service. labels Jan 23, 2018
@radeksimko
Copy link
Member

Hi @beanaroo
thanks for reporting this bug and providing all the details.

Clipping out the important part of the crash log, which doesn't contain any sensitive data:

2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: panic: runtime error: invalid memory address or nil pointer dereference
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1b24f33]
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: 
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: goroutine 258 [running]:
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsElasticBeanstalkApplicationRead(0xc4207c4460, 0x2480f60, 0xc4201b4500, 0xc4207c4460, 0x0)
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: 	/opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_elastic_beanstalk_application.go:113 +0x103
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Refresh(0xc420390690, 0xc420b2e280, 0x2480f60, 0xc4201b4500, 0xc4202a8ac8, 0x1, 0x800206ccd80)
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: 	/opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:354 +0x17e
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Refresh(0xc420ad6d90, 0xc420b2e230, 0xc420b2e280, 0x7f1b92cf0d90, 0x0, 0x18)
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: 	/opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:308 +0x9a
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Refresh(0xc4203e3dc0, 0xc42059b0b0, 0xc42059b320, 0x0, 0x0)
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: 	/opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/plugin/resource_provider.go:549 +0x4e
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: reflect.Value.call(0xc42005cb40, 0xc420594068, 0x13, 0x286746b, 0x4, 0xc4204a5f20, 0x3, 0x3, 0x403a23, 0xc42053a000, ...)
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: 	/usr/local/go/src/reflect/value.go:434 +0x905
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: reflect.Value.Call(0xc42005cb40, 0xc420594068, 0x13, 0xc4206ae720, 0x3, 0x3, 0xc4206ae720, 0xc4206ae728, 0xc4206a8280)
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: 	/usr/local/go/src/reflect/value.go:302 +0xa4
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: net/rpc.(*service).call(0xc420af20c0, 0xc420082050, 0xc4204180a0, 0xc420af4480, 0xc420b42560, 0x200c420, 0xc42059b0b0, 0x16, 0x200c460, 0xc42059b320, ...)
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: 	/usr/local/go/src/net/rpc/server.go:381 +0x142
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: created by net/rpc.(*Server).ServeCodec
2018-01-22T11:07:41.350+1300 [DEBUG] plugin.terraform-provider-aws_v1.7.1_x4: 	/usr/local/go/src/net/rpc/server.go:475 +0x36b

@bflad
Copy link
Contributor

bflad commented Jan 28, 2018

It looks like the read retry logic is returning resource.NonRetryableError(nil) is this case, which in the core code returns just nil: https://github.com/hashicorp/terraform/blob/master/helper/resource/wait.go#L80-L82

I'll submit a PR for this resource that inserts the same error message as the lines before it (saying "Elastic Beanstalk Application ... not found"). I'm not sure if we should modify resource.NonRetryableError to do something like return &RetryError{Err: fmt.Errorf("Empty non-retryable error received. This is a bug with the Terraform provider and should be reported as a GitHub issue in the provider repository."), Retryable: false} on nil input. 🤔 Seems like there shouldn't be a valid use case for passing in nil. I'll also float that PR upstream.

@bflad
Copy link
Contributor

bflad commented Jan 29, 2018

The fix is in master and will be released in v1.8.0 of the provider.

@bflad bflad added this to the v1.8.0 milestone Jan 29, 2018
@bflad
Copy link
Contributor

bflad commented Jan 29, 2018

This has been released in terraform-provider-aws version 1.8.0. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 8, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/elasticbeanstalk Issues and PRs that pertain to the elasticbeanstalk service.
Projects
None yet
3 participants