goauthentik / goauthentik/authentik
error when change LDAP user password
- Dominant language
- Python
- Stars
- 25.6k
- Forks
- 2k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 659
Description
### Describe the bug
```
unsupported Unicode escape sequence LINE 1: ...ration_error', 'authentik.sources.ldap.signals', E'{"messag... ^ DETAIL: \u0000 cannot be converted to text. CONTEXT: JSON data, line 1: ...oblem 4003 (INSUFF_ACCESS_RIGHTS), data 0\n\u0000...
Traceback (most recent call last):
File "/authentik/flows/views/executor.py", line 294, in get
stage_response = self.current_stage_view.dispatch(request)
File "/authentik/stages/user_write/stage.py", line 177, in dispatch
self.update_user(user)
~~~~~~~~~~~~~~~~^^^^^^
File "/authentik/stages/user_write/stage.py", line 108, in update_user
user.set_password(value, request=self.request)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/authentik/core/models.py", line 517, in set_password
password_changed.send(sender=sender, user=self, password=raw_password, request=request)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ak-root/.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py", line 189, in send
response = receiver(signal=self, sender=sender, **named)
File "/authentik/sources/ldap/signals.py", line 62, in ldap_sync_password
).set_user(user).save()
~~~~^^
File "/authentik/events/models.py", line 254, in save
super().save(*args, **kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/ak-root/.venv/lib/python3.13/site-packages/django/db/models/base.py", line 902, in save
self.save_base(
~~~~~~~~~~~~~~^
using=using,
^^^^^^^^^^^^
...<2 lines>...
update_fields=update_fields,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/ak-root/.venv/lib/python3.13/site-packages/django/db/models/base.py", line 1008, in save_base
updated = self._save_table(
raw,
...<4 lines>...
update_fields,
)
File "/ak-root/.venv/lib/python3.13/site-packages/django/db/models/base.py", line 1169, in _save_table
results = self._do_insert(
cls._base_manager, using, fields, returning_fields, raw
)
File "/ak-root/.venv/lib/python3.13/site-packages/django/db/models/base.py", line 1210, in _do_insert
return manager._insert(
~~~~~~~~~~~~~~~^
[self],
^^^^^^^
...<3 lines>...
raw=raw,
^^^^^^^^
)
^
File "/ak-root/.venv/lib/python3.13/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.13/site-packages/django/db/models/query.py", line 1873, in _insert
return query.get_compiler(using=using).execute_sql(returning_fields)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/ak-root/.venv/lib/python3.13/site-packages/django/db/models/sql/compiler.py", line 1882, in execute_sql
cursor.execute(sql, params)
~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/ak-root/.venv/lib/python3.13/site-packages/django/db/backends/utils.py", line 79, in execute
return self._execute_with_wrappers(
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
sql, params, many=False, executor=self._execute
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/ak-root/.venv/lib/python3.13/site-packages/django/db/backends/utils.py", line 92, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/ak-root/.venv/lib/python3.13/site-packages/django/db/backends/utils.py", line 100, in _execute
with self.db.wrap_database_errors:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ak-root/.venv/lib/python3.13/site-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/ak-root/.venv/lib/python3.13/site-packages/django/db/backends/utils.py", line 105, in _execute
return self.cursor.execute(sql, params)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/ak-root/.venv/lib/python3.13/site-packages/django_prometheus/db/common.py", line 69, in execute
return super().execute(*args, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/ak-root/.venv/lib/python3.13/site-packages/psycopg/cursor.py", line 97, in execute
raise ex.with_traceback(None)
django.db.utils.DataError: unsupported Unicode escape sequence
LINE 1: ...ration_error', 'authentik.sources.ldap.signals', E'{"messag...
^
DETAIL: \u0000 cannot be converted to text.
CONTEXT: JSON data, line 1: ...oblem 4003 (INSUFF_ACCESS_RIGHTS), data 0\n\u0000...
```
### How to reproduce
change user password and get error
### Expected behavior
no error
### Screenshots
_No response_
### Additional context
_No response_
### Deployment Method
Kubernetes
### Version
2025.12.4
### Relevant log output
```shell
```
Contributor guide
Assessment
This issue has not been assessed yet.