Eiji
Hey, I got an error when deploying Phoenix app:
** (Mix) The database for MyApp.Repo couldn’t be created: FATAL (invalid_authorization_specification): Ident authentication failed for user “postgres”
17:58:29.531 [error] GenServer pid<0.202.0> terminating
** (Postgrex.Error) FATAL (invalid_authorization_specification): Ident authentication failed for user “postgres”
(db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2
(connection) lib/connection.ex:622: Connection.enter_connect/5
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
Here is my /var/lib/pgsql/9.6/data/pg_hba.conf:
local all all md5
# IPv4 local connections:
host all all localhost ident
# IPv6 local connections:
host all all ::1/128 ident
I already checked password with: psql -U postgres and of course restarted service: sudo systemctl start haproxy.
I’m using Amazon EC2 with RedHat 7.3
What am I missed?
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #ai
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #metaprogramming











Showing Posts 1 to 5- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
OvermindDL1
For note,
psqlmight use a named pipe instead of a port, make sure you can connect to the port from the account that the server is running on.michalmuskala
Yes,
psqlwill use the unix socket by default. To test the tcp connection (the one used by ecto), you’d need to runpsql -h localhost -U postgres.Eiji
@michalmuskala and @OvermindDL1: thanks, how to change it to listen on port? I saw port configuration in
postgresql.conf, but uncommenting it not and restarting not works.Looks like unix sockets are turn on by default with
localhostconfiguration, but this is required by ecto:https://github.com/elixir-ecto/ecto/issues/1207#issuecomment-172570064
Note: this configuration now works:
but is
md5safe?OvermindDL1
As long as it is only allowed from localhost (it should be based on the above), then md5 is fine.
andreheringer
I’m using Fedora 30 and edited the pg_hba.conf file to bo:
After that I tried to restart the postgres service and run
psql -h localhost -U postgresbut I’m still stuck will authentication failed.Am I missing something?