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

sending recovery email fails -- Object of type MIMEImage is not JSON serializable #7322

Closed
igor47 opened this issue Oct 26, 2023 · 4 comments · Fixed by #7325
Closed

sending recovery email fails -- Object of type MIMEImage is not JSON serializable #7322

igor47 opened this issue Oct 26, 2023 · 4 comments · Fixed by #7325
Labels
bug Something isn't working

Comments

@igor47
Copy link

igor47 commented Oct 26, 2023

Describe the bug
Fails both from the admin UI using the Send Recovery Link button or via the Forgot password self-service recovery flow.

To Reproduce

  1. Attempt to send a recovery email
  2. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
From the admin UI:
image
Attempting to do it using recovery flow:
image

Logs

Stacktrace from authentik
Traceback (most recent call last):
  File "/authentik/flows/views/executor.py", line 287, in get
    stage_response = self.current_stage_view.dispatch(request)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ak-root/venv/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch
    return handler(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/authentik/stages/email/stage.py", line 142, in get
    self.send_email()
  File "/authentik/stages/email/stage.py", line 121, in send_email
    send_mails(current_stage, message)
  File "/authentik/stages/email/tasks.py", line 26, in send_mails
    promise = lazy_group()
              ^^^^^^^^^^^^
  File "/ak-root/venv/lib/python3.11/site-packages/celery/canvas.py", line 1568, in __call__
    return self.apply_async(partial_args, **options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ak-root/venv/lib/python3.11/site-packages/celery/canvas.py", line 1598, in apply_async
    results = list(self._apply_tasks(tasks, producer, app, p,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ak-root/venv/lib/python3.11/site-packages/celery/canvas.py", line 1775, in _apply_tasks
    sig.apply_async(producer=producer, add_to_parent=False,
  File "/ak-root/venv/lib/python3.11/site-packages/celery/canvas.py", line 400, in apply_async
    return _apply(args, kwargs, **options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ak-root/venv/lib/python3.11/site-packages/celery/app/task.py", line 594, in apply_async
    return app.send_task(
           ^^^^^^^^^^^^^^
  File "/ak-root/venv/lib/python3.11/site-packages/celery/app/base.py", line 798, in send_task
    amqp.send_task_message(P, name, message, **options)
  File "/ak-root/venv/lib/python3.11/site-packages/celery/app/amqp.py", line 517, in send_task_message
    ret = producer.publish(
          ^^^^^^^^^^^^^^^^^
  File "/ak-root/venv/lib/python3.11/site-packages/kombu/messaging.py", line 175, in publish
    body, content_type, content_encoding = self._prepare(
                                           ^^^^^^^^^^^^^^
  File "/ak-root/venv/lib/python3.11/site-packages/kombu/messaging.py", line 268, in _prepare
    body) = dumps(body, serializer=serializer)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ak-root/venv/lib/python3.11/site-packages/kombu/serialization.py", line 219, in dumps
    with _reraise_errors(EncodeError):
  File "/usr/local/lib/python3.11/contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/ak-root/venv/lib/python3.11/site-packages/kombu/serialization.py", line 45, in _reraise_errors
    reraise(wrapper, wrapper(exc), sys.exc_info()[2])
  File "/ak-root/venv/lib/python3.11/site-packages/kombu/exceptions.py", line 34, in reraise
    raise value.with_traceback(tb)
  File "/ak-root/venv/lib/python3.11/site-packages/kombu/serialization.py", line 41, in _reraise_errors
    yield
  File "/ak-root/venv/lib/python3.11/site-packages/kombu/serialization.py", line 220, in dumps
    payload = encoder(data)
              ^^^^^^^^^^^^^
  File "/ak-root/venv/lib/python3.11/site-packages/kombu/utils/json.py", line 57, in dumps
    return _dumps(s, cls=cls, **dict(default_kwargs, **kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
          ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/encoder.py", line 200, in encode
    chunks = self.iterencode(o, _one_shot=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/encoder.py", line 258, in iterencode
    return _iterencode(o, 0)
           ^^^^^^^^^^^^^^^^^
  File "/ak-root/venv/lib/python3.11/site-packages/kombu/utils/json.py", line 45, in default
    return super().default(o)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/encoder.py", line 180, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
kombu.exceptions.EncodeError: Object of type MIMEImage is not JSON serializable

Version and Deployment (please complete the following information):

  • authentik version: 2023.10.1
  • Deployment: docker-compose
@igor47 igor47 added the bug Something isn't working label Oct 26, 2023
BeryJu added a commit that referenced this issue Oct 26, 2023
closes #7322

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
BeryJu added a commit that referenced this issue Oct 26, 2023
closes #7322

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
BeryJu added a commit that referenced this issue Oct 26, 2023
closes #7322

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
@igor47
Copy link
Author

igor47 commented Oct 26, 2023

thanks for the quick fix! is there a plan to do a release with this fix soon, or should i make my own overlay container to apply the patch?

@smoebody
Copy link

@igor47 from #7325 (comment):

authentik PR Installation instructions

Instructions for docker-compose
Instructions for Kubernetes

authentik PR Installation instructions

Instructions for docker-compose
Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-stages-email-fix-sending-tasks-1698354641-85c73ab
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

For arm64, use these values:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-stages-email-fix-sending-tasks-1698354641-85c73ab-arm64
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes
Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
image:
    repository: ghcr.io/goauthentik/dev-server
    tag: gh-stages-email-fix-sending-tasks-1698354641-85c73ab

For arm64, use these values:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
image:
    repository: ghcr.io/goauthentik/dev-server
    tag: gh-stages-email-fix-sending-tasks-1698354641-85c73ab-arm64

Afterwards, run the upgrade commands from the latest release notes.

@BeryJu
Copy link
Member

BeryJu commented Oct 27, 2023

We'll release 2023.10.2 later today

@mwx23
Copy link

mwx23 commented Nov 19, 2023

I still get this behavior in 2023.10.3.

Object of type MIMEImage is not JSON serializable

Here's the JSON output from the logs. It also contains an SMTP auth error but that's me trying to work things out.

{
  "event": "Task authentik.stages.email.tasks.send_mail[3c22e8b7-0ada-4282-8aa4-8a31189e496a] reject requeue=False: Object of type MIMEImage is not JSON serializable",
  "exception": [
    {
      "exc_type": "Reject",
      "exc_value": "(EncodeError(TypeError('Object of type MIMEImage is not JSON serializable')), False)",
      "frames": [
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/celery/app/trace.py",
          "line": "",
          "lineno": 477,
          "locals": {},
          "name": "trace_task"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/celery/app/trace.py",
          "line": "",
          "lineno": 760,
          "locals": {},
          "name": "__protected_call__"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/celery/app/autoretry.py",
          "line": "",
          "lineno": 60,
          "locals": {},
          "name": "run"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/celery/app/task.py",
          "line": "",
          "lineno": 755,
          "locals": {},
          "name": "retry"
        }
      ],
      "is_cause": false,
      "syntax_error": null
    },
    {
      "exc_type": "EncodeError",
      "exc_value": "Object of type MIMEImage is not JSON serializable",
      "frames": [
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/celery/app/task.py",
          "line": "",
          "lineno": 753,
          "locals": {
            "S": "\"authentik.stages.email.tasks.send_mail({'to': ['REDACTED'], 'cc\"+5134",
            "args": "None",
            "countdown": "0",
            "eta": "None",
            "is_eager": "False",
            "kwargs": "None",
            "max_retries": "3",
            "options": "{}",
            "request": "\"<Context: {'lang': 'py', 'task': 'authentik.stages.email.tasks.send_mail', 'id':\"+6682",
            "ret": "\"Retry(Retry(...), SMTPSenderRefused(530, b'5.7.0 Authentication Required. Learn \"+161",
            "retries": "1",
            "self": "<@task: authentik.stages.email.tasks.send_mail of authentik at 0x7fa9d9fe27d0>",
            "throw": "True"
          },
          "name": "retry"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/celery/canvas.py",
          "line": "",
          "lineno": 400,
          "locals": {
            "_apply": "'<bound method Task.apply_async of <@task: authentik.stages.email.tasks.send_mail'+33",
            "args": "\"({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fro\"+5096",
            "kwargs": "{}",
            "options": "\"{'task_id': '3c22e8b7-0ada-4282-8aa4-8a31189e496a', 'root_id': '3c22e8b7-0ada-42\"+485",
            "route_name": "None",
            "self": "\"authentik.stages.email.tasks.send_mail({'to': ['REDACTED'], 'cc\"+5134"
          },
          "name": "apply_async"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/celery/app/task.py",
          "line": "",
          "lineno": 594,
          "locals": {
            "app": "<Celery authentik at 0x7fa9d9fe27d0>",
            "args": "\"({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fro\"+5096",
            "check_arguments": "'functools.partial(<function send_mail at 0x7fa9d69127a0>, <object object at 0x7f'+12",
            "kwargs": "{}",
            "link": "None",
            "link_error": "None",
            "options": "\"{'queue': 'authentik', 'routing_key': None, 'exchange': None, 'priority': 0, 'ex\"+551",
            "preopts": "\"{'queue': None, 'routing_key': None, 'exchange': None, 'priority': None, 'expire\"+158",
            "producer": "None",
            "self": "<@task: authentik.stages.email.tasks.send_mail of authentik at 0x7fa9d9fe27d0>",
            "shadow": "None",
            "task_id": "3c22e8b7-0ada-4282-8aa4-8a31189e496a"
          },
          "name": "apply_async"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/celery/app/base.py",
          "line": "",
          "lineno": 798,
          "locals": {
            "P": "<Producer: None>",
            "add_to_parent": "True",
            "amqp": "<celery.app.amqp.AMQP object at 0x7fa9d6fe4710>",
            "args": "\"({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fro\"+5096",
            "chain": "None",
            "chord": "None",
            "conf": "\"Settings({'deprecated_settings': set(), 'include': ('authentik.providers.scim.ta\"+9749",
            "connection": "None",
            "countdown": "0",
            "eta": "None",
            "expires": "None",
            "group_id": "37920571-a3d1-4209-9bf1-8d53172993de",
            "group_index": "0",
            "have_parent": "None",
            "ignore_result": "False",
            "kwargs": "{}",
            "link": "None",
            "link_error": "None",
            "message": "\"task_message(headers={'lang': 'py', 'task': 'authentik.stages.email.tasks.send_m\"+6482",
            "name": "authentik.stages.email.tasks.send_mail",
            "options": "\"{'routing_key': None, 'exchange': None, 'priority': 0, 'serializer': 'json', 'de\"+267",
            "parent": "<@task: authentik.stages.email.tasks.send_mail of authentik at 0x7fa9d9fe27d0>",
            "parent_id": "3c22e8b7-0ada-4282-8aa4-8a31189e496a",
            "producer": "None",
            "publisher": "None",
            "reply_to": "9f22f4e3-9478-31ea-9403-5886a48b73e6",
            "result_cls": "'<bound method Task.AsyncResult of <@task: authentik.stages.email.tasks.send_mail'+33",
            "retries": "1",
            "root_id": "3c22e8b7-0ada-4282-8aa4-8a31189e496a",
            "route_name": "None",
            "router": "<celery.app.routes.Router object at 0x7fa9d6efe410>",
            "self": "<Celery authentik at 0x7fa9d9fe27d0>",
            "shadow": "None",
            "soft_time_limit": "None",
            "stamped_headers": "[]",
            "task_id": "3c22e8b7-0ada-4282-8aa4-8a31189e496a",
            "task_type": "<@task: authentik.stages.email.tasks.send_mail of authentik at 0x7fa9d9fe27d0>",
            "time_limit": "None"
          },
          "name": "send_task"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/celery/app/amqp.py",
          "line": "",
          "lineno": 517,
          "locals": {
            "_rp": "{'max_retries': 3, 'interval_start': 0, 'interval_max': 1, 'interval_step': 0.2}",
            "after_receivers": "\"[((140367483651072, 140367685324288), <weakref at 0x7fa9d9ffd5d0; to 'function' \"+46",
            "before_receivers": "[]",
            "body": "\"(({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fr\"+5171",
            "compression": "None",
            "declare": "[<unbound Queue authentik -> <unbound Exchange authentik(direct)> -> authentik>]",
            "default_compressor": "None",
            "default_delivery_mode": "2",
            "default_evd": "<celery.events.dispatcher.EventDispatcher object at 0x7fa9d6dc67d0>",
            "default_exchange": "<unbound Exchange authentik(direct)>",
            "default_policy": "{'max_retries': 3, 'interval_start': 0, 'interval_max': 1, 'interval_step': 0.2}",
            "default_queue": "<unbound Queue authentik -> <unbound Exchange authentik(direct)> -> authentik>",
            "default_retry": "True",
            "default_rkey": "authentik",
            "default_serializer": "json",
            "delivery_mode": "2",
            "event_dispatcher": "None",
            "exchange": "",
            "exchange_type": "direct",
            "headers": "None",
            "headers2": "\"{'lang': 'py', 'task': 'authentik.stages.email.tasks.send_mail', 'id': '3c22e8b7\"+926",
            "kwargs": "\"{'priority': 0, 'immediate': None, 'mandatory': None, 'replaced_task_nesting': 0\"+56",
            "message": "\"task_message(headers={'lang': 'py', 'task': 'authentik.stages.email.tasks.send_m\"+6482",
            "name": "authentik.stages.email.tasks.send_mail",
            "producer": "<Producer: None>",
            "properties": "\"{'correlation_id': '3c22e8b7-0ada-4282-8aa4-8a31189e496a', 'reply_to': '9f22f4e3\"+166",
            "qname": "authentik",
            "queue": "<unbound Queue authentik -> <unbound Exchange authentik(direct)> -> authentik>",
            "queues": "\"{'authentik': <unbound Queue authentik -> <unbound Exchange authentik(direct)> -\"+267",
            "retry": "True",
            "retry_policy": "None",
            "routing_key": "authentik",
            "send_after_publish": "\"<bound method Signal.send of <Signal: after_task_publish providing_args={'routin\"+29",
            "send_before_publish": "\"<bound method Signal.send of <Signal: before_task_publish providing_args={'heade\"+82",
            "send_task_sent": "\"<bound method Signal.send of <Signal: task_sent providing_args={'args', 'taskset\"+40",
            "sent_event": "None",
            "sent_receivers": "[]",
            "serializer": "json"
          },
          "name": "send_task_message"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/kombu/messaging.py",
          "line": "",
          "lineno": 175,
          "locals": {
            "_publish": "<bound method Producer._publish of <Producer: None>>",
            "body": "\"(({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fr\"+5171",
            "compression": "None",
            "content_encoding": "None",
            "content_type": "None",
            "declare": "[<unbound Queue authentik -> <unbound Exchange authentik(direct)> -> authentik>]",
            "delivery_mode": "2",
            "exchange": "",
            "exchange_name": "",
            "expiration": "None",
            "headers": "\"{'lang': 'py', 'task': 'authentik.stages.email.tasks.send_mail', 'id': '3c22e8b7\"+926",
            "immediate": "None",
            "mandatory": "None",
            "priority": "0",
            "properties": "\"{'correlation_id': '3c22e8b7-0ada-4282-8aa4-8a31189e496a', 'reply_to': '9f22f4e3\"+133",
            "retry": "True",
            "retry_policy": "{'max_retries': 3, 'interval_start': 0, 'interval_max': 1, 'interval_step': 0.2}",
            "routing_key": "authentik",
            "self": "<Producer: None>",
            "serializer": "json",
            "timeout": "None"
          },
          "name": "publish"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/kombu/messaging.py",
          "line": "",
          "lineno": 268,
          "locals": {
            "body": "\"(({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fr\"+5171",
            "compression": "None",
            "content_encoding": "None",
            "content_type": "None",
            "headers": "\"{'lang': 'py', 'task': 'authentik.stages.email.tasks.send_mail', 'id': '3c22e8b7\"+926",
            "self": "<Producer: None>",
            "serializer": "json"
          },
          "name": "_prepare"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/kombu/serialization.py",
          "line": "",
          "lineno": 219,
          "locals": {
            "content_encoding": "utf-8",
            "content_type": "application/json",
            "data": "\"(({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fr\"+5171",
            "encoder": "<function dumps at 0x7fa9e40ae5c0>",
            "self": "<kombu.serialization.SerializerRegistry object at 0x7fa9e404bf10>",
            "serializer": "json"
          },
          "name": "dumps"
        },
        {
          "filename": "/usr/local/lib/python3.11/contextlib.py",
          "line": "",
          "lineno": 155,
          "locals": {
            "self": "<contextlib._GeneratorContextManager object at 0x7fa9d4cbb310>",
            "traceback": "<traceback object at 0x7fa9d4cbb840>",
            "typ": "<class 'TypeError'>",
            "value": "TypeError('Object of type MIMEImage is not JSON serializable')"
          },
          "name": "__exit__"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/kombu/serialization.py",
          "line": "",
          "lineno": 45,
          "locals": {
            "exclude": "(<class 'kombu.exceptions.SerializerNotInstalled'>,)",
            "include": "(<class 'Exception'>,)",
            "wrapper": "<class 'kombu.exceptions.EncodeError'>"
          },
          "name": "_reraise_errors"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/kombu/exceptions.py",
          "line": "",
          "lineno": 34,
          "locals": {
            "tb": "<traceback object at 0x7fa9d4cbb880>",
            "tp": "<class 'kombu.exceptions.EncodeError'>",
            "value": "EncodeError(TypeError('Object of type MIMEImage is not JSON serializable'))"
          },
          "name": "reraise"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/kombu/serialization.py",
          "line": "",
          "lineno": 41,
          "locals": {
            "exclude": "(<class 'kombu.exceptions.SerializerNotInstalled'>,)",
            "include": "(<class 'Exception'>,)",
            "wrapper": "<class 'kombu.exceptions.EncodeError'>"
          },
          "name": "_reraise_errors"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/kombu/serialization.py",
          "line": "",
          "lineno": 220,
          "locals": {
            "content_encoding": "utf-8",
            "content_type": "application/json",
            "data": "\"(({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fr\"+5171",
            "encoder": "<function dumps at 0x7fa9e40ae5c0>",
            "self": "<kombu.serialization.SerializerRegistry object at 0x7fa9e404bf10>",
            "serializer": "json"
          },
          "name": "dumps"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/kombu/utils/json.py",
          "line": "",
          "lineno": 57,
          "locals": {
            "_dumps": "<function dumps at 0x7fa9e4536b60>",
            "cls": "<class 'kombu.utils.json.JSONEncoder'>",
            "default_kwargs": "{}",
            "kwargs": "{}",
            "s": "\"(({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fr\"+5171"
          },
          "name": "dumps"
        },
        {
          "filename": "/usr/local/lib/python3.11/json/__init__.py",
          "line": "",
          "lineno": 238,
          "locals": {
            "allow_nan": "True",
            "check_circular": "True",
            "cls": "<class 'kombu.utils.json.JSONEncoder'>",
            "default": "None",
            "ensure_ascii": "True",
            "indent": "None",
            "kw": "{}",
            "obj": "\"(({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fr\"+5171",
            "separators": "None",
            "skipkeys": "False",
            "sort_keys": "False"
          },
          "name": "dumps"
        },
        {
          "filename": "/usr/local/lib/python3.11/json/encoder.py",
          "line": "",
          "lineno": 200,
          "locals": {
            "o": "\"(({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fr\"+5171",
            "self": "<kombu.utils.json.JSONEncoder object at 0x7fa9d4cbb6d0>"
          },
          "name": "encode"
        },
        {
          "filename": "/usr/local/lib/python3.11/json/encoder.py",
          "line": "",
          "lineno": 258,
          "locals": {
            "_encoder": "<built-in function encode_basestring_ascii>",
            "_iterencode": "<_json.Encoder object at 0x7fa9d4ccb160>",
            "_one_shot": "True",
            "floatstr": "<function JSONEncoder.iterencode.<locals>.floatstr at 0x7fa9d662b740>",
            "markers": "\"{140367395799680: (({'to': ['REDACTED'], 'cc': [], 'bcc': [], '\"+15678",
            "o": "\"(({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fr\"+5171",
            "self": "<kombu.utils.json.JSONEncoder object at 0x7fa9d4cbb6d0>"
          },
          "name": "iterencode"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/kombu/utils/json.py",
          "line": "",
          "lineno": 45,
          "locals": {
            "__class__": "<class 'kombu.utils.json.JSONEncoder'>",
            "encoder": "<function <lambda> at 0x7fa9e40aec00>",
            "marker": "uuid",
            "o": "<email.mime.image.MIMEImage object at 0x7fa9d6757290>",
            "reducer": "None",
            "self": "<kombu.utils.json.JSONEncoder object at 0x7fa9d4cbb6d0>",
            "t": "<class 'uuid.UUID'>"
          },
          "name": "default"
        },
        {
          "filename": "/usr/local/lib/python3.11/json/encoder.py",
          "line": "",
          "lineno": 180,
          "locals": {
            "o": "<email.mime.image.MIMEImage object at 0x7fa9d6757290>",
            "self": "<kombu.utils.json.JSONEncoder object at 0x7fa9d4cbb6d0>"
          },
          "name": "default"
        }
      ],
      "is_cause": false,
      "syntax_error": null
    },
    {
      "exc_type": "TypeError",
      "exc_value": "Object of type MIMEImage is not JSON serializable",
      "frames": [
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/kombu/serialization.py",
          "line": "",
          "lineno": 41,
          "locals": {
            "exclude": "(<class 'kombu.exceptions.SerializerNotInstalled'>,)",
            "include": "(<class 'Exception'>,)",
            "wrapper": "<class 'kombu.exceptions.EncodeError'>"
          },
          "name": "_reraise_errors"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/kombu/serialization.py",
          "line": "",
          "lineno": 220,
          "locals": {
            "content_encoding": "utf-8",
            "content_type": "application/json",
            "data": "\"(({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fr\"+5171",
            "encoder": "<function dumps at 0x7fa9e40ae5c0>",
            "self": "<kombu.serialization.SerializerRegistry object at 0x7fa9e404bf10>",
            "serializer": "json"
          },
          "name": "dumps"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/kombu/utils/json.py",
          "line": "",
          "lineno": 57,
          "locals": {
            "_dumps": "<function dumps at 0x7fa9e4536b60>",
            "cls": "<class 'kombu.utils.json.JSONEncoder'>",
            "default_kwargs": "{}",
            "kwargs": "{}",
            "s": "\"(({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fr\"+5171"
          },
          "name": "dumps"
        },
        {
          "filename": "/usr/local/lib/python3.11/json/__init__.py",
          "line": "",
          "lineno": 238,
          "locals": {
            "allow_nan": "True",
            "check_circular": "True",
            "cls": "<class 'kombu.utils.json.JSONEncoder'>",
            "default": "None",
            "ensure_ascii": "True",
            "indent": "None",
            "kw": "{}",
            "obj": "\"(({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fr\"+5171",
            "separators": "None",
            "skipkeys": "False",
            "sort_keys": "False"
          },
          "name": "dumps"
        },
        {
          "filename": "/usr/local/lib/python3.11/json/encoder.py",
          "line": "",
          "lineno": 200,
          "locals": {
            "o": "\"(({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fr\"+5171",
            "self": "<kombu.utils.json.JSONEncoder object at 0x7fa9d4cbb6d0>"
          },
          "name": "encode"
        },
        {
          "filename": "/usr/local/lib/python3.11/json/encoder.py",
          "line": "",
          "lineno": 258,
          "locals": {
            "_encoder": "<built-in function encode_basestring_ascii>",
            "_iterencode": "<_json.Encoder object at 0x7fa9d4ccb160>",
            "_one_shot": "True",
            "floatstr": "<function JSONEncoder.iterencode.<locals>.floatstr at 0x7fa9d662b740>",
            "markers": "\"{140367395799680: (({'to': ['REDACTED'], 'cc': [], 'bcc': [], '\"+15678",
            "o": "\"(({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fr\"+5171",
            "self": "<kombu.utils.json.JSONEncoder object at 0x7fa9d4cbb6d0>"
          },
          "name": "iterencode"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/kombu/utils/json.py",
          "line": "",
          "lineno": 45,
          "locals": {
            "__class__": "<class 'kombu.utils.json.JSONEncoder'>",
            "encoder": "<function <lambda> at 0x7fa9e40aec00>",
            "marker": "uuid",
            "o": "<email.mime.image.MIMEImage object at 0x7fa9d6757290>",
            "reducer": "None",
            "self": "<kombu.utils.json.JSONEncoder object at 0x7fa9d4cbb6d0>",
            "t": "<class 'uuid.UUID'>"
          },
          "name": "default"
        },
        {
          "filename": "/usr/local/lib/python3.11/json/encoder.py",
          "line": "",
          "lineno": 180,
          "locals": {
            "o": "<email.mime.image.MIMEImage object at 0x7fa9d6757290>",
            "self": "<kombu.utils.json.JSONEncoder object at 0x7fa9d4cbb6d0>"
          },
          "name": "default"
        }
      ],
      "is_cause": false,
      "syntax_error": null
    },
    {
      "exc_type": "SMTPSenderRefused",
      "exc_value": "(530, b'5.7.0 Authentication Required. Learn more at\\n5.7.0  https://support.google.com/mail/?p=WantAuthError h6-20020a170902f54600b001cf570b10dasm1184448plf.65 - gsmtp', 'REDACTED')",
      "frames": [
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/celery/app/autoretry.py",
          "line": "",
          "lineno": 38,
          "locals": {
            "args": "\"({'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'fro\"+5096",
            "autoretry_for": "(<class 'smtplib.SMTPException'>, <class 'ConnectionError'>, <class 'OSError'>)",
            "dont_autoretry_for": "()",
            "kwargs": "{}",
            "retry_backoff": "1.0",
            "retry_backoff_max": "600",
            "retry_jitter": "True",
            "retry_kwargs": "{'countdown': 0}",
            "task": "<@task: authentik.stages.email.tasks.send_mail of authentik at 0x7fa9d9fe27d0>"
          },
          "name": "run"
        },
        {
          "filename": "/authentik/stages/email/tasks.py",
          "line": "",
          "lineno": 108,
          "locals": {
            "backend": "<django.core.mail.backends.smtp.EmailBackend object at 0x7fa9d66f6fd0>",
            "email_stage_pk": "UUID('06569587-cfec-433a-8d0a-ab192a4b4d95')",
            "key": "mixed_subtype",
            "message": "\"{'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'from\"+5048",
            "message_id": "<170038149140.66.3566414378876162034@authentik-worker-69ddf49c96-svrq4>",
            "message_object": "<django.core.mail.message.EmailMultiAlternatives object at 0x7fa9d665aa90>",
            "self": "<@task: authentik.stages.email.tasks.send_mail of authentik at 0x7fa9d9fe27d0>",
            "stage": "<EmailStage: Email Stage default-recovery-email>",
            "stages": "<InheritanceQuerySet [<EmailStage: Email Stage default-recovery-email>]>",
            "value": "related"
          },
          "name": "send_mail"
        },
        {
          "filename": "/authentik/stages/email/tasks.py",
          "line": "",
          "lineno": 90,
          "locals": {
            "backend": "<django.core.mail.backends.smtp.EmailBackend object at 0x7fa9d66f6fd0>",
            "email_stage_pk": "UUID('06569587-cfec-433a-8d0a-ab192a4b4d95')",
            "key": "mixed_subtype",
            "message": "\"{'to': ['REDACTED'], 'cc': [], 'bcc': [], 'reply_to': [], 'from\"+5048",
            "message_id": "<170038149140.66.3566414378876162034@authentik-worker-69ddf49c96-svrq4>",
            "message_object": "<django.core.mail.message.EmailMultiAlternatives object at 0x7fa9d665aa90>",
            "self": "<@task: authentik.stages.email.tasks.send_mail of authentik at 0x7fa9d9fe27d0>",
            "stage": "<EmailStage: Email Stage default-recovery-email>",
            "stages": "<InheritanceQuerySet [<EmailStage: Email Stage default-recovery-email>]>",
            "value": "related"
          },
          "name": "send_mail"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/django/core/mail/backends/smtp.py",
          "line": "",
          "lineno": 134,
          "locals": {
            "email_messages": "[<django.core.mail.message.EmailMultiAlternatives object at 0x7fa9d665aa90>]",
            "message": "<django.core.mail.message.EmailMultiAlternatives object at 0x7fa9d665aa90>",
            "new_conn_created": "False",
            "num_sent": "0",
            "self": "<django.core.mail.backends.smtp.EmailBackend object at 0x7fa9d66f6fd0>"
          },
          "name": "send_messages"
        },
        {
          "filename": "/ak-root/venv/lib/python3.11/site-packages/django/core/mail/backends/smtp.py",
          "line": "",
          "lineno": 152,
          "locals": {
            "email_message": "<django.core.mail.message.EmailMultiAlternatives object at 0x7fa9d665aa90>",
            "encoding": "utf-8",
            "from_email": "REDACTED",
            "message": "<django.core.mail.message.SafeMIMEMultipart object at 0x7fa9d4c8ea10>",
            "recipients": "['REDACTED']",
            "self": "<django.core.mail.backends.smtp.EmailBackend object at 0x7fa9d66f6fd0>"
          },
          "name": "_send"
        },
        {
          "filename": "/usr/local/lib/python3.11/smtplib.py",
          "line": "",
          "lineno": 887,
          "locals": {
            "code": "530",
            "esmtp_opts": "['size=14683']",
            "from_addr": "REDACTED",
            "mail_options": "()",
            "msg": "'b\\'Content-Type: multipart/related;\\\\r\\\\n boundary=\"===============6134192328441122'+15240",
            "rcpt_options": "()",
            "resp": "\"b'5.7.0 Authentication Required. Learn more at\\\\n5.7.0  https://support.google.co\"+83",
            "self": "<smtplib.SMTP object at 0x7fa9d6570d50>",
            "to_addrs": "['REDACTED']"
          },
          "name": "sendmail"
        }
      ],
      "is_cause": false,
      "syntax_error": null
    }
  ],
  "level": "warning",
  "logger": "celery.app.trace",
  "timestamp": 1700381493.387906
}

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

Successfully merging a pull request may close this issue.

4 participants