Skip to content

Instantly share code, notes, and snippets.

@swoodford-clear
Created March 18, 2021 19:26
Show Gist options
  • Save swoodford-clear/ffaa75e7a414db80648d8a5d31ff1ede to your computer and use it in GitHub Desktop.
Save swoodford-clear/ffaa75e7a414db80648d8a5d31ff1ede to your computer and use it in GitHub Desktop.
Terraform module postgres debug
terraform apply -var-file="example.tfvars"
2021/03/18 15:08:15 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
Use TF_LOG=TRACE to see Terraform's internal logs.
----
2021/03/18 15:08:15 [INFO] Terraform version: 0.13.6
2021/03/18 15:08:15 [INFO] Go runtime version: go1.14.7
2021/03/18 15:08:15 [INFO] CLI args: []string{"/usr/local/Cellar/tfenv/2.2.0/versions/0.13.6/terraform", "apply", "-var-file=example.tfvars"}
2021/03/18 15:08:15 [DEBUG] Attempting to open CLI config file: /Users/user.name/.terraformrc
2021/03/18 15:08:15 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021/03/18 15:08:15 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021/03/18 15:08:15 [DEBUG] ignoring non-existing provider search directory /Users/user.name/.terraform.d/plugins
2021/03/18 15:08:15 [DEBUG] ignoring non-existing provider search directory /Users/user.name/Library/Application Support/io.terraform/plugins
2021/03/18 15:08:15 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2021/03/18 15:08:15 [INFO] CLI command args: []string{"apply", "-var-file=example.tfvars"}
2021/03/18 15:08:15 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
Use TF_LOG=TRACE to see Terraform's internal logs.
----
2021/03/18 15:08:15 [DEBUG] New state was assigned lineage "5e1c06f9-9ce2-de40-7557-1d4fd5506cd8"
2021/03/18 15:08:15 [DEBUG] checking for provisioner in "."
2021/03/18 15:08:15 [DEBUG] checking for provisioner in "/usr/local/Cellar/tfenv/2.2.0/versions/0.13.6"
2021/03/18 15:08:15 [INFO] Failed to read plugin lock file .terraform/plugins/darwin_amd64/lock.json: open .terraform/plugins/darwin_amd64/lock.json: no such file or directory
2021/03/18 15:08:15 [INFO] backend/local: starting Apply operation
2021-03-18T15:08:15.216-0400 [INFO] plugin: configuring client automatic mTLS
2021-03-18T15:08:15.243-0400 [DEBUG] plugin: starting plugin: path=.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2 args=[.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2]
2021-03-18T15:08:15.248-0400 [DEBUG] plugin: plugin started: path=.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2 pid=12846
2021-03-18T15:08:15.248-0400 [DEBUG] plugin: waiting for RPC address: path=.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2
2021-03-18T15:08:16.425-0400 [INFO] plugin.terraform-provider-postgresql_v1.11.2: configuring server automatic mTLS: timestamp=2021-03-18T15:08:16.425-0400
2021-03-18T15:08:16.456-0400 [DEBUG] plugin: using plugin: version=5
2021-03-18T15:08:16.456-0400 [DEBUG] plugin.terraform-provider-postgresql_v1.11.2: plugin address: address=/var/folders/56/jy_qww6x2rxc930_8pfdtbqm0000gp/T/plugin145343229 network=unix timestamp=2021-03-18T15:08:16.456-0400
2021-03-18T15:08:16.516-0400 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = unknown service plugin.GRPCStdio"
2021-03-18T15:08:16.520-0400 [DEBUG] plugin: plugin process exited: path=.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2 pid=12846
2021-03-18T15:08:16.520-0400 [DEBUG] plugin: plugin exited
2021/03/18 15:08:16 [INFO] terraform: building graph: GraphTypeValidate
2021/03/18 15:08:16 [DEBUG] ProviderTransformer: "postgresql_role.admin" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/cyrilgdn/postgresql"]
2021/03/18 15:08:16 [DEBUG] ReferenceTransformer: "var.host" references: []
2021/03/18 15:08:16 [DEBUG] ReferenceTransformer: "var.root_database" references: []
2021/03/18 15:08:16 [DEBUG] ReferenceTransformer: "var.root_username" references: []
2021/03/18 15:08:16 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/cyrilgdn/postgresql\"]" references: [var.root_database var.host var.root_username var.root_password]
2021/03/18 15:08:16 [DEBUG] ReferenceTransformer: "postgresql_role.admin" references: []
2021/03/18 15:08:16 [DEBUG] ReferenceTransformer: "var.root_password" references: []
2021/03/18 15:08:16 [DEBUG] Starting graph walk: walkValidate
2021-03-18T15:08:16.522-0400 [INFO] plugin: configuring client automatic mTLS
2021-03-18T15:08:16.554-0400 [DEBUG] plugin: starting plugin: path=.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2 args=[.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2]
2021-03-18T15:08:16.559-0400 [DEBUG] plugin: plugin started: path=.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2 pid=12852
2021-03-18T15:08:16.559-0400 [DEBUG] plugin: waiting for RPC address: path=.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2
2021-03-18T15:08:16.575-0400 [INFO] plugin.terraform-provider-postgresql_v1.11.2: configuring server automatic mTLS: timestamp=2021-03-18T15:08:16.575-0400
2021-03-18T15:08:16.603-0400 [DEBUG] plugin: using plugin: version=5
2021-03-18T15:08:16.603-0400 [DEBUG] plugin.terraform-provider-postgresql_v1.11.2: plugin address: address=/var/folders/56/jy_qww6x2rxc930_8pfdtbqm0000gp/T/plugin491086771 network=unix timestamp=2021-03-18T15:08:16.602-0400
2021-03-18T15:08:16.659-0400 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = unknown service plugin.GRPCStdio"
2021-03-18T15:08:16.663-0400 [DEBUG] plugin: plugin process exited: path=.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2 pid=12852
2021-03-18T15:08:16.663-0400 [DEBUG] plugin: plugin exited
2021/03/18 15:08:16 [INFO] backend/local: apply calling Refresh
2021/03/18 15:08:16 [INFO] terraform: building graph: GraphTypeRefresh
2021/03/18 15:08:16 [DEBUG] pruning unused provider["registry.terraform.io/cyrilgdn/postgresql"]
2021/03/18 15:08:16 [DEBUG] ReferenceTransformer: "var.root_database" references: []
2021/03/18 15:08:16 [DEBUG] ReferenceTransformer: "var.root_username" references: []
2021/03/18 15:08:16 [DEBUG] ReferenceTransformer: "var.root_password" references: []
2021/03/18 15:08:16 [DEBUG] ReferenceTransformer: "var.host" references: []
2021/03/18 15:08:16 [DEBUG] Starting graph walk: walkRefresh
2021/03/18 15:08:16 [INFO] backend/local: apply calling Plan
2021/03/18 15:08:16 [INFO] terraform: building graph: GraphTypePlan
2021/03/18 15:08:16 [DEBUG] ProviderTransformer: "postgresql_role.admin (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/cyrilgdn/postgresql"]
2021/03/18 15:08:16 [DEBUG] ReferenceTransformer: "var.root_username" references: []
2021/03/18 15:08:16 [DEBUG] ReferenceTransformer: "var.root_password" references: []
2021/03/18 15:08:16 [DEBUG] ReferenceTransformer: "var.host" references: []
2021/03/18 15:08:16 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/cyrilgdn/postgresql\"]" references: [var.root_username var.root_database var.root_password var.host]
2021/03/18 15:08:16 [DEBUG] ReferenceTransformer: "postgresql_role.admin (expand)" references: []
2021/03/18 15:08:16 [DEBUG] ReferenceTransformer: "var.root_database" references: []
2021/03/18 15:08:16 [DEBUG] Starting graph walk: walkPlan
2021-03-18T15:08:16.666-0400 [INFO] plugin: configuring client automatic mTLS
2021-03-18T15:08:16.693-0400 [DEBUG] plugin: starting plugin: path=.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2 args=[.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2]
2021-03-18T15:08:16.698-0400 [DEBUG] plugin: plugin started: path=.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2 pid=12853
2021-03-18T15:08:16.698-0400 [DEBUG] plugin: waiting for RPC address: path=.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2
2021-03-18T15:08:16.715-0400 [INFO] plugin.terraform-provider-postgresql_v1.11.2: configuring server automatic mTLS: timestamp=2021-03-18T15:08:16.714-0400
2021-03-18T15:08:16.745-0400 [DEBUG] plugin.terraform-provider-postgresql_v1.11.2: plugin address: address=/var/folders/56/jy_qww6x2rxc930_8pfdtbqm0000gp/T/plugin389023352 network=unix timestamp=2021-03-18T15:08:16.744-0400
2021-03-18T15:08:16.745-0400 [DEBUG] plugin: using plugin: version=5
2021-03-18T15:08:16.801-0400 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = unknown service plugin.GRPCStdio"
2021/03/18 15:08:16 [DEBUG] Resource instance state not found for node "postgresql_role.admin", instance postgresql_role.admin
2021/03/18 15:08:16 [DEBUG] ReferenceTransformer: "postgresql_role.admin" references: []
2021/03/18 15:08:16 [WARN] Provider "registry.terraform.io/cyrilgdn/postgresql" produced an invalid plan for postgresql_role.admin, but we are tolerating it because it is using the legacy plugin SDK.
The following problems may be the cause of any confusing errors from downstream operations:
- .valid_until: planned value cty.StringVal("infinity") does not match config value cty.NullVal(cty.String)
- .encrypted_password: planned value cty.True does not match config value cty.NullVal(cty.Bool)
- .replication: planned value cty.False does not match config value cty.NullVal(cty.Bool)
- .skip_reassign_owned: planned value cty.False does not match config value cty.NullVal(cty.Bool)
- .bypass_row_level_security: planned value cty.False does not match config value cty.NullVal(cty.Bool)
- .create_role: planned value cty.False does not match config value cty.NullVal(cty.Bool)
- .inherit: planned value cty.True does not match config value cty.NullVal(cty.Bool)
- .skip_drop_role: planned value cty.False does not match config value cty.NullVal(cty.Bool)
- .superuser: planned value cty.False does not match config value cty.NullVal(cty.Bool)
2021-03-18T15:08:16.809-0400 [DEBUG] plugin: plugin process exited: path=.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2 pid=12853
2021-03-18T15:08:16.809-0400 [DEBUG] plugin: plugin exited
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
2021/03/18 15:08:16 [DEBUG] command: asking for input: "Do you want to perform these actions?"
Terraform will perform the following actions:
# postgresql_role.admin will be created
+ resource "postgresql_role" "admin" {
+ bypass_row_level_security = false
+ connection_limit = 100
+ create_database = true
+ create_role = false
+ encrypted_password = true
+ id = (known after apply)
+ inherit = true
+ login = true
+ name = "admin"
+ password = (sensitive value)
+ replication = false
+ skip_drop_role = false
+ skip_reassign_owned = false
+ superuser = false
+ valid_until = "infinity"
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
2021/03/18 15:08:19 [INFO] backend/local: apply calling Apply
2021/03/18 15:08:19 [INFO] terraform: building graph: GraphTypeApply
2021/03/18 15:08:19 [DEBUG] Resource state not found for node "postgresql_role.admin", instance postgresql_role.admin
2021/03/18 15:08:19 [DEBUG] ProviderTransformer: "postgresql_role.admin (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/cyrilgdn/postgresql"]
2021/03/18 15:08:19 [DEBUG] ProviderTransformer: "postgresql_role.admin" (*terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/cyrilgdn/postgresql"]
2021/03/18 15:08:19 [DEBUG] ReferenceTransformer: "postgresql_role.admin" references: []
2021/03/18 15:08:19 [DEBUG] ReferenceTransformer: "var.host" references: []
2021/03/18 15:08:19 [DEBUG] ReferenceTransformer: "var.root_database" references: []
2021/03/18 15:08:19 [DEBUG] ReferenceTransformer: "var.root_username" references: []
2021/03/18 15:08:19 [DEBUG] ReferenceTransformer: "var.root_password" references: []
2021/03/18 15:08:19 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/cyrilgdn/postgresql\"]" references: [var.root_username var.root_password var.host var.root_database]
2021/03/18 15:08:19 [DEBUG] ReferenceTransformer: "postgresql_role.admin (expand)" references: []
2021/03/18 15:08:19 [DEBUG] Starting graph walk: walkApply
2021-03-18T15:08:19.502-0400 [INFO] plugin: configuring client automatic mTLS
2021-03-18T15:08:19.532-0400 [DEBUG] plugin: starting plugin: path=.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2 args=[.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2]
2021-03-18T15:08:19.536-0400 [DEBUG] plugin: plugin started: path=.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2 pid=12855
2021-03-18T15:08:19.536-0400 [DEBUG] plugin: waiting for RPC address: path=.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2
2021-03-18T15:08:19.552-0400 [INFO] plugin.terraform-provider-postgresql_v1.11.2: configuring server automatic mTLS: timestamp=2021-03-18T15:08:19.552-0400
2021-03-18T15:08:19.582-0400 [DEBUG] plugin.terraform-provider-postgresql_v1.11.2: plugin address: network=unix address=/var/folders/56/jy_qww6x2rxc930_8pfdtbqm0000gp/T/plugin520523450 timestamp=2021-03-18T15:08:19.581-0400
2021-03-18T15:08:19.582-0400 [DEBUG] plugin: using plugin: version=5
2021-03-18T15:08:19.636-0400 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = unknown service plugin.GRPCStdio"
2021/03/18 15:08:19 [WARN] Provider "registry.terraform.io/cyrilgdn/postgresql" produced an invalid plan for postgresql_role.admin, but we are tolerating it because it is using the legacy plugin SDK.
The following problems may be the cause of any confusing errors from downstream operations:
- .skip_drop_role: planned value cty.False does not match config value cty.NullVal(cty.Bool)
- .superuser: planned value cty.False does not match config value cty.NullVal(cty.Bool)
- .encrypted_password: planned value cty.True does not match config value cty.NullVal(cty.Bool)
- .replication: planned value cty.False does not match config value cty.NullVal(cty.Bool)
- .valid_until: planned value cty.StringVal("infinity") does not match config value cty.NullVal(cty.String)
- .bypass_row_level_security: planned value cty.False does not match config value cty.NullVal(cty.Bool)
- .create_role: planned value cty.False does not match config value cty.NullVal(cty.Bool)
- .skip_reassign_owned: planned value cty.False does not match config value cty.NullVal(cty.Bool)
- .inherit: planned value cty.True does not match config value cty.NullVal(cty.Bool)
2021/03/18 15:08:19 [DEBUG] EvalApply: ProviderMeta config value set
postgresql_role.admin: Creating...
2021/03/18 15:08:19 [DEBUG] postgresql_role.admin: applying the planned Create change
2021/03/18 15:08:20 [DEBUG] postgresql_role.admin: apply errored, but we're indicating that via the Error pointer rather than returning it: error detecting capabilities: error PostgreSQL version: x509: certificate signed by unknown authority
2021/03/18 15:08:20 [ERROR] eval: *terraform.EvalApplyPost, err: error detecting capabilities: error PostgreSQL version: x509: certificate signed by unknown authority
2021/03/18 15:08:20 [ERROR] eval: *terraform.EvalSequence, err: error detecting capabilities: error PostgreSQL version: x509: certificate signed by unknown authority
Error: error detecting capabilities: error PostgreSQL version: x509: certificate signed by unknown authority
on main.tf line 13, in resource "postgresql_role" "admin":
13: resource "postgresql_role" "admin" {
2021-03-18T15:08:20.138-0400 [DEBUG] plugin: plugin process exited: path=.terraform/plugins/registry.terraform.io/cyrilgdn/postgresql/1.11.2/darwin_amd64/terraform-provider-postgresql_v1.11.2 pid=12855
2021-03-18T15:08:20.138-0400 [DEBUG] plugin: plugin exited
exit status 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment