Open connorjcantrell opened 3 years ago
For what its worth, I received a new error after trying a different database url:
postgres://postgres:secret@5432:5432/syndicate?sslmode=disable
After attempting:
syndicate $go run cmd/syndicate/main.go
2021/01/25 18:34:08 error connecting to database: dial tcp 0.0.21.56:5432: connect: no route to host
exit status 1
The error has changed at least? Maybe a good sign? 🤔
Aram Fingal from 'dockercommunity.slack.com' writes:
since there is no indication you're running the go code inside a container, try it with
postgres://postgres:secret@localhost:5432/syndicate?sslmode=disable
After attempting:
syndicate $go run cmd/syndicate/main.go
2021/01/25 19:24:30 error connecting to database: pq: role "postgres" does not exist
exit status 1
New error, but I think I'm getting close to solving
Problem
Unable to connect to database when attempting to run main.go:
The only suspicion that comes to mind is perhaps my database URL is incorrect.
postgres://postgres:secret@db:5432/syndicate?sslmode=disable
I have verified my postgres container is running: