LDAP call results in status 500: invalid memory address or nil pointer dereference #2428

Closed
opened 2025-11-02 04:35:47 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @tvannahl on GitHub (Oct 22, 2018).

  • Gitea version (or commit ref): 1.5.2
  • Git version: 1.8.3.1
  • Operating system: CentOS 7
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Active Directory Authentication
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • [] Not relevant
  • Log gist:

gitea_crash.log

Description

Everything related to LDAP/Active Directory appears to cause crashes in the gitea server. This problem occured after a recent migration from sqlite3 to mariadb 10.2 and the upgrade from 1.5.1 -> 1.5.2.
From what I have tested, can be triggered by the following tasks:

  • Login of Active Directory Users
  • Editing the LDAP (via BindDN) authentication source.
Originally created by @tvannahl on GitHub (Oct 22, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.5.2 - Git version: 1.8.3.1 - Operating system: CentOS 7 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Active Directory Authentication - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [] Not relevant - Log gist: [gitea_crash.log](https://github.com/go-gitea/gitea/files/2501775/gitea_crash.log) ## Description Everything related to LDAP/Active Directory appears to cause crashes in the gitea server. This problem occured after a recent migration from sqlite3 to mariadb 10.2 and the upgrade from 1.5.1 -> 1.5.2. From what I have tested, can be triggered by the following tasks: - Login of Active Directory Users - Editing the `LDAP (via BindDN)` authentication source.
GiteaMirror added the type/bug label 2025-11-02 04:35:47 -06:00
Author
Owner

@lunny commented on GitHub (Oct 22, 2018):

Is your installation a fresh one or upgraded from an old one?

@lunny commented on GitHub (Oct 22, 2018): Is your installation a fresh one or upgraded from an old one?
Author
Owner

@tvannahl commented on GitHub (Oct 22, 2018):

Oh sorry, forgot to add that: The installation has recently been migrated from sqlite3 to mariadb 10.2 and after that migration the update from 1.5.1 to 1.5.2 has been done.

@tvannahl commented on GitHub (Oct 22, 2018): Oh sorry, forgot to add that: The installation has recently been migrated from sqlite3 to mariadb 10.2 and after that migration the update from 1.5.1 to 1.5.2 has been done.
Author
Owner

@lafriks commented on GitHub (Oct 22, 2018):

Can you give anonymized ldap settings you are using?

@lafriks commented on GitHub (Oct 22, 2018): Can you give anonymized ldap settings you are using?
Author
Owner

@tvannahl commented on GitHub (Oct 22, 2018):

Got the settings strait from the database:

| id | type | name                 | is_actived | is_sync_enabled | cfg                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | created_unix | updated_unix |
+----+------+----------------------+------------+-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+--------------+
|  3 |    2 | SWW Active Directory |          1 |               0 | {"Name":"SWW Active Directory","Host":"nori.erk•••.de","Port":636,"SecurityProtocol":1,"SkipVerify":false,"BindDN":"gitea@erk••••.de","BindPassword":"••••••••","UserBase":"DC=erk•••••,dc=de","UserDN":"","AttributeUsername":"cn","AttributeName":"givenName","AttributeSurname":"sn","AttributeMail":"userPrincipalName","AttributesInBind":false,"Filter":"(u0026(objectClass=user)(sAMAccountName=%s))","AdminFilter":"(u0026(sAMAccountName=tvannahl))","Enabled":true} |   1529599875 |   1529678111 |

I am a little worried about those u0026 within the filters. But changing them to & did help either - this looks now a lot like #4888 only with runtime error as a bonus.

@tvannahl commented on GitHub (Oct 22, 2018): Got the settings strait from the database: ``` | id | type | name | is_actived | is_sync_enabled | cfg | created_unix | updated_unix | +----+------+----------------------+------------+-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+--------------+ | 3 | 2 | SWW Active Directory | 1 | 0 | {"Name":"SWW Active Directory","Host":"nori.erk•••.de","Port":636,"SecurityProtocol":1,"SkipVerify":false,"BindDN":"gitea@erk••••.de","BindPassword":"••••••••","UserBase":"DC=erk•••••,dc=de","UserDN":"","AttributeUsername":"cn","AttributeName":"givenName","AttributeSurname":"sn","AttributeMail":"userPrincipalName","AttributesInBind":false,"Filter":"(u0026(objectClass=user)(sAMAccountName=%s))","AdminFilter":"(u0026(sAMAccountName=tvannahl))","Enabled":true} | 1529599875 | 1529678111 | ``` I am a little worried about those `u0026` within the filters. But changing them to `&` did help either - this looks now a lot like #4888 only with runtime error as a bonus.
Author
Owner

@lafriks commented on GitHub (Oct 24, 2018):

Yes, closing as duplicate of #4888

@lafriks commented on GitHub (Oct 24, 2018): Yes, closing as duplicate of #4888
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2428