taigaio / taiga-docker

Mozilla Public License 2.0
1.22k stars 305 forks source link

Unable to create super user #90

Closed rsvcoder closed 1 year ago

rsvcoder commented 2 years ago

Hi , I have followed the github commands for installation and deployment of taiga-docker instance. I can access the Penpot & Taiga through web portal.

Commands executed are in this order: git clone https://github.com/kaleidos-ventures/taiga-docker cd taiga-docker git checkout stable ./launch-all.sh ./taiga-manage.sh createsuperuser

(I didn't change any parameter of docker-compose.yml or docker-compose-init.yml , just to be sure that I didn't change anything wrong by mistake) But I am getting error Password Authentication failed for user "taiga".

here is full log of error:

./taiga-manage.sh createsuperuser

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

Traceback (most recent call last): File "manage.py", line 17, in execute_from_command_line(sys.argv) File "/opt/venv/lib/python3.7/site-packages/django/core/management/init.py", line 381, in execute_from_command_line utility.execute() File "/opt/venv/lib/python3.7/site-packages/django/core/management/init.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/venv/lib/python3.7/site-packages/django/core/management/base.py", line 323, in run_from_argv self.execute(*args, *cmd_options) File "/opt/venv/lib/python3.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 61, in execute return super().execute(args, options) File "/opt/venv/lib/python3.7/site-packages/django/core/management/base.py", line 363, in execute self.check_migrations() File "/opt/venv/lib/python3.7/site-packages/django/core/management/base.py", line 453, in check_migrations executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS]) File "/opt/venv/lib/python3.7/site-packages/django/db/migrations/executor.py", line 18, in init self.loader = MigrationLoader(self.connection) File "/opt/venv/lib/python3.7/site-packages/django/db/migrations/loader.py", line 49, in init self.build_graph() File "/opt/venv/lib/python3.7/site-packages/django/db/migrations/loader.py", line 212, in build_graph self.applied_migrations = recorder.applied_migrations() File "/opt/venv/lib/python3.7/site-packages/django/db/migrations/recorder.py", line 73, in applied_migrations if self.has_table(): File "/opt/venv/lib/python3.7/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 "/opt/venv/lib/python3.7/site-packages/django/db/backends/base/base.py", line 256, in cursor return self._cursor() File "/opt/venv/lib/python3.7/site-packages/django/db/backends/base/base.py", line 233, in _cursor self.ensure_connection() File "/opt/venv/lib/python3.7/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection self.connect() File "/opt/venv/lib/python3.7/site-packages/django/db/utils.py", line 89, in exit raise dj_exc_value.with_traceback(traceback) from exc_value File "/opt/venv/lib/python3.7/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection self.connect() File "/opt/venv/lib/python3.7/site-packages/django/db/backends/base/base.py", line 195, in connect self.connection = self.get_new_connection(conn_params) File "/opt/venv/lib/python3.7/site-packages/django/db/backends/postgresql/base.py", line 178, in get_new_connection connection = Database.connect(conn_params) File "/opt/venv/lib/python3.7/site-packages/psycopg2/init.py", line 127, in connect conn = _connect(dsn, connection_factory=connection_factory, **kwasync) django.db.utils.OperationalError: FATAL: password authentication failed for user "taiga"

Any pointers to get this sort out?

raki5012 commented 2 years ago

I am also getting same issue...

yamila-moreno commented 2 years ago

Hi there, I'm not able to reproduce the error. After ./launch-all.sh ( without any editing)

