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

**URL:** <https://community.learningequality.org/t/resolved-internal-500-error-on-successful-redirection-from-idp/2673>\
**Category:** Kolibri\
**Tags:** installation, content\
**Created:** [December 19, 2022, 10:00am UTC](https://community.learningequality.org/t/resolved-internal-500-error-on-successful-redirection-from-idp/2673 "2022-12-19T10:00:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhammad\_Hani](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.learningequality.org/muhammad_hani/32/1400_2.png) [@Muhammad\_Hani](https://community.learningequality.org/u/Muhammad_Hani)\
**Post date:** [December 19, 2022, 10:00am UTC](https://community.learningequality.org/t/resolved-internal-500-error-on-successful-redirection-from-idp/2673/1 "2022-12-19T10:00:08Z")

</div>

## 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).

---

<div class="post-metadata">

**Author:** ![jredrejo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.learningequality.org/jredrejo/32/561_2.png) [@jredrejo](https://community.learningequality.org/u/jredrejo)\
**Post date:** [December 23, 2022, 4:47pm UTC](https://community.learningequality.org/t/resolved-internal-500-error-on-successful-redirection-from-idp/2673/2 "2022-12-23T16:47:18Z")

</div>

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](https://github.com/learningequality/kolibri-oidc-client-plugin/issues/15)
