Taiga-db not reachable from taiga-back on clean install

Because our old install was buggy to the point of being unusable, i decided to do a clean install in a new VM.

I followed the 30 minute guide but I already fail at

$ ./taiga-manage.sh createsuperuser

After that, the taiga-back container was gone. It also stops by itself after an uptime of 1-2 minutes. The logs say:

Executing pending migrations
Traceback (most recent call last):
File “/opt/venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 219, in ensure_connection
self.connect()
File “/opt/venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 33, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 200, in connect
self.connection = self.get_new_connection(conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 33, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/db/backends/postgresql/base.py”, line 187, in get_new_connection
connection = Database.connect(**conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/psycopg2/init.py”, line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.OperationalError: connection to server at “taiga-db” (172.18.0.2), port 5432 failed: Connection timed out
Is the server running on that host and accepting TCP/IP connections?

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/taiga-back/manage.py”, line 17, in
execute_from_command_line(sys.argv)
File “/opt/venv/lib/python3.11/site-packages/django/core/management/init.py”, line 419, in execute_from_command_line
utility.execute()
File “/opt/venv/lib/python3.11/site-packages/django/core/management/init.py”, line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/opt/venv/lib/python3.11/site-packages/django/core/management/base.py”, line 354, in run_from_argv
self.execute(*args, **cmd_options)
File “/opt/venv/lib/python3.11/site-packages/django/core/management/base.py”, line 398, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/core/management/base.py”, line 89, in wrapped
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/core/management/commands/migrate.py”, line 75, in handle
self.check(databases=[database])
File “/opt/venv/lib/python3.11/site-packages/django/core/management/base.py”, line 419, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/core/checks/registry.py”, line 76, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/core/checks/model_checks.py”, line 34, in check_all_models
errors.extend(model.check(**kwargs))
^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/db/models/base.py”, line 1303, in check
*cls._check_indexes(databases),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/db/models/base.py”, line 1695, in _check_indexes
connection.features.supports_covering_indexes or
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/utils/functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/db/backends/postgresql/features.py”, line 92, in is_postgresql_11
return self.connection.pg_version >= 110000
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/utils/functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/db/backends/postgresql/base.py”, line 329, in pg_version
with self.temporary_connection():
File “/usr/local/lib/python3.11/contextlib.py”, line 137, in enter
return next(self.gen)
^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 603, in temporary_connection
with self.cursor() as cursor:
^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 33, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 259, in cursor
return self._cursor()
^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 235, in _cursor
self.ensure_connection()
File “/opt/venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 33, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 218, in ensure_connection
with self.wrap_database_errors:
File “/opt/venv/lib/python3.11/site-packages/django/db/utils.py”, line 90, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File “/opt/venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 219, in ensure_connection
self.connect()
File “/opt/venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 33, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 200, in connect
self.connection = self.get_new_connection(conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 33, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/db/backends/postgresql/base.py”, line 187, in get_new_connection
connection = Database.connect(**conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/psycopg2/init.py”, line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django.db.utils.OperationalError: connection to server at “taiga-db” (172.18.0.2), port 5432 failed: Connection timed out
Is the server running on that host and accepting TCP/IP connections?

Not sure what to make of this, other than the fact that the db container seems to be unreachable. The taiga-db logs seem fine, though:

PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-09-23 11:01:03.290 UTC [1] LOG: starting PostgreSQL 12.3 (Debian 12.3-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
2024-09-23 11:01:03.291 UTC [1] LOG: listening on IPv4 address “0.0.0.0”, port 5432
2024-09-23 11:01:03.291 UTC [1] LOG: listening on IPv6 address “::”, port 5432
2024-09-23 11:01:03.295 UTC [1] LOG: listening on Unix socket “/var/run/postgresql/.s.PGSQL.5432”
2024-09-23 11:01:03.322 UTC [26] LOG: database system was shut down at 2024-09-23 10:54:07 UTC
2024-09-23 11:01:03.332 UTC [1] LOG: database system is ready to accept connections

What I checked:

  • they are both in the same docker networkd taiga-docker_taiga as long as they are running
  • I tried timeout 5 bash -c “echo > /dev/tcp/172.18.0.2/5432” && echo “Port is open” || echo “Port is closed or unreachable” from within taiga-back and got “Port is closed or unreachable”
  • The firewall does not interfere in any of these

So, I’m stumped. I had hoped for smooth sailing on a clean install and not to be struggling at the first steps. What can i do here?

Note: the only thing i did different than the guide was using docker-compose up -d instead of ./launch-taiga.sh as that didn’t work. Probably because i have the docker compose version with the hyphen installed.

Not official advise but i had simmilar issues following the 30 min guide.
I ended up using the guide here—> Install Taiga in Production

I installed from source making it easier to diagnose issues.
Somthing to note the source guide refrences in a few places rabbitmqhost
which i had to change to localhost. I now have a working install.

I had a lengthy fault find sesion but basicly just checked all the logs and with help of chatgpt scanning through logs guiding me on what to check next

Thanks for the answer!

Turned out, I had some old volumes hanging around. After deleting all volumes and recreating them, it finally worked.

1 Like