I'm rocking a Phoenix app, and when I try to run mix ecto.migrate
, I encounter the following error:
GenServer #PID<0.181.0> terminating
** (Postgrex.Error) FATAL (invalid_authorization_specification): no PostgreSQL user name specified in startup packet
(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:240: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
There's some Q&A out there that touches on this particular error, but I haven't found them to be useful, unfortunately. So I turn here!
Additional environment info: Mac OS X, Postgres.app, PG version 9.5
The StartupMessage sent from the client to the server must contain a non-empty user name; as the documentation says:
StartupMessage (F)
[...]
The protocol version number is followed by one or more pairs of parameter name and value strings. A zero byte is required as a terminator after the last name/value pair. Parameters can appear in any order. user is required, others are optional. [...]
My guess is that you specified an empty user name.
if you did not create a new user, the default is your mac username and password.
This is coming late but I hope it helps someone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With