Login does not work after reboot

Hello,

I have changed the password of a user. After that I restarted Taiga once (runs in Docker). Now no user can log in and the following error message appears:
Content-Type: text/plain; charset=“utf-8”
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [Django] ERROR (EXTERNAL IP): Internal Server Error: /api/v1/auth
From: root@localhost
To: example@example.com
Date: Mon, 27 Feb 2023 10:51:10 -0000
Message-ID: 167749507039.42.13139045575238632615@8026e75c3e08

Internal Server Error: /api/v1/auth

Exception Value: slugify_uniquely() missing 1 required positional argument: ‘model’
Request information:
USER: AnonymousUser

ERROR:2023-02-27 10:51:10,379: Internal Server Error: /api/v1/auth
Traceback (most recent call last):
File “/opt/venv/lib/python3.7/site-packages/django/core/handlers/exception.py”, line 34, in inner
response = get_response(request)
File “/opt/venv/lib/python3.7/site-packages/django/core/handlers/base.py”, line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File “/opt/venv/lib/python3.7/site-packages/django/core/handlers/base.py”, line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/taiga-back/taiga/base/api/viewsets.py”, line 95, in view
return self.dispatch(request, *args, **kwargs)
File “/opt/venv/lib/python3.7/site-packages/django/views/decorators/csrf.py”, line 54, in wrapped_view
return view_func(*args, **kwargs)
File “/taiga-back/taiga/base/api/views.py”, line 449, in dispatch
response = self.handle_exception(exc)
File “/taiga-back/taiga/base/api/views.py”, line 447, in dispatch
response = handler(request, *args, **kwargs)
File “/taiga-back/taiga/auth/api.py”, line 77, in create
data = auth_plugins[login_type]‘login_func’
File “/opt/venv/lib/python3.7/site-packages/taiga_contrib_ldap_auth_ext/services.py”, line 82, in ldap_login_func
username=username, email=email, full_name=full_name, password=password_input)
File “/usr/local/lib/python3.7/contextlib.py”, line 74, in inner
return func(*args, **kwds)
File “/opt/venv/lib/python3.7/site-packages/taiga_contrib_ldap_auth_ext/services.py”, line 100, in register_or_update
username_unique = SLUGIFY(username)
TypeError: slugify_uniquely() missing 1 required positional argument: ‘model’

Hi @Jonas,

Reviewing your logs it’s an unsupported LDAP extension the responsible of causing that exception when trying to log in into Taiga.

Your logs…

File “/opt/venv/lib/python3.7/site-packages/taiga_contrib_ldap_auth_ext/services.py”, line 100, in register_or_update
username_unique = SLUGIFY(username)
TypeError: slugify_uniquely() missing 1 required positional argument: ‘model’

The lines causing the problem in the extension’s code …

30 SLUGIFY = getattr(settings, 'LDAP_MAP_USERNAME_TO_UID', slugify_uniquely)
...
99    if SLUGIFY:
100        username_unique = SLUGIFY(username)

Although Taiga doesn’t support that extension officially, we would recommend you to review the Configuration section in their documentation, as it seems something related to a missing variable value in your settings:

# Function to map LDAP username to local DB user unique identifier.
# Upon successful LDAP bind, will override returned username attribute
# value. May result in unexpected failures if changed after the database
# has been populated.
# 
def _ldap_slugify(uid: str) -> str:
    # example: force lower-case
    #uid = uid.lower()
    return uid
    
# To enable the function above, uncomment the line below to store the function in the variable
#LDAP_MAP_USERNAME_TO_UID = _ldap_slugify`    <========= IS IT UNCOMMENTED ?

You can either research more by yourself trying to review their settings requirements, or contact them directly in any of their repositories in order to get more help:

madmath03 (Mathieu Brunot) · GitHub
GitHub - Monogramm/docker-taiga: Docker images for a full Taiga environment with additional plugins.
GitHub - Monogramm/taiga-contrib-ldap-auth-ext: Extended Taiga plugin for LDAP authentication

We hope you find the solution soon.