Unable to Login or Search for User in RH-SSO (ERROR: invalid byte sequence)

Solution Verified - Updated -

Issue

  • Searching for users in the RH-SSO admin console, results in the following error:

    DEBUG [org.keycloak.storage.ldap.LDAPStorageProvider] Imported new user from LDAP to Keycloak DB. Username: [user1], Email: [user1@example.com], LDAP_ID: [....], LDAP Entry DN: [cn=user1,ou=xxxx,ou=xxxx,ou=xxxx,o=xxxx]
    ...
    DEBUG [org.keycloak.transaction.JtaTransactionWrapper] JtaTransactionWrapper  commit
    WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: 22021
    ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] ERROR: invalid byte sequence for encoding "UTF8": 0x00
    ERROR [org.hibernate.internal.ExceptionMapperStandardImpl] HHH000346: Error during managed flush [org.hibernate.exception.DataException: could not execute statement]
    WARN  [com.arjuna.ats.arjuna] ARJUNA012125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple< 0:ffff0ab0f04d:7b233f4a:5e8c285a:15eb4b, org.wildfly.transaction.client.AbstractTransaction$AssociatingSynchronization@44be1dd5 >: javax.persistence.PersistenceException: org.hibernate.exception.DataException: could not execute statement
    ...
    Caused by: org.postgresql.util.PSQLException: ERROR: invalid byte sequence for encoding "UTF8": 0x00
    
  • When user tries to login I see the same behaviour.

  • We set the 'UUID LDAP attribute' to 'guid' and this has the following value for the user:
    HEX: 08 9e 03 5c 37 ea ...

Environment

  • Red Hat Single Sign-On (RH-SSO)
    • 7.3.7
  • PostgreSQL

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content