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

Heroku Provisioner doesn't properly validate variable syntax in a config_vars block #5662

Closed
wdullaer opened this issue Mar 16, 2016 · 1 comment

Comments

@wdullaer
Copy link

I had a rather large terraform plan containing multiple providers.

One of the heroku app resources had the following in the config_vars block

resource "heroku_app" "web" {
  name = "awesome-app"
  config_vars = {
    USERNAME = "${my_username}"
  }
}

Notice how it says "${my_username}" rather than "${var.my_username}"
Due to the size of the total project, I didn't notice this.
terraform validate didn't throw any errors
terraform plan worked just fine

It finally crashen when trying to apply the changes with this rather bizar error

panic: interface conversion: interface {} is nil, not map[string]interface {}                                                                                                                                     
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku:                                                                                                                                                            
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku: goroutine 62 [running]:                                                                                                                                    
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku: panic(0xa74da0, 0xc820224100)                                                                                                                              
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku:  /opt/go/src/runtime/panic.go:464 +0x3e6                                                                                                                   
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku: github.com/hashicorp/terraform/builtin/providers/heroku.resourceHerokuAppRead(0xc8202d8540, 0xb3a8c0, 0xc82017c660, 0x0, 0x0)                              
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku:  /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/heroku/resource_heroku_app.go:290 +0xf0b                                                 
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku: github.com/hashicorp/terraform/builtin/providers/heroku.resourceHerokuAppUpdate(0xc8202d8540, 0xb3a8c0, 0xc82017c660, 0x0, 0x0)                            
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku:  /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/heroku/resource_heroku_app.go:376 +0x625                                                 
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku: github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc820107880, 0xc820493b00, 0xc820491de0, 0xb3a8c0, 0xc82017c660, 0xc820493c01, 0x0, 0x0)   
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku:  /opt/gopath/src/github.com/hashicorp/terraform/helper/schema/resource.go:152 +0x3b9                                                                       
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku: github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc820344ff0, 0xc820401280, 0xc820493b00, 0xc820491de0, 0x1, 0x0, 0x0)                      
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku:  /opt/gopath/src/github.com/hashicorp/terraform/helper/schema/provider.go:162 +0x1ed                                                                       
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku: github.com/hashicorp/terraform/rpc.(*ResourceProviderServer).Apply(0xc8203b49c0, 0xc8204b1a40, 0xc820491e30, 0x0, 0x0)                                     
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku:  /opt/gopath/src/github.com/hashicorp/terraform/rpc/resource_provider.go:323 +0x76                                                                         
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku: reflect.Value.call(0xa0a940, 0xaf20f8, 0x13, 0xb3e610, 0x4, 0xc8201ffed8, 0x3, 0x3, 0x0, 0x0, ...)                                                         
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku:  /opt/go/src/reflect/value.go:435 +0x120d                                                                                                                  
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku: reflect.Value.Call(0xa0a940, 0xaf20f8, 0x13, 0xc8201ffed8, 0x3, 0x3, 0x0, 0x0, 0x0)                                                                        
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku:  /opt/go/src/reflect/value.go:303 +0xb1                                                                                                                    
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku: net/rpc.(*service).call(0xc820107a00, 0xc8201079c0, 0xc8203a1850, 0xc820341880, 0xc8203b49e0, 0x91f5a0, 0xc8204b1a40, 0x16, 0x91f600, 0xc820491e30, ...)   
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku:  /opt/go/src/net/rpc/server.go:383 +0x1c2                                                                                                                  
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku: created by net/rpc.(*Server).ServeCodec                                                                                                                    
2016/03/16 16:02:52 [DEBUG] terraform-provider-heroku:  /opt/go/src/net/rpc/server.go:477 +0x49d                                                                                                                  
2016/03/16 16:02:52 [DEBUG] root: eval: *terraform.EvalWriteState                                                                                                                                                 
2016/03/16 16:02:52 [DEBUG] root: eval: *terraform.EvalApplyProvisioners                                                                                                                                          
2016/03/16 16:02:52 [DEBUG] root: eval: *terraform.EvalIf                                                                                                                                                         
2016/03/16 16:02:52 [DEBUG] root: eval: *terraform.EvalWriteDiff                                                                                                                                                  
2016/03/16 16:02:52 [DEBUG] root: eval: *terraform.EvalIf                                                                                                                                                         
2016/03/16 16:02:52 [DEBUG] root: eval: *terraform.EvalWriteState                                                                                                                                                 
2016/03/16 16:02:52 [DEBUG] root: eval: *terraform.EvalApplyPost                                                                                                                                                  
2016/03/16 16:02:52 [DEBUG] /usr/local/bin/terraform-provider-heroku: plugin process exited                                                                                                                       
2016/03/16 16:02:52 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:                                                                                                                       

* heroku_app.integration: unexpected EOF                                                                                                                                                                          
2016/03/16 16:02:52 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:                                                                                                                        

* heroku_app.integration: unexpected EOF                                                                                                                                                                          
2016/03/16 16:02:52 [ERROR] root: eval: *terraform.EvalOpFilter, err: 1 error(s) occurred:                                                                                                                        

* heroku_app.integration: unexpected EOF                                                                                                                                                                          
2016/03/16 16:02:52 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:                                                                                                                        

* heroku_app.integration: unexpected EOF                                                                                                                                                                          
2016/03/16 16:02:52 [TRACE] [walkApply] Exiting eval tree: heroku_app.integration                                                                                                                                 
2016/03/16 16:02:52 [DEBUG] vertex provider.heroku (close), got dep: heroku_app.integration                                                                                                                       
2016/03/16 16:02:52 [DEBUG] vertex root, got dep: provider.heroku (close)                                                                                                                                         
2016/03/16 16:02:52 [DEBUG] vertex root, got dep: provider.aws (close)                                                                                                                                            
2016/03/16 16:02:52 [DEBUG] waiting for all plugin processes to complete...                                                                                                                                       
2016/03/16 16:02:52 [DEBUG] /usr/local/bin/terraform-provider-aws: plugin process exited      

It took me a while/day to figure out that there was a variable with an invalid syntax. I suppose the terraform parser should catch this.

@ghost
Copy link

ghost commented Apr 11, 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 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.

@ghost ghost locked and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants