LDAP Authentication Error – ActiveSupport::MessagePack::UnserializableObjectError

AI-generated summary

A user reports an LDAP authentication error in the discourse-ldap-auth plugin on a self-hosted Discourse instance, with the error ActiveSupport::MessagePack::UnserializableObjectError related to an unsupported Net::BER::BerIdentifiedString type. The issue emerged after a rebuild and affects all users. Another user confirms the same problem, noting it occurs with new LDAP accounts created after upgrading to 3.6.0.beta2. The discussion highlights that the plugin is not officially supported by Discourse, and the team cannot provide direct assistance. The error appears to stem from handling special characters in LDAP usernames, particularly in Turkish (e.g., ü, ş, ğ). Osmanmermer, imbi, tobiaseigen, tobiaseigen, and imbi are involved in the thread, which has been moved to the bug category for further investigation.

Hi everyone,

I’m using the discourse-ldap-auth plugin on a self-hosted Discourse (Docker install).
After a recent rebuild, LDAP authentication started failing for all users.

Here’s the relevant error from production.log:

(ldap) Authentication failure! ldap_error: ActiveSupport::MessagePack::UnserializableObjectError,
Unsupported type Net::BER::BerIdentifiedString for object “******** (Kullanıcı Teknolojileri Yönetim Müdürlüğü)”
Started GET “/auth/failure?message=ldap_error&origin=http%3A%2F%2Fic*ot*rol.va**fb*nk.intra%2Flogin&strategy=ldap”
Processing by Users::OmniauthCallbacksController#failure as HTML
Completed 200 OK

Details

  • The issue affects all LDAP users.

  • All users in our LDAP directory have displayName values containing Turkish characters (ğ, ü, ş, İ, etc.).

  • The error occurs right after the LDAP authentication attempt — no user gets logged in.

Is this a general problem with the latest version of Discourse? Could it be related to a Ruby incompatibility? What solution do you suggest?

1 Like

Hello everyone and Osmanmermer,
We have had the same error here for a few days:
(ldap) Authentication failure! ldap_error: ActiveSupport::MessagePack::UnserializableObjectError, Unsupported type Net::BER::BerIdentifiedString for object "username"

  • The problem currently affects newly created LDAP users who have never logged in before.
  • It is independent of special characters.
1 Like

I shifted this to Contribute > Bug in case it is a bug introduced recently, since it appears to have affected two sites in s similar way.

Has anything changed on your end since last week? Has updating again fixed it?

Oops just noticed this is not an official plugin so not officially supported. I also am not immediately finding the plugin topic. We should move this into there. Can someone help find it? I am on the move currently and not at my desk.

1 Like

Hello, it concerns the update to 3.6.0.beta2 and the error only affects newly created accounts (Ldap user create mode) for us. Existing accounts can still log in. Rolling back to 3.6.0.beta1 resolves the issue. The LDAP Auth Plugin has not changed.

Sorry to hear you’re having trouble! Unfortunately the LDAP auth plugin is not written by us at Discourse and so is not supported. It does not even have a Customization > Plugin topic here. If you need help with it, contact the author on github or start a Marketplace topic to see if an expert in the community is up to the task.