wger-project / docker

Production...ish docker-compose image for wger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

password authentication failed for user "wger"

Compukid opened this issue · comments

commented

starting wger for the first time without changing anything I get the following error.

The above exception was the direct cause of the following exception:
wger_server |
wger_server | Traceback (most recent call last):
wger_server | File "/home/wger/src/manage.py", line 24, in
wger_server | execute_from_command_line(sys.argv)
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/core/management/init.py", line 442, in execute_from_command_line
wger_server | utility.execute()
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/core/management/init.py", line 436, in execute
wger_server | self.fetch_command(subcommand).run_from_argv(self.argv)
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/core/management/base.py", line 412, in run_from_argv
wger_server | self.execute(args, **cmd_options)
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/core/management/base.py", line 453, in execute
wger_server | self.check()
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/core/management/base.py", line 485, in check
wger_server | all_issues = checks.run_checks(
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/core/checks/registry.py", line 88, in run_checks
wger_server | new_errors = check(app_configs=app_configs, databases=databases)
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/core/checks/model_checks.py", line 36, in check_all_models
wger_server | errors.extend(model.check(**kwargs))
wger_server | File "/home/wger/src/wger/exercises/models/base.py", line 148, in check
wger_server | no_translations = cls.no_translations.all().count()
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/db/models/query.py", line 608, in count
wger_server | return self.query.get_count(using=self.db)
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/db/models/sql/query.py", line 568, in get_count
wger_server | return obj.get_aggregation(using, {"__count": Count("
")})["__count"]
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/db/models/sql/query.py", line 554, in get_aggregation
wger_server | result = compiler.execute_sql(SINGLE)
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/db/models/sql/compiler.py", line 1560, in execute_sql
wger_server | cursor = self.connection.cursor()
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/utils/asyncio.py", line 26, in inner
wger_server | return func(*args, **kwargs)
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/db/backends/base/base.py", line 330, in cursor
wger_server | return self._cursor()
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/db/backends/base/base.py", line 306, in _cursor
wger_server | self.ensure_connection()
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/utils/asyncio.py", line 26, in inner
wger_server | return func(*args, **kwargs)
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/db/backends/base/base.py", line 288, in ensure_connection
wger_server | with self.wrap_database_errors:
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/db/utils.py", line 91, in exit
wger_server | raise dj_exc_value.with_traceback(traceback) from exc_value
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/db/backends/base/base.py", line 289, in ensure_connection
wger_server | self.connect()
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/utils/asyncio.py", line 26, in inner
wger_server | return func(*args, **kwargs)
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/db/backends/base/base.py", line 270, in connect
wger_server | self.connection = self.get_new_connection(conn_params)
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/utils/asyncio.py", line 26, in inner
wger_server | return func(*args, **kwargs)
wger_server | File "/usr/local/lib/python3.10/dist-packages/django/db/backends/postgresql/base.py", line 275, in get_new_connection
wger_server | connection = self.Database.connect(**conn_params)
wger_server | File "/usr/local/lib/python3.10/dist-packages/psycopg2/init.py", line 122, in connect
wger_server | conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
wger_server | django.db.utils.OperationalError: connection to server at "db" (172.26.0.3), port 5432 failed: FATAL: password authentication failed for user "wger"

At first I changed all the passwords, but maybe I thought I did something wrong so I cloned the repo again in another location and ran it without changing any passwords or anything really and I still get the password authentication failed for user "wger" and don't understand why. can anyone help?

Hi! If you want to change the password for the database, you need to edit it in the compose file (db service, POSTGRES_USER and so on) as well as in the .env file (DJANGO_DB_DATABASE, etc). Also keep in mind that the db password is only set when the database is created the first time, just changing POSTGRES_USER won't do anything (the other settings are the ones the application will use during startup, you definitely can change those!). Also note that the db data is stored in the postgres-data volume, if you want/need to nuke it, docker volume rm docker_postgres-data

commented

Ohhhh, Ok.

I was watching a you-tuber and he mentioned to change the passwords, but I may have miss-understood what he said. I then cloned the git repository again in another folder without changing any password and it still didn't work, but this is because I didn't wipe anything out. If I am understanding you correctly I just wipe out the docker volume above and deploy again I should be fine. Unfortunately I am out and about and don't have time to try this. Can we please keep this open for a couple of days. I really want to try to get this running. It looks something I am interested in running and working with. Thank you for your patients.

commented

Ok, I wiped out all vloumes to start from scratch and the docker containers are running. I am no trying to get it behind a reverse proxy, wish me luck.

This issue can be closed, Thanks again!!!!!

sure, changing the passwords won't hurt! Also, the DB is not exposed to the outside, it's only used within the docker network.

And if you have troubles with the reverse proxy, just open a new issue 😄