Facing issue to Taiga Setup with Gitlab OAuth login

Hello,

We are planning to use Taiga self hosting solution for our organization. We are already using GitLab self hosting solution running on hxxps://gitlab.domain.com.

We could host Taiga using Taiga 30min Setup and it works fine on hxxps://taiga.domain.com.

As per documentation, Add to &default-back-environment environments

ENABLE_GITLAB_AUTH: "True"
GITLAB_API_CLIENT_ID: "dad548xxxxxxxxx"
GITLAB_API_CLIENT_SECRET: "gloas-95d2e42xxxxxx"
GITLAB_URL: "hxxps://gitlab.domain.com"
PUBLIC_REGISTER_ENABLED: "True"

Add to taiga-front service environments

ENABLE_GITLAB_AUTH: "true"
GITLAB_CLIENT_ID: "dad548xxxxxxxxx"
GITLAB_URL: "hxxps://gitlab.domain.com"
PUBLIC_REGISTER_ENABLED: "true"

We created “Taiga-Authentication” application as an Admin user and generated application id and secret key.

Callback URL: hxxps://taiga.domain.com/login
Trusted	: Yes
Confidential: Yes
Scopes: All

After user press signup with GitLab, it could login to GitLab and comeback to Taiga but getting below error message.

“Our Oompa Loompas have not been able to get you credentials from GitLab.”

Once we open “Network” in “Inspect Element”,
Request URL: https://taiga.domain.com/api/v1/auth
Request Method: POST
Status Code: 500 Internal Server Error
Response: {“error”: “Server application error”}.

Please consider “hxxps” as “https” in my above messages. We are looking forward your response.

Regards,
Neel

Hi there,

Have you checked taiga-back logs during the request?

Best regards!

Hello Charlie,

Here is the log after firing this command, docker logs -f taiga-docker-taiga-back-1.

ERROR:2025-03-22 18:58:06,797: Internal Server Error: /api/v1/auth
Traceback (most recent call last):
File “/opt/venv/lib/python3.11/site-packages/taiga_contrib_gitlab_auth/services.py”, line 38, in gitlab_register
auth_data = auth_data_model.objects.get(key=“gitlab”, value=gitlab_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/db/models/manager.py”, line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/db/models/query.py”, line 435, in get
raise self.model.DoesNotExist(
taiga.users.models.AuthData.DoesNotExist: AuthData matching query does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/venv/lib/python3.11/site-packages/taiga_contrib_gitlab_auth/services.py”, line 43, in gitlab_register
user = user_model.objects.get(email=email)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/db/models/manager.py”, line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/db/models/query.py”, line 435, in get
raise self.model.DoesNotExist(
taiga.users.models.User.DoesNotExist: User matching query does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/venv/lib/python3.11/site-packages/django/core/handlers/exception.py”, line 47, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/core/handlers/base.py”, line 181, 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.11/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.11/site-packages/taiga_contrib_gitlab_auth/services.py”, line 76, in gitlab_login_func
user = gitlab_register(username=user_info.username,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/contextlib.py”, line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/taiga_contrib_gitlab_auth/services.py”, line 54, in gitlab_register
send_register_email(user)
File “/taiga-back/taiga/auth/services.py”, line 124, in send_register_email
return bool(email.send())
^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/core/mail/message.py”, line 284, in send
return self.get_connection(fail_silently).send_messages([self])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/core/mail/backends/smtp.py”, line 102, in send_messages
new_conn_created = self.open()
^^^^^^^^^^^
File “/opt/venv/lib/python3.11/site-packages/django/core/mail/backends/smtp.py”, line 62, in open
self.connection = self.connection_class(self.host, self.port, **connection_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/smtplib.py”, line 255, in init
(code, msg) = self.connect(host, port)
^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/smtplib.py”, line 341, in connect
self.sock = self._get_socket(host, port, self.timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/smtplib.py”, line 312, in _get_socket
return socket.create_connection((host, port), timeout,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/socket.py”, line 839, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/socket.py”, line 974, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -2] Name or service not known

Regards,
Neel

Hi, Neel,

It seems there that the issue is when sending the registration email. Your instance cannot access the email host you provided.

Best regards!

1 Like