geliris :: taiga-docker ‹stable› » docker ps -a
CONTAINER ID   IMAGE                            COMMAND                  CREATED          STATUS                   PORTS                                                                  NAMES
25f54760672a   taigaio/taiga-back:latest        "/taiga-back/docker/…"   13 seconds ago   Up 9 seconds             8000/tcp                                                               taiga-docker-taiga-async-1
b74056feb2da   nginx:1.19-alpine                "/docker-entrypoint.…"   13 seconds ago   Up 9 seconds             0.0.0.0:9000->80/tcp, :::9000->80/tcp                                  taiga-docker-taiga-gateway-1
d985124e1028   penpotapp/frontend:latest        "/bin/bash /entrypoi…"   13 seconds ago   Up 9 seconds             0.0.0.0:9001->80/tcp, :::9001->80/tcp                                  taiga-docker-penpot-frontend-1
86e736161c4f   taigaio/taiga-back:latest        "./docker/entrypoint…"   13 seconds ago   Up 10 seconds            8000/tcp                                                               taiga-docker-taiga-back-1
12573ba0909f   penpotapp/backend:latest         "/bin/bash run.sh"       13 seconds ago   Up 10 seconds                                                                                   taiga-docker-penpot-backend-1
58c65fd2bad1   taigaio/taiga-events:latest      "./docker/entrypoint…"   13 seconds ago   Up 10 seconds            8888/tcp                                                               taiga-docker-taiga-events-1
4046a6e3e530   postgres:12.3                    "docker-entrypoint.s…"   13 seconds ago   Up 11 seconds            5432/tcp                                                               taiga-docker-taiga-db-1
4b5787758144   postgres:13                      "docker-entrypoint.s…"   13 seconds ago   Up 11 seconds            5432/tcp                                                               taiga-docker-penpot-postgres-1
c023e8539f21   penpotapp/exporter:latest        "/usr/local/nodejs/b…"   13 seconds ago   Up 11 seconds                                                                                   taiga-docker-penpot-exporter-1
975dddbcd447   rabbitmq:3.8-management-alpine   "docker-entrypoint.s…"   13 seconds ago   Up 11 seconds            4369/tcp, 5671-5672/tcp, 15671-15672/tcp, 15691-15692/tcp, 25672/tcp   taiga-docker-taiga-async-rabbitmq-1
49c3da1b888f   rabbitmq:3.8-management-alpine   "docker-entrypoint.s…"   13 seconds ago   Up 11 seconds            4369/tcp, 5671-5672/tcp, 15671-15672/tcp, 15691-15692/tcp, 25672/tcp   taiga-docker-taiga-events-rabbitmq-1
80e416d5f107   taigaio/taiga-protected:latest   "./docker/entrypoint…"   13 seconds ago   Up 11 seconds            8003/tcp                                                               taiga-docker-taiga-protected-1
c9273d49d169   taigaio/taiga-front:latest       "/docker-entrypoint.…"   13 seconds ago   Up 11 seconds            80/tcp                                                                 taiga-docker-taiga-front-1
4dd760f07f76   redis:6                          "docker-entrypoint.s…"   13 seconds ago   Up 11 seconds            6379/tcp                                                               taiga-docker-penpot-redis-1

As every container is up and running, I try the next step:

