Postgrex fails to connect to database during installation procedure
I'm following the basic installation procedure laid out in the README, on a Fedora 28 VM. I'm using Elixir 1.6.5 and PostgreSQL 10.4. I got through installing the elixir dependencies and generating a config. I decided to copy config/generated_secret.exs
directly to config/dev.secret.exs
without alteration, run psql -f config/setup_db.psql
as the postgres superuser, and try running mix ecto.migrate
. The psql commands seem to execute alright, and the compile steps seem to go alright, but then Postgrex fails to connect to the database:
Generated pleroma app
[error] Postgrex.Protocol (#PID<0.793.0>) failed to connect: ** (Postgrex.Error) FATAL 28000 (invalid_authorization_specification): Ident authentication failed for user "pleroma"
[error] Could not retrieve migrated versions. This error usually happens due to the following:
* The database does not exist
* The "schema_migrations" table, which Ecto uses for managing
migrations, was defined by another library
To fix the first issue, run "mix ecto.create".
To address the second, you can run "mix ecto.drop" followed by
"mix ecto.create". Alternatively you may configure Ecto to use
another table for managing migrations:
config :pleroma, Pleroma.Repo,
migration_source: "some_other_table_for_schema_migrations"
The full error report is shown below.
** (DBConnection.ConnectionError) connection not available because of disconnection
(elixir) lib/keyword.ex:504: Keyword.delete_key/3
(elixir) lib/keyword.ex:501: Keyword.delete_key/3
(elixir) lib/keyword.ex:501: Keyword.delete_key/3
(elixir) lib/keyword.ex:493: Keyword.put/3
lib/pleroma/repo.ex:9: Pleroma.Repo.init/2
(ecto) lib/ecto/repo/supervisor.ex:24: Ecto.Repo.Supervisor.runtime_config/4
lib/pleroma/repo.ex:2: Pleroma.Repo.config/0
(ecto) lib/ecto/migrator.ex:316: Ecto.Migrator.verbose_schema_migration/3
(ecto) lib/ecto/migrator.ex:157: Ecto.Migrator.run/4
(ecto) lib/mix/tasks/ecto.migrate.ex:83: anonymous fn/4 in Mix.Tasks.Ecto.Migrate.run/2
(elixir) lib/enum.ex:737: Enum."-each/2-lists^foreach/1-0-"/2
(elixir) lib/enum.ex:737: Enum.each/2
(mix) lib/mix/task.ex:314: Mix.Task.run_task/3
(mix) lib/mix/cli.ex:80: Mix.CLI.run_task/2
(elixir) lib/code.ex:677: Code.require_file/2
I have to admit I'm very unfamiliar with databases in general and I'm afraid I may have bungled something in my initial configuration of PostgreSQL; I've basically just installed it from repo, run sudo postgresql-setup --initdb
, started and enabled it as a service, and configured my firewall to allow it; I'm not sure if I've missed any extra steps I'm supposed to take to get it properly configured.