Fix race condition when setting admin password with POST_DEPLOY_CMDS #13

Merged
marlon merged 1 commits from virtualboys/authentik:main into main 2025-02-27 16:41:42 +00:00
Owner
No description provided.
virtualboys added 1 commit 2025-02-26 22:30:20 +00:00
Owner

I tested this and it deployed with no errors.

Previously I would get this error when trying to deploy a new authentik instance:

Traceback (most recent call last):
  File "/manage.py", line 52, in <module>
    execute_from_command_line(sys.argv)
  File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/base.py", line 413, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/base.py", line 459, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/authentik/core/management/commands/shell.py", line 90, in handle
    exec(options["command"], namespace)  # nosec # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 2, in <module>
  File "/ak-root/venv/lib/python3.12/site-packages/django/db/models/manager.py", line 87, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ak-root/venv/lib/python3.12/site-packages/django/db/models/query.py", line 649, in get
    raise self.model.DoesNotExist(
authentik.core.models.User.DoesNotExist: User matching query does not exist.
I tested this and it deployed with no errors. Previously I would get this error when trying to deploy a new authentik instance: ``` Traceback (most recent call last): File "/manage.py", line 52, in <module> execute_from_command_line(sys.argv) File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line utility.execute() File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/base.py", line 413, in run_from_argv self.execute(*args, **cmd_options) File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/base.py", line 459, in execute output = self.handle(*args, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/authentik/core/management/commands/shell.py", line 90, in handle exec(options["command"], namespace) # nosec # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<string>", line 2, in <module> File "/ak-root/venv/lib/python3.12/site-packages/django/db/models/manager.py", line 87, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/ak-root/venv/lib/python3.12/site-packages/django/db/models/query.py", line 649, in get raise self.model.DoesNotExist( authentik.core.models.User.DoesNotExist: User matching query does not exist. ```
decentral1se requested review from moritz 2025-02-27 08:55:04 +00:00
decentral1se requested review from ammaratef45 2025-02-27 08:55:49 +00:00
Owner

#11

https://git.coopcloud.tech/coop-cloud/authentik/issues/11
decentral1se approved these changes 2025-02-27 08:56:26 +00:00
decentral1se left a comment
Owner

Glorious 🫡

Glorious 🫡
ammaratef45 approved these changes 2025-02-27 15:55:02 +00:00
marlon merged commit ac7192e6ab into main 2025-02-27 16:41:42 +00:00
Sign in to join this conversation.
No description provided.