I am trying to connect an Ecto project running on my local machine to a remote Postgres GCloud instance. I have added the following entry to my config.exs:
I triple-checked that all my actual values were correct, but I keep getting this error over and over again:
** (Mix) The database for MyEctoTest.Repo couldn’t be created: connection not available and request was dropped from queue after 2000ms. This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:
Ensuring your database is available and that you can connect to it
Tracking down slow queries and making sure they are running fast enough
Increasing the pool_size (although this increases resource consumption)
Allowing requests to wait longer by increasing :queue_target and :queue_interval
See DBConnection.start_link/2 for more information
Hi @gavid, when dealing with cloud hosted databases it’s also important to make sure that the firewall and network / VPC settings allow access from where you are trying to connect. Are you able to connect via psql from your local machine?
@benwilson512 I couldn’t see the add network interface in the GCloud console because of a responsiveness issue, but thanks to you I knew to look for it and I zoomed out
I can now get a basic connection working.
Another thing, I have read that it is possible to specify Ecto Repos in this format? Is this correct? If I try to copy the config in the previous format, I get errors again: