Repository navigation
Description
Describe the bug
When i try enroll new user or recover the password using template flow, the message "Something went wrong! Please try again later." appears for user..
To Reproduce
Steps to reproduce the behavior:
- Go to default-enrollment-flow
- Fill all informations
- Press Continue
- See error
Expected behavior
The user was expected to be registered and receive the confirmation email.
Screenshots
Logs
Traceback (most recent call last):
File "/authentik/flows/views/executor.py", line 288, in get
stage_response = self.current_stage_view.dispatch(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/django/views/generic/base.py", line 143, in dispatch
return handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/authentik/stages/email/stage.py", line 154, in get
self.send_email()
File "/authentik/stages/email/stage.py", line 124, in send_email
send_mails(current_stage, message)
File "/authentik/stages/email/tasks.py", line 39, in send_mails
promise = lazy_group()
^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/celery/canvas.py", line 1584, in call
return self.apply_async(partial_args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/celery/canvas.py", line 1614, in apply_async
results = list(self._apply_tasks(tasks, producer, app, p,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/celery/canvas.py", line 1793, in _apply_tasks
sig.apply_async(producer=producer, add_to_parent=False,
File "/ak-root/venv/lib/python3.12/site-packages/celery/canvas.py", line 400, in apply_async
return _apply(args, kwargs, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/sentry_sdk/integrations/celery/init.py", line 289, in apply_async
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/celery/app/task.py", line 594, in apply_async
return app.send_task(
^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/tenant_schemas_celery/app.py", line 102, in send_task
return super(CeleryApp, self).send_task(name, args=args, kwargs=kwargs, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/sentry_sdk/integrations/celery/init.py", line 289, in apply_async
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/celery/app/base.py", line 801, in send_task
amqp.send_task_message(P, name, message, **options)
File "/ak-root/venv/lib/python3.12/site-packages/celery/app/amqp.py", line 518, in send_task_message
ret = producer.publish(
^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/sentry_sdk/utils.py", line 1783, in runner
return sentry_patched_function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/sentry_sdk/integrations/celery/init.py", line 526, in sentry_publish
return original_publish(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/kombu/messaging.py", line 175, in publish
body, content_type, content_encoding = self._prepare(
^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/kombu/messaging.py", line 268, in _prepare
body) = dumps(body, serializer=serializer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/kombu/serialization.py", line 219, in dumps
with _reraise_errors(EncodeError):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/contextlib.py", line 158, in exit
self.gen.throw(value)
File "/ak-root/venv/lib/python3.12/site-packages/kombu/serialization.py", line 45, in _reraise_errors
reraise(wrapper, wrapper(exc), sys.exc_info()[2])
File "/ak-root/venv/lib/python3.12/site-packages/kombu/exceptions.py", line 34, in reraise
raise value.with_traceback(tb)
File "/ak-root/venv/lib/python3.12/site-packages/kombu/serialization.py", line 41, in _reraise_errors
yield
File "/ak-root/venv/lib/python3.12/site-packages/kombu/serialization.py", line 220, in dumps
payload = encoder(data)
^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/kombu/utils/json.py", line 63, in dumps
return _dumps(s, cls=cls, **dict(default_kwargs, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/json/init.py", line 238, in dumps
**kw).encode(obj)
^^^^^^^^^^^
File "/usr/local/lib/python3.12/json/encoder.py", line 200, in encode
chunks = self.iterencode(o, _one_shot=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/json/encoder.py", line 258, in iterencode
return _iterencode(o, 0)
^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/kombu/utils/json.py", line 47, in default
return super().default(o)
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/json/encoder.py", line 180, in default
raise TypeError(f'Object of type {o.class.name} '
kombu.exceptions.EncodeError: Object of type ModelBase is not JSON serializable
Version and Deployment (please complete the following information):
- authentik version: 2025.2.0
- Deployment: docker-compose
Additional context
In version 2024.12.3 it worked correctly, but with the bug reported in #13104

Activity
BerserkeR-Git commentedon Feb 24, 2025
I was just about to report on the same thing. I'm experiencing the exact same bug and get the same errors when using version
2025.2.0Correction:
I see this during the password recovery flow. Emails for version updates still get sent though.
trolhamonas commentedon Feb 25, 2025
I'm getting this issue as well in the same version, but this was the first time I setup it up
akdk7 commentedon Feb 25, 2025
Getting the same error with version 2025.2.0. Also during password recovery flow and no mail was sent.
ianr2 commentedon Feb 25, 2025
I'm getting the same error with 2025.2.0 for password recovery email. Setup is using docker compose. No email gets sent. I have check on the box and sending an email outside of authentik works as expected.
dgarfias commentedon Feb 25, 2025
I'm also getting this error for password recovery email.
melizeche commentedon Feb 25, 2025
Do you have en environment variables for email set?
https://docs.goauthentik.io/docs/install-config/install/docker-compose#email-configuration-optional-but-recommended
trolhamonas commentedon Feb 25, 2025
Yes for both the server and the worker
dgarfias commentedon Feb 25, 2025
@melizeche Yes, and I've tried using both global settings (env vars) & manually setting the connection through the email stage
melizeche commentedon Feb 25, 2025
Ok, I'll try to replicate this and get back to you
maykosiqueira commentedon Feb 25, 2025
@melizeche, yes too, in version 2024.12.3 mail service works, but the name of user most be 3 words has mentioned in #13104.
Now, in version 2025.2.0 has a general error
melizeche commentedon Feb 26, 2025
I confirm this bug and have created a fix
If you want to try this patch:
Instructions for docker-compose
Add the following block to your
.envfile:and
docker-compose up -dAfterwards, run the upgrade commands from the latest release notes.
Instructions for Kubernetes
Add the following block to your
values.ymlfile:Afterwards, run the upgrade commands from the latest release notes.
dgarfias commentedon Feb 26, 2025
@melizeche I have tried running the patch and now I'm getting the following:
... File "/authentik/stages/email/tasks.py", line 79, in send_mail raise ValueError(f"Invalid stage class name: {stage_class_name}") ValueError: Invalid stage class name: 207e6b29-fbcf-4899-9633-ad8bdd060756 ...This is both using global settings and the recovery email stage
cheggerdev commentedon Feb 26, 2025
As described in #13270 I get this error on enrollment.
So it does not matter whether it is for recovery or enrollment.
rissson commentedon Feb 26, 2025
So I've tried reproducing that, and I'm unable to do so. We think it might be due to the fact that some old task is stuck in the worker. I've tried out the changes in #13256 on a clean install, and it appears to fix the issue. We'll look into merging and releasing this as soon as possible
rissson commentedon Feb 26, 2025
We've released the fix in 2025.2.1, could you give that a try?
AMDHome commentedon Feb 26, 2025
Email seems to work for me on the new 2025.2.1
Spinnich commentedon Feb 26, 2025
Worked for me as well!
Thank you so much!
maykosiqueira commentedon Feb 26, 2025
@melizeche and @rissson now email works again!
Thanks!
dgarfias commentedon Feb 27, 2025
It's working after updating to 2025.2.1. Thank you @melizeche @rissson !!!
cheggerdev commentedon Feb 27, 2025
2025.2.1 works for me, too!
Zapuskalov commentedon Feb 27, 2025
Doesn't solve the problem #13104
rissson commentedon Feb 27, 2025
unrelated issue