[RESOLVED] Internal (500) Error on successful redirection from IDP

Summary

OIDC has been integrated successfully, upon clicking on sign in with OIDC my IDP keycloak is doing successful redirection but Kolibri server is showing internal (500) message on white page.

Error in kolibri logs file:

ERROR 2022-12-07 20:54:06,907 kolibri.core.deviceadmin.utils Cannot operate on a closed database.
ERROR 2022-12-07 20:54:06,927 kolibri.core.deviceadmin.utils Vacuum of database /home/username/.kolibri/db.sqlite3 couldn’t be executed. Possible reasons:

  • There is an open transaction in the db.
  • There are one or more active SQL statements.
    The full error: Cannot operate on a closed database.`

Options.ini file

# [Paths] # CONTENT_DIR = /home/username/.kolibri/content
`# CONTENT_FALLBACK_DIRS = [‘/home/username/.kolibri/’]

# [Database] # DATABASE_ENGINE = sqlite
# DATABASE_NAME = # DATABASE_PORT =
# DATABASE_PASSWORD = # DATABASE_HOST =
`# DATABASE_USER =

[Deployment]
HTTP_PORT =
ZIP_CONTENT_PORT = <CONTENT_PORT>
ZIP_CONTENT_ORIGIN = “<BASE_PATH>”
# HTTP_PORT = <PORT> # STATIC_USE_SYMLINKS = True
# LANGUAGES = ['ar', 'bg-bg', 'bn-bd', 'de', 'en', 'es-419', 'es-es', 'fa', 'ff-cm', 'fr-fr', 'gu-in', 'hi-in', 'it', 'km', 'ko', 'mr', 'my', 'nyn', 'pt-br', 'sw-tz', 'te', 'ur-pk', 'vi', 'yo', 'zh-hans'] # DISABLE_PING = False
# URL_PATH_PREFIX = / # RUN_MODE =

[OIDCClient]
PROVIDER_URL = /auth/realms//
AUTHORIZATION_ENDPOINT = /auth/realms//protocol/openid-connect/auth
TOKEN_ENDPOINT = /auth/realms//protocol/openid-connect/token
USERINFO_ENDPOINT = /auth/realms//protocol/openid-connect/userinfo
JWKS_URI = /auth/realms//protocol/openid-connect/certs
ENDSESSION_ENDPOINT = /auth/realms//protocol/openid-connect/logout
CLIENT_URL = BASE_URL

Technical details

Kolibri Version: 0.15.9
Kolibri Plugin OIDC: 0.3.1
OS: Linux

Steps to reproduce:

  1. pip install kolibri
  2. Modify options.ini and add OIDC settings
  3. pip install kolibri-oidc-client-plugin
  4. kolibri plugin enable kolibri_oidc_client_plugin
  5. kolibri restart

Kolibri restarts successfully, you can see OIDC login link on login page, you click on it, on successful redirection from IDP you will see Internal Server Error (500).

Closing this thread and renaming it adding [RESOLVED] as the problem was a misconfiguration in the keycloak server.
All the info is available at Internal (500) Error on successful redirection from IDP · Issue #15 · learningequality/kolibri-oidc-client-plugin · GitHub