fghaas / taiga-ansible

Ansible roles to deploy taiga.
GNU Affero General Public License v3.0
18 stars 14 forks source link

migrate database - FATAL: password authentication failed for user \"taiga\"\n #20

Open FortinFred opened 2 years ago

FortinFred commented 2 years ago

Hello, this is my first using an Ansible script so sorry if this is a basic miss understanding on my end.

I'm trying to create a taiga setup on a single host (Docker container right now for testing)

I'm getting the following error:

TASK [taiga-back : migrate database] **********************************************************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "cmd": "./manage.py migrate --noinput", "msg": "\n:stderr: Traceback (most recent call last):\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 217, in ensure_connection\n    self.connect()\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 195, in connect\n    self.connection = self.get_new_connection(conn_params)\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/db/backends/postgresql/base.py\", line 178, in get_new_connection\n    connection = Database.connect(**conn_params)\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/psycopg2/__init__.py\", line 127, in connect\n    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)\npsycopg2.OperationalError: FATAL:  password authentication failed for user \"taiga\"\nFATAL:  password authentication failed for user \"taiga\"\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n  File \"./manage.py\", line 27, in <module>\n    execute_from_command_line(sys.argv)\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/core/management/__init__.py\", line 381, in execute_from_command_line\n    utility.execute()\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/core/management/__init__.py\", line 375, in execute\n    self.fetch_command(subcommand).run_from_argv(self.argv)\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/core/management/base.py\", line 323, in run_from_argv\n    self.execute(*args, **cmd_options)\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/core/management/base.py\", line 364, in execute\n    output = self.handle(*args, **options)\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/core/management/base.py\", line 83, in wrapped\n    res = handle_func(*args, **kwargs)\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/core/management/commands/migrate.py\", line 87, in handle\n    executor = MigrationExecutor(connection, self.migration_progress_callback)\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/db/migrations/executor.py\", line 18, in __init__\n    self.loader = MigrationLoader(self.connection)\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/db/migrations/loader.py\", line 49, in __init__\n    self.build_graph()\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/db/migrations/loader.py\", line 212, in build_graph\n    self.applied_migrations = recorder.applied_migrations()\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/db/migrations/recorder.py\", line 73, in applied_migrations\n    if self.has_table():\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/db/migrations/recorder.py\", line 56, in has_table\n    return self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor())\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 256, in cursor\n    return self._cursor()\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 233, in _cursor\n    self.ensure_connection()\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 217, in ensure_connection\n    self.connect()\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/db/utils.py\", line 89, in __exit__\n    raise dj_exc_value.with_traceback(traceback) from exc_value\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 217, in ensure_connection\n    self.connect()\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 195, in connect\n    self.connection = self.get_new_connection(conn_params)\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/django/db/backends/postgresql/base.py\", line 178, in get_new_connection\n    connection = Database.connect(**conn_params)\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.8/site-packages/psycopg2/__init__.py\", line 127, in connect\n    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)\ndjango.db.utils.OperationalError: FATAL:  password authentication failed for user \"taiga\"\nFATAL:  password authentication failed for user \"taiga\"\n\n", "path": "/home/taiga/.virtualenvs/taiga/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin", "syspath": ["/tmp/ansible_django_manage_payload_dbv9cwgo/ansible_django_manage_payload.zip", "/usr/lib/python38.zip", "/usr/lib/python3.8", "/usr/lib/python3.8/lib-dynload", "/usr/local/lib/python3.8/dist-packages", "/usr/lib/python3/dist-packages"]}

The command I'm using is : ansible-playbook taiga.yml -e "@vars.yml" -i ./inventory

vars.yml

---
taiga_service_manager: systemd
taiga_secret_key: 'myverysecretsecret'
taiga_rabbitmq_password: 'myverysecretpassword'
taiga_enable_events: true

inventory

[taiga-back]
localhost ansible_connection=local

[taiga-front:children]
taiga-back

[taiga-events:children]
taiga-back
FortinFred commented 2 years ago

Probably related to...

TASK [taiga-back : create PostgreSQL user] ****************************************************************************************************************************************************************************************************************************************
[WARNING]: Module did not set no_log for no_password_changes
ok: [localhost]
fghaas commented 2 years ago

Hi, thanks for the report. I don't use Taiga at work anymore (sadly!) so I maintain this repo in my spare time. I'll try to take a look and see if I can reproduce your issue when I can (hopefully in the next few days).

Outs1d3r-Net commented 2 years ago

Hello, the solution is the password in the file:

/home/taiga/taiga-back/settings/common.py