Docker does not start
Closed this issue · 16 comments
When i starte the Docker with the Docker-Compose file, but i get the following error in the log-files
`
Initializing database...
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection
self.connect()
File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 195, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 178, in get_new_connection
connection = Database.connect(**conn_params)
File "/usr/local/lib/python3.6/site-packages/psycopg2/init.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 27, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.6/site-packages/django/core/management/init.py", line 381, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.6/site-packages/django/core/management/init.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 83, in wrapped
res = handle_func(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 87, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
File "/usr/local/lib/python3.6/site-packages/django/db/migrations/executor.py", line 18, in init
self.loader = MigrationLoader(self.connection)
File "/usr/local/lib/python3.6/site-packages/django/db/migrations/loader.py", line 49, in init
self.build_graph()
File "/usr/local/lib/python3.6/site-packages/django/db/migrations/loader.py", line 212, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/usr/local/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 73, in applied_migrations
if self.has_table():
File "/usr/local/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 56, in has_table
return self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor())
File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 256, in cursor
return self._cursor()
File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 233, in _cursor
self.ensure_connection()
File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection
self.connect()
File "/usr/local/lib/python3.6/site-packages/django/db/utils.py", line 89, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection
self.connect()
File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 195, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 178, in get_new_connection
connection = Database.connect(**conn_params)
File "/usr/local/lib/python3.6/site-packages/psycopg2/init.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
`
version: "2"
services:
taiga:
build: .
image:
nemonik/taiga:latest
restart: always
environment:
- DEBUG=True
- HOST=127.0.0.1
- PORT=80
- SCHEME=http
- DB_HOST=10.10.200.1
- DB_PORT=5432
- DB_NAME=taiga_db
- DB_USER=taigauser
- DB_PASSWORD=***
volumes:
- ./volumes/media:/taiga/media:Z
- ./volumes/static:/taiga/static:Z
ports:
- "80:8080"
I would like to use an already existing Postgres database.
my db is listen at 10.10.200.1
i already install wiki.js correctly with this db settings:
DB_TYPE: postgres
DB_HOST: 10.10.200.1
DB_PORT: 5432
DB_USER: wikijs
DB_PASS: ***
DB_NAME: wikijs_db
For taiga i create a new user and db
So i think the the database should be accessible.
I just looked into the log files of my database.
There I get the following error
Connection matched pg_hba.conf line 99: "host all all all md5"
2021-03-29 16:32:28.456 UTC [896] FATAL: password authentication failed for user "default"
2021-03-29 16:32:28.456 UTC [896] DETAIL: Role "default" does not exist.
When i start the Docker with the docker-compose file from the readme, i get the same error
# Copyright (C) 2021 Michael Joseph Walsh - All Rights Reserved
# You may use, distribute and modify this code under the
# terms of the the license.
#
# You should have received a copy of the license with
# this file. If not, please email <github.com@nemonik.com>
version: "2"
services:
postgresql:
image:
sameersbn/postgresql:10-2
restart: always
environment:
- DB_NAME=taigadb
- DB_USER=taiga
- DB_PASS=password
volumes:
- ./volumes/postgresql/var/lib/postgresql:/var/lib/postgresql:Z
ports:
- "5432"
taiga:
image:
nemonik/taiga:latest
restart: always
environment:
- DEBUG=True
- HOST=127.0.0.1
- PORT=80
- SCHEME=http
- DB_HOST=postgresql
- DB_PORT=5432
- DB_NAME=taigadb
- DB_USER=taiga
- DB_PASSWORD=password
# - LDAP_SERVER=ldap://FDQN
# - LDAP_PORT=389
# - LDAP_BIND_DN=uid=SERVICE ACCOUNT DN
# - LDAP_BIND_PASSWORD=PASSWORD
# - LDAP_SEARCH_BASE=BASE DN FOR USERS
# - LDAP_SEARCH_FILTER_ADDITIONAL=(uid=*)
# - LDAP_EMAIL_ATTRIBUTE=mail
# - LDAP_FULL_NAME_ATTRIBUTE=cn
# - LDAP_USERNAME_ATTRIBUTE=uid
volumes:
- ./volumes/media:/taiga/media:Z
- ./volumes/static:/taiga/static:Z
ports:
- "80:8080"
depends_on:
- postgresql
Log from taiga docker
django.db.utils.OperationalError: could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
When i go into the container and run
psql --host=10.10.200.1 --port=5432 --username=taigauser --dbname=taiga_db
i can connect to my database
I just looked into the log files of my database.
There I get the following errorConnection matched pg_hba.conf line 99: "host all all all md5" 2021-03-29 16:32:28.456 UTC [896] FATAL: password authentication failed for user "default" 2021-03-29 16:32:28.456 UTC [896] DETAIL: Role "default" does not exist.
So it would appear your Taiga container can reach your database, but your user in the database doesn't have a default role or some such. I would advise to look there...
When i start the Docker with the docker-compose file from the readme, i get the same error
# Copyright (C) 2021 Michael Joseph Walsh - All Rights Reserved # You may use, distribute and modify this code under the # terms of the the license. # # You should have received a copy of the license with # this file. If not, please email <github.com@nemonik.com> version: "2" services: postgresql: image: sameersbn/postgresql:10-2 restart: always environment: - DB_NAME=taigadb - DB_USER=taiga - DB_PASS=password volumes: - ./volumes/postgresql/var/lib/postgresql:/var/lib/postgresql:Z ports: - "5432" taiga: image: nemonik/taiga:latest restart: always environment: - DEBUG=True - HOST=127.0.0.1 - PORT=80 - SCHEME=http - DB_HOST=postgresql - DB_PORT=5432 - DB_NAME=taigadb - DB_USER=taiga - DB_PASSWORD=password # - LDAP_SERVER=ldap://FDQN # - LDAP_PORT=389 # - LDAP_BIND_DN=uid=SERVICE ACCOUNT DN # - LDAP_BIND_PASSWORD=PASSWORD # - LDAP_SEARCH_BASE=BASE DN FOR USERS # - LDAP_SEARCH_FILTER_ADDITIONAL=(uid=*) # - LDAP_EMAIL_ATTRIBUTE=mail # - LDAP_FULL_NAME_ATTRIBUTE=cn # - LDAP_USERNAME_ATTRIBUTE=uid volumes: - ./volumes/media:/taiga/media:Z - ./volumes/static:/taiga/static:Z ports: - "80:8080" depends_on: - postgresql
Log from taiga docker
django.db.utils.OperationalError: could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?
I will verify later this evening.
Yeah there is an issue with the latest changes to taiga... ashort work around would be to pull an imagefrom 4 months ago, modify the docker-compose to use... spin that up and then docker-compose stop and rm, and then pull the latest taiga container image, update the docker-compose to use... the dicker-compose up... the database seemed to work for me... looking for a fix.
This project came out of the need to run a containerized Taiga about 3 years ago, but since the Taiga project has a canonical solution I'd advise you to use https://github.com/taigaio/taiga-docker. This is what I plan to do... and so I likely icebox this project... Remember if you're going to run you postgresql externally you'll want to update its configuration to trust Taiga.
Okay,
Thanks for the quick help and the friendly conversation. I will follow your recommendation and have a look at the taiga docker.
Thanks a lot and have a nice day/evening
The latest Taiga doesn't appear to come with the default admin/123123 account any more... I was able to get my image up, but I think it is best to us the canonical images... as I wrote earlier. I'm likely to open a project to write a Kuberenetes deployment or helm chart for...
@mkueh I created a Helm chart (https://github.com/nemonik/taiga-helm) based of the docker-compose work found at https://github.com/taigaio/taiga-docker in case your still in the market for spinning up a Taiga and want to do so on Kubernetes.