Repository navigation
KC 19.0.2 unable to import realm from json file #15227
notTrinity
started this conversation in
Archive
Replies: 2 comments
|
Using a handmade version 19.0.2 exported realm file, I can import. Is there a way I could migrate my 15.0.2 realm.json, it is complicated and there is something wrong with the one I have tried to configure myself. |
0 replies
|
Issue was worked around, have to modify database to remove password policy. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Unable to import ream from data/imports using 19.0.2 Docker Quay.io image.
I am trying to import realm using the instructions and getting error
2022-10-28 16:00:06,240 WARN [org.keycloak.services] (main) KC-SERVICES0005: Unable to import realm MyRealm from file /opt/keycloak/bin/../data/import/myrealm-keycloak-realm.json.: java.lang.RuntimeException: Script upload is disabled
I am using the Docker exec:
exec /opt/keycloak/bin/kc.sh start --import-realm --https-port=8563 --db postgres --db-password platform --db-username platform
--db-url-host {KC_DB_PORT} --db-url jdbc:postgresql://${KC_DB_IP}:${KC_DB_PORT}/mydb
--https-trust-store-password {INTERNAL_KEYSTORE_PASSWORD} &
running shows:
java -Dkc.config.built=true -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF-8 -Dkeycloak.profile.feature.upload_scripts=enabled -agentlib:jdwp=transport=dt_socket,address=*:8787,server=y,suspend=n -Dkc.home.dir=/opt/keycloak/bin/../ -Djboss.server.config.dir=/opt/keycloak/bin/../conf -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dquarkus-log-max-startup-records=10000 -cp /opt/keycloak/bin/../lib/quarkus-run.jar io.quarkus.bootstrap.runner.QuarkusEntryPoint start --import-realm --https-port=8563 --db postgres --db-password myplatform --db-username myplatform --db-url-host mypsos-postgresql-svc.default.svc.cluster.local --db-url-port 6432 --db-url jdbc:postgresql://myos-postgresql-svc.default.svc.cluster.local:6432/mydb --https-trust-store-password mykey!trust --https-key-store-password mykey!key
The docker run command just runs the docker-entry script.
The file is uploaded from helm template and then copied into the data/import directory.
stack trace here:
2022-10-28 16:57:53,533 WARN [org.keycloak.services] (main) KC-SERVICES0005: Unable to import realm MyRealm from file /opt/keycloak/bin/../data/import/my-keycloak-realm.json.: java.lang.RuntimeException: Script upload is disabled
at org.keycloak.authorization.policy.provider.js.JSPolicyProviderFactory.throwCanNotUpdatePolicy(JSPolicyProviderFactory.java:130)
at org.keycloak.authorization.policy.provider.js.JSPolicyProviderFactory.onImport(JSPolicyProviderFactory.java:72)
at org.keycloak.models.utils.RepresentationToModel.toModel(RepresentationToModel.java:1216)
at org.keycloak.authorization.AuthorizationProvider$3.create(AuthorizationProvider.java:350)
at org.keycloak.models.utils.RepresentationToModel.importPolicies(RepresentationToModel.java:1138)
at org.keycloak.models.utils.RepresentationToModel.toModel(RepresentationToModel.java:1084)
at org.keycloak.models.utils.RepresentationToModel.importAuthorizationSettings(RepresentationToModel.java:1031)
at org.keycloak.storage.datastore.LegacyExportImportManager.lambda$importRealmAuthorizationSettings$7(LegacyExportImportManager.java:1399)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
All reactions