Connecting to render.com postgresql instance from Github actions

Hey :slight_smile:

I’ve deployed a phoenix app to render.com and added a managed postgresql instance as well, but cannot seem to be able to connect to it from my Github actions workflow - I’d do the db setup, migration and seeding from here. Here is my setup for the db connection:

config :my_project, MyProject.Repo,
    ssl: true,
    ssl_opts: [
      verify: :verify_none,
      parameters: [ idle_interval: 60, idle_limit: 300 ]
    ],
    url: System.get_env("DATABASE_URL"),
    pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
    socket_options: if System.get_env("ECTO_IPV6") in ~w(true 1), do: [:inet6], else: []

For the DATABASE_URL I used the external url provided by render.com without modification, and I was able to use it to connect to the database without any issues from my computer, so that shouldn’t be the issue. I also checked if the managed postgres instance really did use ssl, and that a supported encryption algorithm was being used, but all of that seemed correct. As for the ECTO_IPV6 env var, it isn’t used and should resolve to .

This is the error I’m getting:

[error] Postgrex.Protocol (#PID<0.6261.0>) failed to connect: ** (DBConnection.ConnectionError) ssl recv (idle): closed

Here are the versions for elixir and the erlang OTP I’m using:

  • ELIXIR_VERSION: 1.15.7
  • OTP_VERSION: 26

I couldn’t find much information about this particular error anywhere on the internet, did anyone else run into it, or could you connect just fine?

I’d be grateful for any help, let me if there is any additional info I should provide.

What is this? Looking at erlang’s ssl docs https://www.erlang.org/doc/man/ssl#type-server_option
I can’t find that option.

The parameters are forwarded to db_connection as far as I understood, and that has these start options:
https://hexdocs.pm/db_connection/DBConnection.html#t:start_option/0

I found the reference in the Ecto Postgres adapter docs:
https://hexdocs.pm/ecto_sql/Ecto.Adapters.Postgres.html

  • :parameters - Keyword list of connection parameters

Not sure if that is correct, but this was my understanding. I got the same error before adding this part to the configuration as well.