geliris :: taiga-docker ‹stable› » ./taiga-manage.sh createsuperuser
+ exec docker-compose -f docker-compose.yml -f docker-compose-inits.yml run --rm taiga-manage createsuperuser
WARN[0000] Found orphan containers ([taiga-docker-penpot-frontend-1 taiga-docker-penpot-backend-1 taiga-docker-penpot-postgres-1 taiga-docker-penpot-exporter-1 taiga-docker-penpot-redis-1]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up. 
[+] Running 1/0
 ⠿ Container taiga-docker-taiga-db-1  Running                                                                                                                                                                                                                               0.0s
Username: admin
Email address: admin@admin.com
Password: 
Password (again): 
Superuser created successfully.

It works ok as far as I can test. Some checks I can think of:

dnsoumik commented 2 years ago
soumik@SMK-L:~/vbuild/taiga-docker$ sudo docker ps -a
CONTAINER ID   IMAGE                            COMMAND                  CREATED          STATUS                      PORTS                                                                  NAMES
67b20ae2140f   nginx:1.19-alpine                "/docker-entrypoint.…"   21 minutes ago   Exited (1) 21 minutes ago                                                                          taiga-docker_taiga-gateway_1
67528ccc426c   taigaio/taiga-back:latest        "/taiga-back/docker/…"   21 minutes ago   Up 21 minutes               8000/tcp                                                               taiga-docker_taiga-async_1
7f78b56a2bef   taigaio/taiga-back:latest        "./docker/entrypoint…"   21 minutes ago   Exited (1) 21 minutes ago                                                                          taiga-docker_taiga-back_1
d838eb54f822   penpotapp/frontend:latest        "/bin/bash /entrypoi…"   41 minutes ago   Up 41 minutes               0.0.0.0:9001->80/tcp, :::9001->80/tcp                                  taiga-docker_penpot-frontend_1
a97ffc84ad75   penpotapp/backend:latest         "/bin/bash run.sh"       41 minutes ago   Up 41 minutes                                                                                      taiga-docker_penpot-backend_1
b26e8e577280   taigaio/taiga-events:latest      "./docker/entrypoint…"   41 minutes ago   Up 41 minutes               8888/tcp                                                               taiga-docker_taiga-events_1
68665cdc27fc   rabbitmq:3.8-management-alpine   "docker-entrypoint.s…"   41 minutes ago   Up 41 minutes               4369/tcp, 5671-5672/tcp, 15671-15672/tcp, 15691-15692/tcp, 25672/tcp   taiga-docker_taiga-async-rabbitmq_1
cb1b9e847858   redis:6                          "docker-entrypoint.s…"   41 minutes ago   Up 41 minutes               6379/tcp                                                               taiga-docker_penpot-redis_1
877a0078d753   taigaio/taiga-front:latest       "/docker-entrypoint.…"   41 minutes ago   Up 41 minutes               80/tcp                                                                 taiga-docker_taiga-front_1
9b86a4fda09b   taigaio/taiga-protected:latest   "./docker/entrypoint…"   41 minutes ago   Up 41 minutes               8003/tcp                                                               taiga-docker_taiga-protected_1
ba63e4e7b031   postgres:13                      "docker-entrypoint.s…"   41 minutes ago   Up 41 minutes               5432/tcp                                                               taiga-docker_penpot-postgres_1
ae0b60c321e4   penpotapp/exporter:latest        "/usr/local/nodejs/b…"   41 minutes ago   Up 41 minutes                                                                                      taiga-docker_penpot-exporter_1
59e931f22f7d   rabbitmq:3.8-management-alpine   "docker-entrypoint.s…"   41 minutes ago   Up 41 minutes               4369/tcp, 5671-5672/tcp, 15671-15672/tcp, 15691-15692/tcp, 25672/tcp   taiga-docker_taiga-events-rabbitmq_1
52f0e03ce266   postgres:12.3                    "docker-entrypoint.s…"   41 minutes ago   Up 41 minutes               5432/tcp                                                               taiga-docker_taiga-db_1

This is the result currently with the same issue

dnsoumik commented 2 years ago

`soumik@SMK-L:~/vbuild/taiga-docker$ sudo ./taiga-manage.sh createsuperuser

You have 260 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, attachments, auth, bitbucket, contact, contenttypes, custom_attributes, djmail, easy_thumbnails, epics, external_apps, feedback, github, gitlab, gogs, history, issues, likes, milestones, notifications, projects, references, sessions, settings, tasks, telemetry, timeline, token_denylist, users, userstorage, userstories, votes, webhooks, wiki. Run 'python manage.py migrate' to apply them.

Username: admin
Traceback (most recent call last): File "/opt/venv/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) psycopg2.errors.UndefinedTable: relation "users_user" does not exist LINE 1: ...sers_user"."max_memberships_public_projects" FROM "users_use... ^

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

Traceback (most recent call last): File "manage.py", line 17, in execute_from_command_line(sys.argv) File "/opt/venv/lib/python3.7/site-packages/django/core/management/init.py", line 381, in execute_from_command_line utility.execute() File "/opt/venv/lib/python3.7/site-packages/django/core/management/init.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/venv/lib/python3.7/site-packages/django/core/management/base.py", line 323, in run_from_argv self.execute(*args, cmd_options) File "/opt/venv/lib/python3.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 61, in execute return super().execute(*args, *options) File "/opt/venv/lib/python3.7/site-packages/django/core/management/base.py", line 364, in execute output = self.handle(args, options) File "/opt/venv/lib/python3.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 95, in handle error_msg = self._validate_username(username, verbose_field_name, database) File "/opt/venv/lib/python3.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 201, in _validate_username self.UserModel._default_manager.db_manager(database).get_by_natural_key(username) File "/opt/venv/lib/python3.7/site-packages/django/contrib/auth/base_user.py", line 44, in get_by_natural_key return self.get(*{self.model.USERNAME_FIELD: username}) File "/opt/venv/lib/python3.7/site-packages/django/db/models/manager.py", line 82, in manager_method return getattr(self.get_queryset(), name)(args, **kwargs) File "/opt/venv/lib/python3.7/site-packages/django/db/models/query.py", line 402, in get num = len(clone) File "/opt/venv/lib/python3.7/site-packages/django/db/models/query.py", line 256, in len self._fetch_all() File "/opt/venv/lib/python3.7/site-packages/django/db/models/query.py", line 1242, in _fetch_all self._result_cache = list(self._iterable_class(self)) File "/opt/venv/lib/python3.7/site-packages/django/db/models/query.py", line 55, in iter results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) File "/opt/venv/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1142, in execute_sql cursor.execute(sql, params) File "/opt/venv/lib/python3.7/site-packages/raven/contrib/django/client.py", line 127, in execute return real_execute(self, sql, params) File "/opt/venv/lib/python3.7/site-packages/django/db/backends/utils.py", line 67, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/opt/venv/lib/python3.7/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers return executor(sql, params, many, context) File "/opt/venv/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/opt/venv/lib/python3.7/site-packages/django/db/utils.py", line 89, in exit raise dj_exc_value.with_traceback(traceback) from exc_value File "/opt/venv/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) django.db.utils.ProgrammingError: relation "users_user" does not exist LINE 1: ...sers_user"."max_memberships_public_projects" FROM "users_use... ^ ` Same

cindrmon commented 2 years ago

Hi there, I'm not able to reproduce the error. After ./launch-all.sh ( without any editing)

geliris :: taiga-docker ‹stable› » docker ps -a
CONTAINER ID   IMAGE                            COMMAND                  CREATED          STATUS                   PORTS                                                                  NAMES
25f54760672a   taigaio/taiga-back:latest        "/taiga-back/docker/…"   13 seconds ago   Up 9 seconds             8000/tcp                                                               taiga-docker-taiga-async-1
b74056feb2da   nginx:1.19-alpine                "/docker-entrypoint.…"   13 seconds ago   Up 9 seconds             0.0.0.0:9000->80/tcp, :::9000->80/tcp                                  taiga-docker-taiga-gateway-1
d985124e1028   penpotapp/frontend:latest        "/bin/bash /entrypoi…"   13 seconds ago   Up 9 seconds             0.0.0.0:9001->80/tcp, :::9001->80/tcp                                  taiga-docker-penpot-frontend-1
86e736161c4f   taigaio/taiga-back:latest        "./docker/entrypoint…"   13 seconds ago   Up 10 seconds            8000/tcp                                                               taiga-docker-taiga-back-1
12573ba0909f   penpotapp/backend:latest         "/bin/bash run.sh"       13 seconds ago   Up 10 seconds                                                                                   taiga-docker-penpot-backend-1
58c65fd2bad1   taigaio/taiga-events:latest      "./docker/entrypoint…"   13 seconds ago   Up 10 seconds            8888/tcp                                                               taiga-docker-taiga-events-1
4046a6e3e530   postgres:12.3                    "docker-entrypoint.s…"   13 seconds ago   Up 11 seconds            5432/tcp                                                               taiga-docker-taiga-db-1
4b5787758144   postgres:13                      "docker-entrypoint.s…"   13 seconds ago   Up 11 seconds            5432/tcp                                                               taiga-docker-penpot-postgres-1
c023e8539f21   penpotapp/exporter:latest        "/usr/local/nodejs/b…"   13 seconds ago   Up 11 seconds                                                                                   taiga-docker-penpot-exporter-1
975dddbcd447   rabbitmq:3.8-management-alpine   "docker-entrypoint.s…"   13 seconds ago   Up 11 seconds            4369/tcp, 5671-5672/tcp, 15671-15672/tcp, 15691-15692/tcp, 25672/tcp   taiga-docker-taiga-async-rabbitmq-1
49c3da1b888f   rabbitmq:3.8-management-alpine   "docker-entrypoint.s…"   13 seconds ago   Up 11 seconds            4369/tcp, 5671-5672/tcp, 15671-15672/tcp, 15691-15692/tcp, 25672/tcp   taiga-docker-taiga-events-rabbitmq-1
80e416d5f107   taigaio/taiga-protected:latest   "./docker/entrypoint…"   13 seconds ago   Up 11 seconds            8003/tcp                                                               taiga-docker-taiga-protected-1
c9273d49d169   taigaio/taiga-front:latest       "/docker-entrypoint.…"   13 seconds ago   Up 11 seconds            80/tcp                                                                 taiga-docker-taiga-front-1
4dd760f07f76   redis:6                          "docker-entrypoint.s…"   13 seconds ago   Up 11 seconds            6379/tcp                                                               taiga-docker-penpot-redis-1

As every container is up and running, I try the next step:

geliris :: taiga-docker ‹stable› » ./taiga-manage.sh createsuperuser
+ exec docker-compose -f docker-compose.yml -f docker-compose-inits.yml run --rm taiga-manage createsuperuser
WARN[0000] Found orphan containers ([taiga-docker-penpot-frontend-1 taiga-docker-penpot-backend-1 taiga-docker-penpot-postgres-1 taiga-docker-penpot-exporter-1 taiga-docker-penpot-redis-1]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up. 
[+] Running 1/0
 ⠿ Container taiga-docker-taiga-db-1  Running                                                                                                                                                                                                                               0.0s
Username: admin
Email address: admin@admin.com
Password: 
Password (again): 
Superuser created successfully.

It works ok as far as I can test. Some checks I can think of:

* Can you check if all containers are up and running before you launch the createsuperuser script?

* Can you execute `git diff` and verify there is no edition in the files?

* Can you enter the database? `docker exec -ti taiga-docker-taiga-db-1 psql -U taiga taiga`

i can connect to the postgresql database. i don't understand why this troubles me as well

yamila-moreno commented 2 years ago

Hi there,

@dnsoumik in your logs there are two things to have into account:

  1. _WARNING: Found orphan containers (taiga-docker_penpot-exporter_1, taiga-docker_penpot-postgres_1, taiga-docker_penpot-redis_1, taiga-docker_penpot-backend_1, taiga-docker_penpot-frontend_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up. Creating taiga-docker_taiga-managerun ... done This warning. Maybe you are executing this docker-compose from different places or users? First, you should "clean" the environment

  2. You have 260 unapplied migration(s). This is typically because you're executing "createsuperuser" before everything is up and running. Depending on the computer, you may have to wait a couple minutes. docker-compose ps will tell you if everytihng is Up and then you can proceed with createsuperuser. The error says there is no relation (table) because the migrations have not been applied.

Your docker ps -a show two containers Exited, nginx and the API. Check their logs to have more information about what's wrong with: docker logs --tail 200 taiga-docker_taiga-gateway_1 docker logs --tail 200 taiga-docker_taiga-back_1

Cheers!

HighOnMikey commented 2 years ago

There's a race condition where the taiga-back service will crash if the database isn't ready. docker compose restart taiga-back should address this. The additional healthcheck parameters in #94 successfully delay starting taiga-back until the database is ready.

If you're here because you experienced this from a fresh install and also happen to have an error message on the /discover page, then it's likely you'll need to replace any instance of localhost:9000 inside docker-compose.yml and docker-compose.penpot.env with the correct IP or hostname.