Eiji

Eiji

Error: invalid authorization specification

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?

Marked As Solved

OvermindDL1

OvermindDL1

As long as it is only allowed from localhost (it should be based on the above), then md5 is fine. :slight_smile:

Also Liked

OvermindDL1

OvermindDL1

For note, psql might 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

michalmuskala

Yes, psql will use the unix socket by default. To test the tcp connection (the one used by ecto), you’d need to run psql -h localhost -U postgres.

Eiji

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.

psql -h localhost -U postgres
psql: FATAL: Ident authentication failed for user “postgres”

Looks like unix sockets are turn on by default with localhost configuration, but this is required by ecto:
https://github.com/elixir-ecto/ecto/issues/1207#issuecomment-172570064

Note: this configuration now works:

local   all             all                                     md5  
 # IPv4 local connections:
host    all             all             127.0.0.1/32            md5
 # IPv6 local connections:
host    all             all             ::1/128                 ident

but is md5 safe?

Where Next?

Popular in Questions Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
vac
Hi, I’m quite new in Elixir and I’m trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and I...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
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

Other popular topics Top

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
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
Qqwy
Update: How to use the Blogs &amp; Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 127089 1222
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement