shahryarjb

shahryarjb

Problem to connect Postgres in GitHub CI :econnrefused

Hello, I want to create an action for my elixir project, but I can not connect to PSQL database

Error: 9.650 [error] GenServer #PID<0.755.0> terminating
** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
    (db_connection 2.4.1) lib/db_connection/connection.ex:100: DBConnection.Connection.connect/2
    (connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib 3.17) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol

Error: 9.668 [error] GenServer #PID<0.761.0> terminating
** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
    (db_connection 2.4.1) lib/db_connection/connection.ex:100: DBConnection.Connection.connect/2
    (connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib 3.17) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
** (Mix) The database for MishkaDatabase.Repo couldn't be created: killed
Error: Process completed with exit code 1.

As you see I have this error connection refused - :econnrefused

This is my CI yml

https://github.com/shahryarjb/mishka-cms/blob/master/.github/workflows/ci.yml

And this is my test config file:

https://github.com/shahryarjb/mishka-cms/blob/master/config/test.exs

And you can see the last failed action in this repository, thank you, and please help me to fix it

First Post!

shahryarjb

shahryarjb

I changed my port and it works, but I got this error instead of pervious error in my tests, I don’t have this error in my docker

Error: 7.031 [error] GenServer #PID<0.2681.0> terminating
** (ArgumentError) expected :hostname, endpoints, :socket_dir, or :socket to be given
    (postgrex 0.15.13) lib/postgrex/protocol.ex:139: Postgrex.Protocol.endpoints/1
    (postgrex 0.15.13) lib/postgrex/protocol.ex:66: Postgrex.Protocol.connect/1
    (db_connection 2.4.1) lib/db_connection/connection.ex:82: DBConnection.Connection.connect/2
    (connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib 3.17) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

I add it socket_dir: "/var/run/postgres", to my Ecto config, but I have this error, I think it is nor current path

Error: 6.167 [error] GenServer #PID<0.755.0> terminating
** (DBConnection.ConnectionError) tcp connect (/var/run/postgres/.s.PGSQL.5432): no such file or directory - :enoent

I changed my yml and made it like GitHub document, but I have this error

Error: 4.396 [error] GenServer #PID<0.755.0> terminating
** (DBConnection.ConnectionError) tcp connect (postgres:5432): non-existing domain - :nxdomain
    (db_connection 2.4.1) lib/db_connection/connection.ex:100: DBConnection.Connection.connect/2
    (connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib 3.17) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol

Last Post!

shahryarjb

shahryarjb

Hello Friends,
I have postgress error in my new project’s GitHub ci again.

Error

Error: 7.902 [error] GenServer #PID<0.521.0> terminating
##[debug]Dropping file value '/home/runner/work/ChatFCoin/ChatFCoin/14'. Path does not exist
Warning: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
    (db_connection 2.4.2) lib/db_connection/connection.ex:100: DBConnection.Connection.connect/2
** (Mix) The database for ChatFCoin.Repo couldn't be dropped: killed
##[debug]Dropping file value '/home/runner/work/ChatFCoin/ChatFCoin/    (db_connection 2.4.2) lib/db_connection/connection.ex'. Path does not exist
Warning:     (connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib 3.17) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
##[debug]Dropping file value '/home/runner/work/ChatFCoin/ChatFCoin/    (stdlib 3.17) proc_lib.erl'. Path does not exist
Warning: Last message: nil
State: Postgrex.Protocol
Error: Process completed with exit code 1.
##[debug]Finishing: Source Compiling

error ref: https://github.com/shahryarjb/ChatFCoin/runs/6079339322?check_suite_focus=true

My GitHub CI:

https://github.com/shahryarjb/ChatFCoin/blob/master/.github/workflows/ci.yml

Do you have any idea why it is dropped?

Update

I forgot to put ENV=test in ci

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a &gt; b) do {:ok, "a"} end if (a &lt; b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

Other popular topics Top

vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

We're in Beta

About us Mission Statement