Skip to content

weird error detecting capabilities: error PostgreSQL version: dial tcp 127.0.0.1:5432: connect: connection refused error #124

@tristandibbens

Description

@tristandibbens

Hi,

Please can you help me.
I have a Fargate/RDS terraform build.
I'm constantly struggling trying to get Terraform to work with the postgreSQL connector. (I'm still here at 4pm on a Saturday)

I ran a tf apply to apply a database encryption from not, which destroyed the database as expected with the view to rebuild it encrypted.
Then it errored on the postgresql connection from the postgresql provider
Since then I cant, destroy, state rm, apply or anything
I have manually edited the state file but tf didnt like that so I have restored that
I cant seem to get past the point of this weird error detecting capabilities: error PostgreSQL version: dial tcp 127.0.0.1:5432: connect: connection refused error

All I wanted to do was encrypt the database at rest. Its taken probably two days of time so far and still no further with it.

Terraform Version

1.0.1 and 1.0.5

Affected Resource(s)

postgresql _role and postgresql_database

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Its just the dependency between the db and this connector that is flakey

Terraform Configuration Files

image
image

Expected Behavior

Terraform should have ignored the provider side of things - since the database was destroyed and does not exist in the state file now - why is it trying to connect at all at this point!

Actual Behavior

Error: error detecting capabilities: error PostgreSQL version: dial tcp 127.0.0.1:5432: connect: connection refused
Error: error detecting capabilities: error PostgreSQL version: dial tcp 127.0.0.1:5432: connect: connection refused
Makefile:60: recipe for target 'tfapply' failed

Steps to Reproduce

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

  1. terraform apply

Important Factoids

Trying to make an encrypted rds psql instance, this cyrilgdn connector doesnt seem to like that at all
Just added vpc peering to allow this box to communicate better with the db, not tested since not past this issue

References

#120

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions