Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 2024.8 no longer starts #11371

Open
divin31 opened this issue Sep 13, 2024 · 13 comments
Open

version 2024.8 no longer starts #11371

divin31 opened this issue Sep 13, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@divin31
Copy link

divin31 commented Sep 13, 2024

Describe the bug
I've been using Authentik for more than a year now, always with the latest update.
After the recent update (2024.8), Authentik server and worker keeps reboot looping.
Also tried updating postgres from 12 to 16, but it resulted the same problem, even when I start with a fresh postgres db.
If I set the tags for server and worker to 2024.6, it starts working again normally as before.

docker compose:

version: "3.4"
services:
  postgresql:
    image: docker.io/library/postgres:16-alpine
    restart: on-failure:5
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
      start_period: 20s
      interval: 30s
      retries: 5
      timeout: 5s
    networks:
      - authentik-net
    volumes:
      - /volume1/docker/Authentik/postgres:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: ${PG_PASS:?database password required}
      POSTGRES_USER: ${PG_USER:-authentik}
      POSTGRES_DB: ${PG_DB:-authentik}
    env_file:
      - stack.env
  redis:
    image: docker.io/library/redis:alpine
    command: --save 60 1 --loglevel warning
    restart: on-failure:5
    networks:
      - authentik-net
    healthcheck:
      test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
      start_period: 20s
      interval: 30s
      retries: 5
      timeout: 3s
    volumes:
      - /volume1/docker/Authentik/redis:/data
  server:
    image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-latest}
    restart: on-failure:5
    command: server
    networks:
      - authentik-net
    environment:
      AUTHENTIK_REDIS__HOST: redis
      AUTHENTIK_POSTGRESQL__HOST: postgresql
      AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik}
      AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik}
      AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS}
      AUTHENTIK_LOG_LEVEL: warning
    user: root
    volumes:
      - /volume1/docker/Authentik/media:/media
      - /volume1/docker/Authentik/custom-templates:/templates
    env_file:
      - stack.env
    ports:
      - "${COMPOSE_PORT_HTTP:-9001}:9000"
      - "${COMPOSE_PORT_HTTPS:-9443}:9443"
    depends_on:
      - postgresql
      - redis
  worker:
    image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-latest}
    restart: on-failure:5
    command: worker
    networks:
      - authentik-net
    environment:
      AUTHENTIK_REDIS__HOST: redis
      AUTHENTIK_POSTGRESQL__HOST: postgresql
      AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik}
      AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik}
      AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS}
      AUTHENTIK_LOG_LEVEL: warning
    # `user: root` and the docker socket volume are optional.
    # See more for the docker socket integration here:
    # https://goauthentik.io/docs/outposts/integrations/docker
    # Removing `user: root` also prevents the worker from fixing the permissions
    # on the mounted folders, so when removing this make sure the folders have the correct UID/GID
    # (1000:1000 by default)
    user: root
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /volume1/docker/Authentik/media:/media
      - /volume1/docker/Authentik/certs:/certs
      - /volume1/docker/Authentik/custom-templates:/templates
    env_file:
      - stack.env
    depends_on:
      - postgresql
      - redis
    labels:
      autoheal: "true"
  autoheal:
    restart: on-failure:5
    image: willfarrell/autoheal
    environment:
      - AUTOHEAL_CONTAINER_LABEL=autoheal
    networks:
      - authentik-net
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      
volumes:
  database:
    driver: local
  redis:
    driver: local

networks:
  authentik-net:
    name: authentik-net
    ipam:
      config:
        - subnet: 192.168.49.0/24

Update:

Initially I used only these evn variables:

PG_PASS=
AUTHENTIK_SECRET_KEY=

Later tried adding these as well:

AUTHENTIK_HOST=
AUTHENTIK_LOG_LEVEL=warning
DOMAIN=
HOST_DOMAIN=
AUTHENTIK_TAG=

To Reproduce
Steps to reproduce the behavior:

update to 2024.8

Expected behavior
to work after update

Screenshots

Logs

Server:

2024/09/13 18:16:43 stderr Traceback (most recent call last):
2024/09/13 18:16:43 stderr  
2024/09/13 18:16:43 stderr The above exception was the direct cause of the following exception:
2024/09/13 18:16:43 stderr  
2024/09/13 18:16:43 stderr psycopg.errors.DuplicateTable: relation "authentik_tenants_domain" already exists
2024/09/13 18:16:43 stderr raise ex.with_traceback(None)
2024/09/13 18:16:43 stderr File "/ak-root/venv/lib/python3.12/site-packages/psycopg/cursor.py", line 97, in execute
2024/09/13 18:16:43 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:16:43 stderr return super().execute(*args, **kwargs)
2024/09/13 18:16:43 stderr File "/ak-root/venv/lib/python3.12/site-packages/django_prometheus/db/common.py", line 69, in execute
2024/09/13 18:16:43 stderr ^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:16:43 stderr return self.cursor.execute(sql)
2024/09/13 18:16:43 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 103, in _execute
2024/09/13 18:16:43 stderr Traceback (most recent call last):
2024/09/13 18:16:43 stderr Failed to read config file: ./lifecycle/gunicorn.conf.py
2024/09/13 18:16:40 stdout Applying authentik_tenants.0001_initial...
2024/09/13 18:16:40 stdout Running migrations:
2024/09/13 18:16:40 stdout Apply all migrations: auth, authentik_blueprints, authentik_brands, authentik_core, authentik_crypto, authentik_enterprise, authentik_events, authentik_flows, authentik_outposts, authentik_policies, authentik_policies_dummy, authentik_policies_event_matcher, authentik_policies_expiry, authentik_policies_expression, authentik_policies_geoip, authentik_policies_password, authentik_policies_reputation, authentik_providers_google_workspace, authentik_providers_ldap, authentik_providers_microsoft_entra, authentik_providers_oauth2, authentik_providers_proxy, authentik_providers_rac, authentik_providers_radius, authentik_providers_saml, authentik_providers_scim, authentik_rbac, authentik_sources_ldap, authentik_sources_oauth, authentik_sources_plex, authentik_sources_saml, authentik_sources_scim, authentik_stages_authenticator_duo, authentik_stages_authenticator_sms, authentik_stages_authenticator_static, authentik_stages_authenticator_totp, authentik_stages_authenticator_validate, authentik_stages_authenticator_webauthn, authentik_stages_captcha, authentik_stages_consent, authentik_stages_deny, authentik_stages_dummy, authentik_stages_email, authentik_stages_identification, authentik_stages_invitation, authentik_stages_password, authentik_stages_prompt, authentik_stages_source, authentik_stages_user_delete, authentik_stages_user_login, authentik_stages_user_logout, authentik_stages_user_write, authentik_tenants, contenttypes, guardian, sessions
2024/09/13 18:16:40 stdout Operations to perform:
2024/09/13 18:16:40 stdout === Starting migration
2024/09/13 18:16:38 stderr {"error":"authentik starting","event":"failed to proxy to backend","level":"warning","logger":"authentik.router","timestamp":"2024-09-13T15:16:38Z"}
2024/09/13 18:16:36 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240595.06029, "path": "authentik.providers.scim.settings"}
2024/09/13 18:16:36 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240595.0597186, "path": "authentik.sources.plex.settings"}
2024/09/13 18:16:36 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240595.0591445, "path": "authentik.enterprise.providers.google_workspace.settings"}
2024/09/13 18:16:36 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240595.0583405, "path": "authentik.admin.settings"}
2024/09/13 18:16:36 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240595.057547, "path": "authentik.blueprints.settings"}
2024/09/13 18:16:36 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240595.0565333, "path": "authentik.enterprise.settings"}
2024/09/13 18:16:36 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240595.0551667, "path": "authentik.enterprise.providers.microsoft_entra.settings"}
2024/09/13 18:16:36 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240595.0545328, "path": "authentik.stages.authenticator_totp.settings"}
2024/09/13 18:16:36 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240595.051584, "path": "authentik.events.settings"}
2024/09/13 18:16:36 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240595.0499084, "path": "authentik.crypto.settings"}
2024/09/13 18:16:36 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240595.0482087, "path": "authentik.sources.oauth.settings"}
2024/09/13 18:16:36 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240595.047625, "path": "authentik.outposts.settings"}
2024/09/13 18:16:36 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240595.0466483, "path": "authentik.stages.authenticator_webauthn.settings"}
2024/09/13 18:16:36 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240595.0458624, "path": "authentik.sources.ldap.settings"}
2024/09/13 18:16:36 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240595.0416088, "path": "authentik.enterprise.settings"}
2024/09/13 18:16:36 stderr {"event": "Enabled authentik enterprise", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240595.040495}
2024/09/13 18:16:35 stderr {"event": "Booting authentik", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240595.0376582, "version": "2024.8.1"}
2024/09/13 18:16:33 stdout 2024-09-13 15:16:33 [info     ] applying django migrations
2024/09/13 18:16:33 stdout 2024-09-13 15:16:33 [info     ] waiting to acquire database lock
2024/09/13 18:16:33 stderr {"event": "Finished authentik bootstrap", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240593.1844525}
2024/09/13 18:16:33 stderr {"event": "Redis Connection successful", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240593.184325}
2024/09/13 18:16:33 stderr {"event": "PostgreSQL connection successful", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240593.182697}
2024/09/13 18:16:33 stderr {"event": "Starting authentik bootstrap", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240593.1738296}
2024/09/13 18:16:32 stderr {"event": "Loaded environment variables", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240592.128746, "count": 8}
2024/09/13 18:16:32 stderr {"event": "Loaded config", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240592.1283567, "file": "/authentik/lib/default.yml"}
2024/09/13 18:16:32 stderr {"error":"exit status 1","event":"gunicorn failed to start, restarting","level":"error","logger":"authentik.router","timestamp":"2024-09-13T15:16:31Z"}
2024/09/13 18:16:32 stderr {"error":"exit status 1","event":"gunicorn process died, restarting","level":"warning","logger":"authentik.router","timestamp":"2024-09-13T15:16:31Z"}
2024/09/13 18:16:32 stderr django.db.utils.ProgrammingError: relation "authentik_tenants_domain" already exists
2024/09/13 18:16:32 stderr raise ex.with_traceback(None)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/psycopg/cursor.py", line 97, in execute
2024/09/13 18:16:32 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:16:32 stderr return super().execute(*args, **kwargs)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django_prometheus/db/common.py", line 69, in execute
2024/09/13 18:16:32 stderr ^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:16:32 stderr return self.cursor.execute(sql)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 103, in _execute
2024/09/13 18:16:32 stderr raise dj_exc_value.with_traceback(traceback) from exc_value
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/utils.py", line 91, in exit
2024/09/13 18:16:32 stderr with self.db.wrap_database_errors:
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 100, in _execute
2024/09/13 18:16:32 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:16:32 stderr return executor(sql, params, many, context)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 92, in _execute_with_wrappers
2024/09/13 18:16:32 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:16:32 stderr return self._execute_with_wrappers(
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 79, in execute
2024/09/13 18:16:32 stderr cursor.execute(sql, params)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/base/schema.py", line 202, in execute
2024/09/13 18:16:32 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:16:32 stderr return super().execute(sql, params)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/postgresql/schema.py", line 45, in execute
2024/09/13 18:16:32 stderr self.execute(sql, params or None)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/base/schema.py", line 505, in create_model
2024/09/13 18:16:32 stderr schema_editor.create_model(model)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/migrations/operations/models.py", line 96, in database_forwards
2024/09/13 18:16:32 stderr operation.database_forwards(
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/migrations/migration.py", line 132, in apply
2024/09/13 18:16:32 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:16:32 stderr state = migration.apply(state, schema_editor)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 252, in apply_migration
2024/09/13 18:16:32 stderr ^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:16:32 stderr state = self.apply_migration(
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
2024/09/13 18:16:32 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:16:32 stderr state = self._migrate_all_forwards(
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 135, in migrate
2024/09/13 18:16:32 stderr ^^^^^^^^^^^^^^^^^
2024/09/13 18:16:32 stderr post_migrate_state = executor.migrate(
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/commands/migrate.py", line 356, in handle
2024/09/13 18:16:32 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:16:32 stderr res = handle_func(*args, **kwargs)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/base.py", line 107, in wrapper
2024/09/13 18:16:32 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:16:32 stderr output = self.handle(*args, **options)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/base.py", line 459, in execute
2024/09/13 18:16:32 stderr migrate_command_class(stdout=stdout, stderr=stderr).execute(*args, **options)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django_tenants/migration_executors/base.py", line 59, in run_migrations
2024/09/13 18:16:32 stderr run_migrations(self.args, self.options, self.codename, self.PUBLIC_SCHEMA_NAME)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django_tenants/migration_executors/standard.py", line 11, in run_migrations
2024/09/13 18:16:32 stderr executor.run_migrations(tenants=[self.PUBLIC_SCHEMA_NAME])
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django_tenants/management/commands/migrate_schemas.py", line 63, in handle
2024/09/13 18:16:32 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:16:32 stderr output = self.handle(*args, **options)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/base.py", line 459, in execute
2024/09/13 18:16:32 stderr self.execute(*args, **cmd_options)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/base.py", line 413, in run_from_argv
2024/09/13 18:16:32 stderr self.fetch_command(subcommand).run_from_argv(self.argv)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/init.py", line 436, in execute
2024/09/13 18:16:32 stderr utility.execute()
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/init.py", line 442, in execute_from_command_line
2024/09/13 18:16:32 stderr execute_from_command_line(["", "migrate_schemas"])
2024/09/13 18:16:32 stderr File "/lifecycle/migrate.py", line 112, in run_migrations
2024/09/13 18:16:32 stderr run_migrations()
2024/09/13 18:16:32 stderr File "/lifecycle/gunicorn.conf.py", line 154, in 
2024/09/13 18:16:32 stderr File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
2024/09/13 18:16:32 stderr File "<frozen importlib._bootstrap_external>", line 995, in exec_module
2024/09/13 18:16:32 stderr spec.loader.exec_module(mod)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/gunicorn/app/base.py", line 110, in get_config_from_filename
2024/09/13 18:16:32 stderr Traceback (most recent call last):
2024/09/13 18:16:32 stderr  
2024/09/13 18:16:32 stderr The above exception was the direct cause of the following exception:
2024/09/13 18:16:32 stderr  
2024/09/13 18:16:32 stderr psycopg.errors.DuplicateTable: relation "authentik_tenants_domain" already exists
2024/09/13 18:16:32 stderr raise ex.with_traceback(None)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/psycopg/cursor.py", line 97, in execute
2024/09/13 18:16:32 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:16:32 stderr return super().execute(*args, **kwargs)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django_prometheus/db/common.py", line 69, in execute
2024/09/13 18:16:32 stderr ^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:16:32 stderr return self.cursor.execute(sql)
2024/09/13 18:16:32 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 103, in _execute
2024/09/13 18:16:32 stderr Traceback (most recent call last):
2024/09/13 18:16:31 stderr Failed to read config file: ./lifecycle/gunicorn.conf.py
2024/09/13 18:16:30 stdout Applying authentik_tenants.0001_initial...
2024/09/13 18:16:30 stdout Running migrations:
2024/09/13 18:16:30 stdout Apply all migrations: auth, authentik_blueprints, authentik_brands, authentik_core, authentik_crypto, authentik_enterprise, authentik_events, authentik_flows, authentik_outposts, authentik_policies, authentik_policies_dummy, authentik_policies_event_matcher, authentik_policies_expiry, authentik_policies_expression, authentik_policies_geoip, authentik_policies_password, authentik_policies_reputation, authentik_providers_google_workspace, authentik_providers_ldap, authentik_providers_microsoft_entra, authentik_providers_oauth2, authentik_providers_proxy, authentik_providers_rac, authentik_providers_radius, authentik_providers_saml, authentik_providers_scim, authentik_rbac, authentik_sources_ldap, authentik_sources_oauth, authentik_sources_plex, authentik_sources_saml, authentik_sources_scim, authentik_stages_authenticator_duo, authentik_stages_authenticator_sms, authentik_stages_authenticator_static, authentik_stages_authenticator_totp, authentik_stages_authenticator_validate, authentik_stages_authenticator_webauthn, authentik_stages_captcha, authentik_stages_consent, authentik_stages_deny, authentik_stages_dummy, authentik_stages_email, authentik_stages_identification, authentik_stages_invitation, authentik_stages_password, authentik_stages_prompt, authentik_stages_source, authentik_stages_user_delete, authentik_stages_user_login, authentik_stages_user_logout, authentik_stages_user_write, authentik_tenants, contenttypes, guardian, sessions
2024/09/13 18:16:30 stderr {"error":"authentik starting","event":"failed to proxy to backend","level":"warning","logger":"authentik.router","timestamp":"2024-09-13T15:16:27Z"}
2024/09/13 18:16:27 stderr {"error":"authentik starting","event":"failed to proxy to backend","level":"warning","logger":"authentik.router","timestamp":"2024-09-13T15:16:27Z"}
2024/09/13 18:16:30 stdout Operations to perform:
2024/09/13 18:16:26 stdout === Starting migration
2024/09/13 18:16:22 stderr {"error":"authentik starting","event":"failed to proxy to backend","level":"warning","logger":"authentik.router","timestamp":"2024-09-13T15:16:22Z"}
2024/09/13 18:16:19 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240578.749405, "path": "authentik.outposts.settings"}
2024/09/13 18:16:19 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240578.7439933, "path": "authentik.enterprise.settings"}
2024/09/13 18:16:19 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240578.7439137, "path": "authentik.enterprise.providers.microsoft_entra.settings"}
2024/09/13 18:16:19 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240578.7418985, "path": "authentik.sources.ldap.settings"}
2024/09/13 18:16:19 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240578.7400806, "path": "authentik.providers.scim.settings"}
2024/09/13 18:16:19 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240578.7373135, "path": "authentik.enterprise.providers.google_workspace.settings"}
2024/09/13 18:16:19 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240578.7360468, "path": "authentik.blueprints.settings"}
2024/09/13 18:16:19 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240578.7346065, "path": "authentik.stages.authenticator_totp.settings"}
2024/09/13 18:16:19 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240578.7314565, "path": "authentik.sources.oauth.settings"}
2024/09/13 18:16:19 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240578.7306437, "path": "authentik.crypto.settings"}
2024/09/13 18:16:19 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240578.727012, "path": "authentik.sources.plex.settings"}
2024/09/13 18:16:19 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240578.7253406, "path": "authentik.stages.authenticator_webauthn.settings"}
2024/09/13 18:16:19 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240578.7238889, "path": "authentik.admin.settings"}
2024/09/13 18:16:19 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240578.7231147, "path": "authentik.events.settings"}
2024/09/13 18:16:19 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240578.7205544, "path": "authentik.enterprise.settings"}
2024/09/13 18:16:19 stderr {"event": "Enabled authentik enterprise", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240578.7187939}
2024/09/13 18:16:18 stderr {"event": "Booting authentik", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240578.7150962, "version": "2024.8.1"}
2024/09/13 18:16:16 stdout 2024-09-13 15:16:16 [info     ] applying django migrations
2024/09/13 18:16:16 stdout 2024-09-13 15:16:16 [info     ] Migration finished applying    migration=tenant_to_brand.py
2024/09/13 18:16:15 stdout 2024-09-13 15:16:15 [info     ] Migration needs to be applied  migration=tenant_to_brand.py
2024/09/13 18:15:55 stderr {"error":"authentik starting","event":"failed to proxy to backend","level":"warning","logger":"authentik.router","timestamp":"2024-09-13T15:15:55Z"}
2024/09/13 18:15:52 stderr {"error":"authentik starting","event":"failed to proxy to backend","level":"warning","logger":"authentik.router","timestamp":"2024-09-13T15:15:52Z"}
2024/09/13 18:15:34 stdout 2024-09-13 15:15:34 [info     ] waiting to acquire database lock
2024/09/13 18:15:29 stderr {"event": "Finished authentik bootstrap", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240529.1435773}
2024/09/13 18:15:29 stderr {"event": "Redis Connection successful", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240529.1434474}
2024/09/13 18:15:29 stderr {"event": "PostgreSQL connection successful", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240529.1417987}
2024/09/13 18:15:29 stderr {"event": "Starting authentik bootstrap", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240529.1315238}
2024/09/13 18:15:29 stderr {"event": "Loaded environment variables", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240527.4009783, "count": 8}
2024/09/13 18:15:27 stderr {"event": "Loaded config", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240527.4005017, "file": "/authentik/lib/default.yml"}
2024/09/13 18:15:26 stderr {"event":"Loaded config from environment","level":"debug","timestamp":"2024-09-13T15:15:26Z"}
2024/09/13 18:15:26 stderr {"event":"Loaded config","level":"debug","path":"/authentik/lib/default.yml","timestamp":"2024-09-13T15:15:26Z"}
2024/09/13 18:15:26 stderr {"event":"Loaded config","level":"debug","path":"inbuilt-default","timestamp":"2024-09-13T15:15:26Z"}`

Worker:

2024/09/13 18:18:08 stderr  
2024/09/13 18:18:08 stderr The above exception was the direct cause of the following exception:
2024/09/13 18:18:08 stderr  
2024/09/13 18:18:08 stderr psycopg.errors.DuplicateTable: relation "authentik_tenants_domain" already exists
2024/09/13 18:18:08 stderr raise ex.with_traceback(None)
2024/09/13 18:18:08 stderr File "/ak-root/venv/lib/python3.12/site-packages/psycopg/cursor.py", line 97, in execute
2024/09/13 18:18:08 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:18:08 stderr return super().execute(*args, **kwargs)
2024/09/13 18:18:08 stderr File "/ak-root/venv/lib/python3.12/site-packages/django_prometheus/db/common.py", line 69, in execute
2024/09/13 18:18:08 stderr ^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:18:08 stderr return self.cursor.execute(sql)
2024/09/13 18:18:08 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 103, in _execute
2024/09/13 18:18:08 stderr Traceback (most recent call last):
2024/09/13 18:18:06 stdout Applying authentik_tenants.0001_initial...
2024/09/13 18:18:06 stdout Running migrations:
2024/09/13 18:18:06 stdout Apply all migrations: auth, authentik_blueprints, authentik_brands, authentik_core, authentik_crypto, authentik_enterprise, authentik_events, authentik_flows, authentik_outposts, authentik_policies, authentik_policies_dummy, authentik_policies_event_matcher, authentik_policies_expiry, authentik_policies_expression, authentik_policies_geoip, authentik_policies_password, authentik_policies_reputation, authentik_providers_google_workspace, authentik_providers_ldap, authentik_providers_microsoft_entra, authentik_providers_oauth2, authentik_providers_proxy, authentik_providers_rac, authentik_providers_radius, authentik_providers_saml, authentik_providers_scim, authentik_rbac, authentik_sources_ldap, authentik_sources_oauth, authentik_sources_plex, authentik_sources_saml, authentik_sources_scim, authentik_stages_authenticator_duo, authentik_stages_authenticator_sms, authentik_stages_authenticator_static, authentik_stages_authenticator_totp, authentik_stages_authenticator_validate, authentik_stages_authenticator_webauthn, authentik_stages_captcha, authentik_stages_consent, authentik_stages_deny, authentik_stages_dummy, authentik_stages_email, authentik_stages_identification, authentik_stages_invitation, authentik_stages_password, authentik_stages_prompt, authentik_stages_source, authentik_stages_user_delete, authentik_stages_user_login, authentik_stages_user_logout, authentik_stages_user_write, authentik_tenants, contenttypes, guardian, sessions
2024/09/13 18:18:04 stdout Operations to perform:
2024/09/13 18:18:04 stdout === Starting migration
2024/09/13 18:17:58 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240678.7781906, "path": "authentik.providers.scim.settings"}
2024/09/13 18:17:58 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240678.7746942, "path": "authentik.sources.plex.settings"}
2024/09/13 18:17:58 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240678.7741258, "path": "authentik.enterprise.settings"}
2024/09/13 18:17:58 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240678.771868, "path": "authentik.stages.authenticator_webauthn.settings"}
2024/09/13 18:17:58 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240678.7709997, "path": "authentik.stages.authenticator_totp.settings"}
2024/09/13 18:17:58 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240678.7702053, "path": "authentik.crypto.settings"}
2024/09/13 18:17:58 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240678.7696726, "path": "authentik.events.settings"}
2024/09/13 18:17:58 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240678.7691054, "path": "authentik.enterprise.providers.microsoft_entra.settings"}
2024/09/13 18:17:58 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240678.7685473, "path": "authentik.admin.settings"}
2024/09/13 18:17:58 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240678.7677298, "path": "authentik.sources.oauth.settings"}
2024/09/13 18:17:58 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240678.7654805, "path": "authentik.enterprise.providers.google_workspace.settings"}
2024/09/13 18:17:58 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240678.7647138, "path": "authentik.outposts.settings"}
2024/09/13 18:17:58 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240678.7617538, "path": "authentik.sources.ldap.settings"}
2024/09/13 18:17:58 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240678.760489, "path": "authentik.blueprints.settings"}
2024/09/13 18:17:58 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240678.758999, "path": "authentik.enterprise.settings"}
2024/09/13 18:17:58 stderr {"event": "Enabled authentik enterprise", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240678.7579484}
2024/09/13 18:17:58 stderr {"event": "Booting authentik", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240678.7552192, "version": "2024.8.1"}
2024/09/13 18:17:56 stdout 2024-09-13 15:17:56 [info     ] applying django migrations
2024/09/13 18:17:54 stdout 2024-09-13 15:17:54 [info     ] waiting to acquire database lock
2024/09/13 18:17:54 stderr {"event": "Finished authentik bootstrap", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240674.619228}
2024/09/13 18:17:54 stderr {"event": "Redis Connection successful", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240674.619027}
2024/09/13 18:17:54 stderr {"event": "PostgreSQL connection successful", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240674.6147456}
2024/09/13 18:17:54 stderr {"event": "Starting authentik bootstrap", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240674.5830917}
2024/09/13 18:17:53 stderr {"event": "Loaded environment variables", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240673.5292823, "count": 8}
2024/09/13 18:17:53 stderr {"event": "Loaded config", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240673.5281162, "file": "/authentik/lib/default.yml"}
2024/09/13 18:17:50 stdout root:x:0:authentik
2024/09/13 18:17:21 stderr django.db.utils.ProgrammingError: relation "authentik_tenants_domain" already exists
2024/09/13 18:17:21 stderr raise ex.with_traceback(None)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/psycopg/cursor.py", line 97, in execute
2024/09/13 18:17:21 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:17:21 stderr return super().execute(*args, **kwargs)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django_prometheus/db/common.py", line 69, in execute
2024/09/13 18:17:21 stderr ^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:17:21 stderr return self.cursor.execute(sql)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 103, in _execute
2024/09/13 18:17:21 stderr raise dj_exc_value.with_traceback(traceback) from exc_value
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/utils.py", line 91, in exit
2024/09/13 18:17:21 stderr with self.db.wrap_database_errors:
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 100, in _execute
2024/09/13 18:17:21 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:17:21 stderr return executor(sql, params, many, context)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 92, in _execute_with_wrappers
2024/09/13 18:17:21 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:17:21 stderr return self._execute_with_wrappers(
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 79, in execute
2024/09/13 18:17:21 stderr cursor.execute(sql, params)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/base/schema.py", line 202, in execute
2024/09/13 18:17:21 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:17:21 stderr return super().execute(sql, params)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/postgresql/schema.py", line 45, in execute
2024/09/13 18:17:21 stderr self.execute(sql, params or None)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/base/schema.py", line 505, in create_model
2024/09/13 18:17:21 stderr schema_editor.create_model(model)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/migrations/operations/models.py", line 96, in database_forwards
2024/09/13 18:17:21 stderr operation.database_forwards(
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/migrations/migration.py", line 132, in apply
2024/09/13 18:17:21 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:17:21 stderr state = migration.apply(state, schema_editor)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 252, in apply_migration
2024/09/13 18:17:21 stderr ^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:17:21 stderr state = self.apply_migration(
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
2024/09/13 18:17:21 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:17:21 stderr state = self._migrate_all_forwards(
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 135, in migrate
2024/09/13 18:17:21 stderr ^^^^^^^^^^^^^^^^^
2024/09/13 18:17:21 stderr post_migrate_state = executor.migrate(
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/commands/migrate.py", line 356, in handle
2024/09/13 18:17:21 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:17:21 stderr res = handle_func(*args, **kwargs)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/base.py", line 107, in wrapper
2024/09/13 18:17:21 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:17:21 stderr output = self.handle(*args, **options)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/base.py", line 459, in execute
2024/09/13 18:17:21 stderr migrate_command_class(stdout=stdout, stderr=stderr).execute(*args, **options)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django_tenants/migration_executors/base.py", line 59, in run_migrations
2024/09/13 18:17:21 stderr run_migrations(self.args, self.options, self.codename, self.PUBLIC_SCHEMA_NAME)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django_tenants/migration_executors/standard.py", line 11, in run_migrations
2024/09/13 18:17:21 stderr executor.run_migrations(tenants=[self.PUBLIC_SCHEMA_NAME])
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django_tenants/management/commands/migrate_schemas.py", line 63, in handle
2024/09/13 18:17:21 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:17:21 stderr output = self.handle(*args, **options)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/base.py", line 459, in execute
2024/09/13 18:17:21 stderr self.execute(*args, **cmd_options)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/base.py", line 413, in run_from_argv
2024/09/13 18:17:21 stderr self.fetch_command(subcommand).run_from_argv(self.argv)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/init.py", line 436, in execute
2024/09/13 18:17:21 stderr utility.execute()
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/init.py", line 442, in execute_from_command_line
2024/09/13 18:17:21 stderr execute_from_command_line(["", "migrate_schemas"])
2024/09/13 18:17:21 stderr File "/lifecycle/migrate.py", line 112, in run_migrations
2024/09/13 18:17:21 stderr run_migrations()
2024/09/13 18:17:21 stderr File "/manage.py", line 43, in 
2024/09/13 18:17:21 stderr File "<frozen runpy>", line 88, in _run_code
2024/09/13 18:17:21 stderr File "<frozen runpy>", line 198, in _run_module_as_main
2024/09/13 18:17:21 stderr Traceback (most recent call last):
2024/09/13 18:17:21 stderr  
2024/09/13 18:17:21 stderr The above exception was the direct cause of the following exception:
2024/09/13 18:17:21 stderr  
2024/09/13 18:17:21 stderr psycopg.errors.DuplicateTable: relation "authentik_tenants_domain" already exists
2024/09/13 18:17:21 stderr raise ex.with_traceback(None)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/psycopg/cursor.py", line 97, in execute
2024/09/13 18:17:21 stderr ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:17:21 stderr return super().execute(*args, **kwargs)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django_prometheus/db/common.py", line 69, in execute
2024/09/13 18:17:21 stderr ^^^^^^^^^^^^^^^^^^^^^^^^
2024/09/13 18:17:21 stderr return self.cursor.execute(sql)
2024/09/13 18:17:21 stderr File "/ak-root/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 103, in _execute
2024/09/13 18:17:21 stderr Traceback (most recent call last):
2024/09/13 18:17:18 stdout Applying authentik_tenants.0001_initial...
2024/09/13 18:17:18 stdout Running migrations:
2024/09/13 18:17:18 stdout Apply all migrations: auth, authentik_blueprints, authentik_brands, authentik_core, authentik_crypto, authentik_enterprise, authentik_events, authentik_flows, authentik_outposts, authentik_policies, authentik_policies_dummy, authentik_policies_event_matcher, authentik_policies_expiry, authentik_policies_expression, authentik_policies_geoip, authentik_policies_password, authentik_policies_reputation, authentik_providers_google_workspace, authentik_providers_ldap, authentik_providers_microsoft_entra, authentik_providers_oauth2, authentik_providers_proxy, authentik_providers_rac, authentik_providers_radius, authentik_providers_saml, authentik_providers_scim, authentik_rbac, authentik_sources_ldap, authentik_sources_oauth, authentik_sources_plex, authentik_sources_saml, authentik_sources_scim, authentik_stages_authenticator_duo, authentik_stages_authenticator_sms, authentik_stages_authenticator_static, authentik_stages_authenticator_totp, authentik_stages_authenticator_validate, authentik_stages_authenticator_webauthn, authentik_stages_captcha, authentik_stages_consent, authentik_stages_deny, authentik_stages_dummy, authentik_stages_email, authentik_stages_identification, authentik_stages_invitation, authentik_stages_password, authentik_stages_prompt, authentik_stages_source, authentik_stages_user_delete, authentik_stages_user_login, authentik_stages_user_logout, authentik_stages_user_write, authentik_tenants, contenttypes, guardian, sessions
2024/09/13 18:17:18 stdout Operations to perform:
2024/09/13 18:17:18 stdout === Starting migration
2024/09/13 18:17:12 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240632.6011868, "path": "authentik.sources.oauth.settings"}
2024/09/13 18:17:12 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240632.599119, "path": "authentik.sources.ldap.settings"}
2024/09/13 18:17:12 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240632.597985, "path": "authentik.events.settings"}
2024/09/13 18:17:12 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240632.5960152, "path": "authentik.stages.authenticator_totp.settings"}
2024/09/13 18:17:12 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240632.5956113, "path": "authentik.enterprise.settings"}
2024/09/13 18:17:12 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240632.5945804, "path": "authentik.admin.settings"}
2024/09/13 18:17:12 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240632.5937424, "path": "authentik.sources.plex.settings"}
2024/09/13 18:17:12 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240632.5918334, "path": "authentik.enterprise.providers.google_workspace.settings"}
2024/09/13 18:17:12 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240632.5910256, "path": "authentik.blueprints.settings"}
2024/09/13 18:17:12 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240632.5902753, "path": "authentik.stages.authenticator_webauthn.settings"}
2024/09/13 18:17:12 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240632.588501, "path": "authentik.providers.scim.settings"}
2024/09/13 18:17:12 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240632.5860438, "path": "authentik.enterprise.providers.microsoft_entra.settings"}
2024/09/13 18:17:12 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240632.5849218, "path": "authentik.crypto.settings"}
2024/09/13 18:17:12 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240632.5841246, "path": "authentik.outposts.settings"}
2024/09/13 18:17:12 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240632.5822732, "path": "authentik.enterprise.settings"}
2024/09/13 18:17:12 stderr {"event": "Enabled authentik enterprise", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240632.5811963}
2024/09/13 18:17:12 stderr {"event": "Booting authentik", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240632.5785346, "version": "2024.8.1"}
2024/09/13 18:17:09 stdout 2024-09-13 15:17:09 [info     ] applying django migrations
2024/09/13 18:17:03 stderr {"event": "Finished authentik bootstrap", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240620.5849187}
2024/09/13 18:17:03 stderr {"event": "Redis Connection successful", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240620.5847054}
2024/09/13 18:17:03 stderr {"event": "PostgreSQL connection successful", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240620.582683}
2024/09/13 18:17:03 stderr {"event": "Starting authentik bootstrap", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240620.5611212}
2024/09/13 18:17:03 stderr {"event": "Loaded environment variables", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240619.352646, "count": 8}
2024/09/13 18:17:00 stdout 2024-09-13 15:17:00 [info     ] waiting to acquire database lock
2024/09/13 18:16:59 stderr {"event": "Loaded config", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240619.352016, "file": "/authentik/lib/default.yml"}
2024/09/13 18:16:57 stdout root:x:0:authentik
2024/09/13 18:16:14 stdout Applying authentik_flows.0012_auto_20200908_1542_squashed_0017_auto_20210329_1334...
2024/09/13 18:16:14 stdout OK
2024/09/13 18:16:14 stdout Applying authentik_flows.0011_flow_title...
2024/09/13 18:16:14 stdout OK
2024/09/13 18:16:14 stdout Applying authentik_flows.0010_provider_flows...
2024/09/13 18:16:12 stdout OK
2024/09/13 18:16:11 stdout Applying authentik_flows.0009_source_flows...
2024/09/13 18:16:11 stdout OK
2024/09/13 18:16:10 stdout Applying authentik_flows.0008_default_flows...
2024/09/13 18:16:10 stdout OK
2024/09/13 18:16:10 stdout Applying authentik_tenants.0002_tenant_default_token_duration_and_more...
2024/09/13 18:16:10 stdout OK
2024/09/13 18:16:01 stdout Applying authentik_tenants.0001_initial...
2024/09/13 18:16:00 stdout OK
2024/09/13 18:15:59 stdout Applying authentik_rbac.0003_alter_systempermission_options...
2024/09/13 18:15:59 stdout OK
2024/09/13 18:15:59 stdout Applying authentik_rbac.0002_systempermission...
2024/09/13 18:15:59 stdout OK
2024/09/13 18:15:53 stdout Applying authentik_rbac.0001_initial...
2024/09/13 18:15:52 stdout OK
2024/09/13 18:15:51 stdout Applying authentik_blueprints.0003_alter_blueprintinstance_name...
2024/09/13 18:15:48 stdout OK
2024/09/13 18:15:46 stdout Applying authentik_blueprints.0002_blueprintinstance_content...
2024/09/13 18:15:46 stdout OK
2024/09/13 18:15:38 stdout Applying authentik_blueprints.0001_initial...
2024/09/13 18:15:38 stdout OK
2024/09/13 18:15:21 stdout Applying authentik_flows.0001_squashed_0007_auto_20200703_2059...
2024/09/13 18:15:21 stdout OK
2024/09/13 18:15:19 stdout Applying authentik_policies.0002_auto_20200528_1647...
2024/09/13 18:15:19 stdout OK
2024/09/13 18:15:15 stdout Applying authentik_policies.0001_initial...
2024/09/13 18:15:14 stdout OK
2024/09/13 18:15:14 stdout Applying auth.0012_alter_user_first_name_max_length...
2024/09/13 18:15:14 stdout OK
2024/09/13 18:15:14 stdout Applying auth.0011_update_proxy_permissions...
2024/09/13 18:15:12 stdout OK
2024/09/13 18:15:11 stdout Applying auth.0010_alter_group_name_max_length...
2024/09/13 18:15:11 stdout OK
2024/09/13 18:15:11 stdout Applying auth.0009_alter_user_last_name_max_length...
2024/09/13 18:15:11 stdout OK
2024/09/13 18:15:10 stdout Applying auth.0008_alter_user_username_max_length...
2024/09/13 18:15:10 stdout OK
2024/09/13 18:15:10 stdout Applying auth.0007_alter_validators_add_error_messages...
2024/09/13 18:15:10 stdout OK
2024/09/13 18:15:10 stdout Applying auth.0006_require_contenttypes_0002...
2024/09/13 18:15:10 stdout OK
2024/09/13 18:15:10 stdout Applying auth.0005_alter_user_last_login_null...
2024/09/13 18:15:08 stdout OK
2024/09/13 18:15:07 stdout Applying auth.0004_alter_user_username_opts...
2024/09/13 18:15:07 stdout OK
2024/09/13 18:15:07 stdout Applying auth.0003_alter_user_email_max_length...
2024/09/13 18:15:07 stdout OK
2024/09/13 18:15:06 stdout Applying auth.0002_alter_permission_name_max_length...
2024/09/13 18:15:06 stdout OK
2024/09/13 18:14:41 stdout Applying auth.0001_initial...
2024/09/13 18:14:40 stdout OK
2024/09/13 18:14:38 stdout Applying contenttypes.0002_remove_content_type_name...
2024/09/13 18:14:38 stdout OK
2024/09/13 18:14:35 stdout Applying contenttypes.0001_initial...
2024/09/13 18:14:35 stdout Running migrations:
2024/09/13 18:14:35 stdout Apply all migrations: auth, authentik_blueprints, authentik_brands, authentik_core, authentik_crypto, authentik_enterprise, authentik_events, authentik_flows, authentik_outposts, authentik_policies, authentik_policies_dummy, authentik_policies_event_matcher, authentik_policies_expiry, authentik_policies_expression, authentik_policies_geoip, authentik_policies_password, authentik_policies_reputation, authentik_providers_google_workspace, authentik_providers_ldap, authentik_providers_microsoft_entra, authentik_providers_oauth2, authentik_providers_proxy, authentik_providers_rac, authentik_providers_radius, authentik_providers_saml, authentik_providers_scim, authentik_rbac, authentik_sources_ldap, authentik_sources_oauth, authentik_sources_plex, authentik_sources_saml, authentik_sources_scim, authentik_stages_authenticator_duo, authentik_stages_authenticator_sms, authentik_stages_authenticator_static, authentik_stages_authenticator_totp, authentik_stages_authenticator_validate, authentik_stages_authenticator_webauthn, authentik_stages_captcha, authentik_stages_consent, authentik_stages_deny, authentik_stages_dummy, authentik_stages_email, authentik_stages_identification, authentik_stages_invitation, authentik_stages_password, authentik_stages_prompt, authentik_stages_source, authentik_stages_user_delete, authentik_stages_user_login, authentik_stages_user_logout, authentik_stages_user_write, authentik_tenants, contenttypes, guardian, sessions
2024/09/13 18:14:35 stdout Operations to perform:
2024/09/13 18:14:34 stdout === Starting migration
2024/09/13 18:14:22 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240461.4667237, "path": "authentik.blueprints.settings"}
2024/09/13 18:14:22 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240461.4616656, "path": "authentik.providers.scim.settings"}
2024/09/13 18:14:22 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240461.456555, "path": "authentik.sources.ldap.settings"}
2024/09/13 18:14:22 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240461.455012, "path": "authentik.stages.authenticator_totp.settings"}
2024/09/13 18:14:22 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240461.452946, "path": "authentik.enterprise.settings"}
2024/09/13 18:14:22 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240461.4505424, "path": "authentik.outposts.settings"}
2024/09/13 18:14:22 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240461.4485161, "path": "authentik.sources.plex.settings"}
2024/09/13 18:14:22 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240461.4466317, "path": "authentik.sources.oauth.settings"}
2024/09/13 18:14:22 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240461.4454107, "path": "authentik.enterprise.providers.google_workspace.settings"}
2024/09/13 18:14:22 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240461.439392, "path": "authentik.crypto.settings"}
2024/09/13 18:14:22 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240461.4327588, "path": "authentik.admin.settings"}
2024/09/13 18:14:22 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240461.431812, "path": "authentik.events.settings"}
2024/09/13 18:14:22 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240461.4292917, "path": "authentik.stages.authenticator_webauthn.settings"}
2024/09/13 18:14:22 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240461.425527, "path": "authentik.enterprise.providers.microsoft_entra.settings"}
2024/09/13 18:14:22 stderr {"event": "Loaded app settings", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240461.4185197, "path": "authentik.enterprise.settings"}
2024/09/13 18:14:22 stderr {"event": "Enabled authentik enterprise", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240461.4169195}
2024/09/13 18:14:21 stderr {"event": "Booting authentik", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240461.4128885, "version": "2024.8.1"}
2024/09/13 18:14:17 stdout 2024-09-13 15:14:17 [info     ] applying django migrations
2024/09/13 18:14:15 stderr {"event": "Finished authentik bootstrap", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240451.5146902}
2024/09/13 18:14:15 stderr {"event": "Redis Connection successful", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240451.5144498}
2024/09/13 18:14:11 stdout 2024-09-13 15:14:11 [info     ] waiting to acquire database lock
2024/09/13 18:14:15 stderr {"event": "PostgreSQL connection successful", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240451.512084}
2024/09/13 18:14:11 stderr {"event": "Starting authentik bootstrap", "level": "info", "logger": "authentik.lib.config", "timestamp": 1726240451.48949}
2024/09/13 18:14:09 stderr {"event": "Loaded environment variables", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240449.5877414, "count": 8}
2024/09/13 18:14:09 stderr {"event": "Loaded config", "level": "debug", "logger": "authentik.lib.config", "timestamp": 1726240449.5871336, "file": "/authentik/lib/default.yml"}
2024/09/13 18:13:59 stdout root:x:0:

Version and Deployment (please complete the following information):

  • authentik version: tags I tried: 2024.8 & latest
  • Deployment: docker-compose via portainer

Additional context
I'm running Authentik on a Synology 1522+ NAS, with RAM extended to 24 GB.

@divin31 divin31 added the bug Something isn't working label Sep 13, 2024
@michael1800v1
Copy link

Same problem here. Fresh install with an external PostgreSQL server and using 2024.8.1. The database connection is fine, but the worker/server are stuck in a loop after failing to create a duplicate authentik_tenants_domain table endlessly. I've dropped the database several times and upgraded the postgres user to SUPERUSER but to no avail.

@CrazyWolf13
Copy link

Same for me!

@BeryJu
Thanks for taking a look.

Sorry but I'm slowly sick of EVERY single release of authentik having MAJOR issues, not like small issues, but MAJOR bugs.

@michael1800v1
Copy link

@divin31 Would you mind posting your (sanitized) .env file contents? Still working through this issue myself.

@4d62
Copy link
Contributor

4d62 commented Sep 14, 2024

Sorry but I'm slowly sick of EVERY single release of authentik having MAJOR issues, not like small issues, but MAJOR bugs.

made me stop using authentik entirely and switch to an alternative. i've already mentioned this several times and its starting to get annoying

@4d62
Copy link
Contributor

4d62 commented Sep 14, 2024

which is unfortunate cause authentik was great and had a lot of potential but it's just not worth the risk of having bugs which may become security issues or have to stay on the previous release and wait for the patch to not get impacted by major bugs

@michael1800v1
Copy link

I got through this finally. There seem to be multiple issues with both database initializations and migrations when custom host, user, db name and/or authentication methods other than password are specified via the .env file. The errors indicated by the worker/server aren't necessarily what's starting the cascade of issues.

I was able to get things running by starting the stack with no .env configs other than the secret key and db password. After everything was up, I set up the default login, then paused all containers except the postgres. I created a dump of the database (with --no-owner) and restored it onto my external postgres server (as role of whatever the authentik user will be). After all that, I brought everything down and deleted all volumes via docker. Finally, I added my customizations to the .env file and docker-compose.yml (even though they they didn't work before) and everything came up fine.

For those that are looking to migrate a non-fresh, internal database, I'd suggest making a backup first, then try altering permissions to the default credentials, and renaming the database to the default name. Then, clear out the .env other than secret and db_pass and try bringing up the stack and letting the server/worker migrate the db. Finally, bring the server and worker down and revert your db privs, names, and other .env/compose settings.

Far from ideal...and made worse because it's so hard to figure out what the root cause is.

@divin31
Copy link
Author

divin31 commented Sep 16, 2024

@michael1800v1 Updated my post with env vars.

@CrazyWolf13
Copy link

CrazyWolf13 commented Sep 16, 2024

@divin31 is the just released version 2024.8.2 now working for you?

@divin31
Copy link
Author

divin31 commented Sep 16, 2024

@CrazyWolf13 Unfortunately I get the same error message with the new version as well. Tried with a clean postgres database from 0.
image

@michael1800v1
Copy link

I can only guess about what's actually going on. I got up and running by using all defaults, no custom config whatsoever, just to get a fresh (empty) database initialized, then dump/restore the database to its real home and applied customized configs to docker-compose and .env afterwards. I've got it up using external Redis, external postgres, all tls with custom root CA and different usernames now...after a default-only initialization . If that doesn't work, I'm out of ideas.

As part of a fresh install, make sure to delete any docker volumes from old attempts--any partial data remnants or possibly even the database existence leads back to a failed initialization. I overlooked that and spent an hour or so going in circles until I figured that out.

@ghz7l
Copy link

ghz7l commented Sep 22, 2024

I find the situation very worrying: you release a version, that comes with the reboot loop preventing everyone using that release from using the software. Yet, there is no clear documentation of a workaround, nor any clear understanding of the issue at hand. The reporting in this issue seems to tell there is a combination of bugs that was triggered by the release. We do not know exactly what causes the bug; all we know is that SSO service is down for a full week, without any chance of coming back up.

I would find it useful if GoAuthentik.io would be a bit more active supporting people hit by this bug and finding a resolution. Obviously the 2024.8.2 release did not fix any of it. I spent a few hours trying to figure things out and resorted to: abandon all hope and wait for a fix. But this is not a solution.

@CrazyWolf13
Copy link

@BeryJu Thanks for looking into this, I fully agree with @ghz7l.

For the size of authentik at least a little "does it even start" test before a release would maybe be a good idea.

@4d62
Copy link
Contributor

4d62 commented Sep 23, 2024

cc @fheisler (authentik ceo)

I'm jumping back in this thread because authentik was in the top 5 most useful tools in my homelab, and many people around me also use it. It's the only decent self-hostable SSO tool (it's also quite powerful), and it's disappointing to see this happen. My opinion is that a dedicated QA team is needed to test each update before its release, especially since there's an enterprise plan and people pay for the product. Now, I won't tell y'all how to run your company, but we are not the first to point this problem out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants