Fix Keycloak Script Upload Is Disabled. How to export / import / backup your realm configuration.
--
Problem: “[org.keycloak.services.error.KeycloakErrorHandler] (default task-10) Uncaught server error: java.lang.RuntimeException: Script upload is disabled”
This article is about the problem of importing a realm by the web UI of KeyCloak. Mostly when you backup your configuration from KeyCloak you use the easy and comfortable way of UI.
After the export we should have a json file containing the whole configuration of the exported realm. When we then try to reimport the json. An error can occur:
2022-02-15 15:53:14,294 ERROR [org.keycloak.services.error.KeycloakErrorHandler] (default task-10) Uncaught server error: java.lang.RuntimeException: Script upload is disabled
Source: https://www.czetsuyatech.com/2019/12/keycloak-script-upload-is-disabled-when-importing-a-realm.html
For this problem or issue an easy-to-use solution exists.
Solution:
To fix the problem ssh into your container or server where you are running your KeyCloak instance. First stop your instance and then you can execute the following:
cd /bin
./standalone.sh -Dkeycloak.profile.feature.upload_scripts=enabled
After executing this and the server started you can again open the import page of the KeyCloak Web UI and the error should no longer exist.
I hope the article helped. Happy coding!