can't use Open-LDAP for login #10712

Closed
opened 2025-12-29 21:35:07 +01:00 by adam · 0 comments
Owner

Originally created by @altf4arnold on GitHub (Jan 29, 2025).

Deployment Type

Self-hosted

NetBox Version

v4.2.2

Python Version

3.11

Steps to Reproduce

Followed the LDAP templates on the doc : https://demo.netbox.dev/static/docs/installation/6-ldap/

Expected Behavior

We would excpect everything to match and to authenticate. The null value in column "name" of relation "users_group" violates not-null constraint seems especially odd.

We verified in the LDAP that the recquired fields were correct. All these fields match :

AUTH_LDAP_USER_ATTR_MAP = {
    "first_name": "givenName",
    "last_name": "sn",
    "email": "mail"
}

Did we miss something with the name flag?

Observed Behavior

We get an error in plain text on the web-page

 The complete exception is provided below:

<class 'django.db.utils.IntegrityError'>

null value in column "name" of relation "users_group" violates not-null constraint
DETAIL:  Failing row contains (28, null, ).

Python version: 3.11.2
NetBox version: 4.2.2
Plugins: None installed

Logs are :

Binding as uid=altf4,ou=users,dc=hsbxl,dc=be
Binding as uid=noc-logistics,ou=machines,dc=hsbxl,dc=be
uid=altf4,ou=users,dc=hsbxl,dc=be is a member of cn=noc,ou=groups,dc=hsbxl,dc=be
Populating Django user altf4
Invoking search_s('uid=altf4,ou=users,dc=hsbxl,Authentication failed for askarel: failed to map the username to a DN.
Authentication failed for altf4: failed to map the username to a Ddc=be', 0, '(objectClass=*)')
search_s('uid=altf4,ou=users,dc=hsbxl,dc=be', 0, '(objectClass=*)') returned 1 objects: uid=altf4,ou=users,dc=hsbxl,dc=be
uid=altf4,ou=users,dc=hsbxl,dc=be does not have a value for the attribute givenName
uid=altf4,ou=users,dc=hsbxl,dc=be does not have a value for the attribute sn
uid=altf4,ou=users,dc=hsbxl,dc=be is not a member of cn=noc_netbox_is_active,ou=groups,dc=hsbxl,dc=be
uid=altf4,ou=users,dc=hsbxl,dc=be is not a member of cn=noc_netbox_is_staff,ou=groups,dc=hsbxl,dc=be
uid=altf4,ou=users,dc=hsbxl,dc=be is a member of cn=noc,ou=groups,dc=hsbxl,dc=be
null value in column "name" of relation "users_group" violates not-null constraint
DETAIL:  Failing row contains (24, null, ). while authenticating altf4

I also observe that the username is created in the database (tried deleting them but problem persisted)

Originally created by @altf4arnold on GitHub (Jan 29, 2025). ### Deployment Type Self-hosted ### NetBox Version v4.2.2 ### Python Version 3.11 ### Steps to Reproduce Followed the LDAP templates on the doc : https://demo.netbox.dev/static/docs/installation/6-ldap/ ### Expected Behavior We would excpect everything to match and to authenticate. The `null value in column "name" of relation "users_group" violates not-null constraint` seems especially odd. We verified in the LDAP that the recquired fields were correct. All these fields match : ``` AUTH_LDAP_USER_ATTR_MAP = { "first_name": "givenName", "last_name": "sn", "email": "mail" } ``` Did we miss something with the name flag? ### Observed Behavior We get an error in plain text on the web-page ``` The complete exception is provided below: <class 'django.db.utils.IntegrityError'> null value in column "name" of relation "users_group" violates not-null constraint DETAIL: Failing row contains (28, null, ). Python version: 3.11.2 NetBox version: 4.2.2 Plugins: None installed ``` Logs are : ``` Binding as uid=altf4,ou=users,dc=hsbxl,dc=be Binding as uid=noc-logistics,ou=machines,dc=hsbxl,dc=be uid=altf4,ou=users,dc=hsbxl,dc=be is a member of cn=noc,ou=groups,dc=hsbxl,dc=be Populating Django user altf4 Invoking search_s('uid=altf4,ou=users,dc=hsbxl,Authentication failed for askarel: failed to map the username to a DN. Authentication failed for altf4: failed to map the username to a Ddc=be', 0, '(objectClass=*)') search_s('uid=altf4,ou=users,dc=hsbxl,dc=be', 0, '(objectClass=*)') returned 1 objects: uid=altf4,ou=users,dc=hsbxl,dc=be uid=altf4,ou=users,dc=hsbxl,dc=be does not have a value for the attribute givenName uid=altf4,ou=users,dc=hsbxl,dc=be does not have a value for the attribute sn uid=altf4,ou=users,dc=hsbxl,dc=be is not a member of cn=noc_netbox_is_active,ou=groups,dc=hsbxl,dc=be uid=altf4,ou=users,dc=hsbxl,dc=be is not a member of cn=noc_netbox_is_staff,ou=groups,dc=hsbxl,dc=be uid=altf4,ou=users,dc=hsbxl,dc=be is a member of cn=noc,ou=groups,dc=hsbxl,dc=be null value in column "name" of relation "users_group" violates not-null constraint DETAIL: Failing row contains (24, null, ). while authenticating altf4 ``` I also observe that the username is created in the database (tried deleting them but problem persisted)
adam closed this issue 2025-12-29 21:35:07 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10712