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
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
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
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









