Alexandre1972
Hi!
I’m new here.
I was reading this page:
https://hexdocs.pm/phoenix/up_and_running.html
And then, when I tried to run it, I’ve got this message:
19:26:35.127 [error] GenServer pid<0.259.0> terminating
** (Postgrex.Error) FATAL 28P01 (invalid_password) password authentication failed for user “postgres”
(db_connection 2.3.0) lib/db_connection/connection.ex:99: DBConnection.Connection.connect/2
(connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
(stdlib 3.13.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
** (Mix) The database for Hello.Repo couldn’t be created: killed
===
Does anybody know how can I fix?
Thank you for any help.
Alexandre.
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m aware of 2 such projects, are there others?
git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
Hi everyone.
My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
Hello folks!
So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
Hi,
we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
Hi all, I’m new here and would like to hear peoples views on my Elixir/Phoenix based game-engine! :smiley:
Mutonex gamedesign was finish...
New
Do we have maintainer of absinthe-graphql/dataloader here? We have a PR that we’d like to merge to the library. Relatively small additive...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with.
But I don’t use it anymore.
Serverless was the promis...
New
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
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #blog-post
- #ecto-query
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Loopers97
I’m assuming you’re on windows, Go into Program Files/PostgreSQL/12/data . Find and open the pg_hba.conf . Scroll to the bottom, and change the row with 127.0.0.1/32. Change the method from md5 to trust. Obviously, don’t do this on a production setup.
Alexandre1972
Loopers97, hi!
Thank you so much for your answer to my problem!
My O. S. is Debian Unstable/Sid (a Linux distro).
I’ve searched for this file using this command:
psql -t -P format=unaligned -c ‘show hba_file’
I saw this tip in the following website:
https://askubuntu.com/questions/256534/how-do-i-find-the-path-to-pg-hba-conf-from-the-shell
And then, I found out where it is:
/etc/postgresql/13/main/pg_hba.conf
Well, I made the changes, but I’ve got the same error message:
===
debian@sid:~/hello/hello$ mix ecto.create
23:47:49.715 [error] GenServer pid<0.259.0> terminating
** (Postgrex.Error) FATAL 28P01 (invalid_password) password authentication failed for user “postgres”
(db_connection 2.3.0) lib/db_connection/connection.ex:99: DBConnection.Connection.connect/2
(connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
(stdlib 3.13.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
** (Mix) The database for Hello.Repo couldn’t be created: killed
===
Alexandre.
Loopers97
I’m assuming you restarted the service after making the config change.
The logs makes it appear like the db is the issue, not ecto if that helps.
Try following this links guide. See if you can log in as postgres and get psql in the terminal. That’ll take ecto out from being a suspect.
https://chartio.com/resources/tutorials/how-to-set-the-default-user-password-in-postgresql/
Alexandre1972
Hi again Looper97!
today I made some progress!
I didn’t restarted the service, so, I googled to know how to do this. And then I followed the instructions on this page:
https://avroblog.com/en/blog/content/How-to-restart-PostgreSQL
And now, when I type the “mix ecto.create” command, the error message is different:
===
** (Mix) The database for Hello.Repo couldn’t be created: ERROR 22023 (invalid_parameter_value) encoding “UTF8” does not match locale “en_GB”
The chosen LC_CTYPE setting requires encoding “LATIN1”.
===
I will google again and try to find a solution, then I come back here and post what I found.
Thank you!
Alexandre1972
Hi again Loopers97!
Unfortunately, I was not sucessful… I regenerated my locales, using this command:
cd /usr/sbin
./dpkg-reconfigure locales
./locale-gen
But the error messages still are displayed to me:
===
** (Mix) The database for Hello.Repo couldn’t be created: ERROR 22023 (invalid_parameter_value) encoding “UTF8” does not match locale “en_GB”
The chosen LC_CTYPE setting requires encoding “LATIN1”.
===
I still need help …
Have you ever seen this problem before?
Loopers97
Progress is good. You’re dangerously close to getting postgres beat. The locale would have been set on the installation of postgres. I’m not sure what postgres locale defaults to. I’d recommend going digging into etc/lang.
Type locale and dump the output. I’m wondering if they’re all en_US.UTF-8
Loopers97
Here are the official docs for locale
tl;dr
The values that are chosen by
initdbare actually only written into the configuration filepostgresql.confto serve as defaults when the server is started. If you remove these assignments frompostgresql.confthen the server will inherit the settings from its execution environment. (server)Always have the option to Nuke and pick the locale, now that you have gained some more knowledge.
Alexandre1972
Hi again!
I have a lot of news to you!
Let’s go:
1) This is the what I get when I run the command locale:
debian@sid:~$ locale
LANG=en_GB
LANGUAGE=
LC_CTYPE=“en_GB”
LC_NUMERIC=“en_GB”
LC_TIME=“en_GB”
LC_COLLATE=“en_GB”
LC_MONETARY=“en_GB”
LC_MESSAGES=“en_GB”
LC_PAPER=“en_GB”
LC_NAME=“en_GB”
LC_ADDRESS=“en_GB”
LC_TELEPHONE=“en_GB”
LC_MEASUREMENT=“en_GB”
LC_IDENTIFICATION=“en_GB”
LC_ALL=
debian@sid:~$
2) Then I typed these commands in aterm:
root@sid:/usr/sbin# pg_dropcluster --stop 13 main
root@sid:/usr/sbin# pg_createcluster --locale en_GB.UTF-8 --start 13 main
Creating new PostgreSQL cluster 13/main …
/usr/lib/postgresql/13/bin/initdb -D /var/lib/postgresql/13/main --auth-local peer --auth-host md5 --locale en_GB.UTF-8
The files belonging to this database system will be owned by user “postgres”.
This user must also own the server process.
The database cluster will be initialized with locale “en_GB.UTF-8”.
The default database encoding has accordingly been set to “UTF8”.
The default text search configuration will be set to “english”.
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/13/main … ok
creating subdirectories … ok
selecting dynamic shared memory implementation … posix
selecting default max_connections … 100
selecting default shared_buffers … 128MB
selecting default time zone … America/Sao_Paulo
creating configuration files … ok
running bootstrap script … ok
performing post-bootstrap initialization … ok
syncing data to disk … ok
Success. You can now start the database server using:
Ver Cluster Port Status Owner Data directory Log file
13 main 5432 online postgres /var/lib/postgresql/13/main /var/log/postgresql/postgresql-13-main.log
root@sid:/usr/sbin# pg_ctlcluster 13 main start
3) Then, I tried the mix command again, and guess what? The first error message, I almost died:
debian@sid:~/hello/hello$ mix ecto.create
11:52:57.370 [error] GenServer pid<0.259.0> terminating
** (Postgrex.Error) FATAL 28P01 (invalid_password) password authentication failed for user “postgres”
(db_connection 2.3.0) lib/db_connection/connection.ex:99: DBConnection.Connection.connect/2
(connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
(stdlib 3.13.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
** (Mix) The database for Hello.Repo couldn’t be created: killed
debian@sid:~/hello/hello$
4) But then, I did what you’ve told, and changed the file called pg_hba.conf with the “trust” value;
5) Then I restarted the postgrsql using the command systemctl restart postgresql in Debian.
6) Then I came back to the “hello” directory and tried to type the “mix ecto.create” again… and then… Finally!!!
7) Everything is fine now!!!
I will try to paste a screenshot of my term in this post:
I couldn’t have done it without your help… Thank you so much for your patience…
Now I will be able to follow the other steps on the tutorial I was reading.
A BIG, BIG Thank you!
A bright and happy week for you and your family!!!
Alexandre.
Loopers97
That’s great news, happy coding.
Windsound
Thanks a lot! I have found my PostgreSQL folder and changed which made it working!
My PostgreSQL was installed at a different derive which is surprising to me.