[keycloak-user] Keycloak error 3.2.0 migration
Bill Burke
bburke at redhat.com
Mon Jul 17 18:09:34 EDT 2017
Ok, I tried this with out-of-the-box Keycloak 3.0 migrating to 3.2. It
works fine for me. So, see below?
On 7/17/17 2:24 PM, Bill Burke wrote:
> I'll try to reproduce. Not sure why adding a role would be an error as
> that's what the code is doing. Did you add roles to "realm-management"
> client? Specifically "query-clients", "query-users", "query-realms" or
> "query-groups"?
>
>
> On 7/17/17 5:52 AM, van der Vliet, Rody wrote:
>> Hi All,
>>
>> Within our project we are migrating our Keycloak version from 2.5.4 to 3.2.0 Final.
>> However we are getting below error when trying to run Keycloak 3.2.0 Final on our Test Environment.
>> (We also tried to migrate from 2.5.4 to 3.0.0. That was successful. But when tried to migrate 3.0.0 to 3.2.0, again same error.)
>>
>> It seems the migration scripts wants to include some DB records but is violating a unique constraint.
>> Is there anyone who has encountered the same problem or has an idea how we can resolve this issue?
>> Any help would be greatly appreciated.
>>
>> Regards,
>>
>> Rody van der Vliet
>> rody.van.der.vliet at accenture.com
>>
>> ERROR:
>>
>> 2017-07-17 11:33:05,475 DEBUG [org.hibernate.engine.spi.ActionQueue] (ServerService Thread Pool -- 57) Changes must be flushed to space: KEYCLOAK_ROLE
>> 2017-07-17 11:33:05,475 DEBUG [org.hibernate.SQL] (ServerService Thread Pool -- 57)
>> insert
>> into
>> KEYCLOAK_ROLE
>> (CLIENT, CLIENT_REALM_CONSTRAINT, CLIENT_ROLE, DESCRIPTION, NAME, REALM, REALM_ID, SCOPE_PARAM_REQUIRED, ID)
>> values
>> (?, ?, ?, ?, ?, ?, ?, ?, ?)
>> 2017-07-17 11:33:05,506 DEBUG [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (ServerService Thread Pool -- 57) could not execute statement [n/a]: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (XYZ_KEYCLOAK.UK_J3RWUVD56ONTGSUHOGM184WW2-2) violated
>>
>> at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
>> at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
>> at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
>> at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
>> at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
>> at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
>> at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
>> at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1044)
>> at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
>> at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3584)
>> at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3665)
>> at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1352)
>> at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:537)
>> at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:204)
>> at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:45)
>> at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2886)
>> at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3386)
>> at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:89)
>> at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:560)
>> at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:434)
>> at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:337)
>> at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:50)
>> at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1251)
>> at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1319)
>> at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87)
>> at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606)
>> at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:483)
>> at org.keycloak.models.jpa.JpaRealmProvider.getClientRole(JpaRealmProvider.java:252)
>> at org.keycloak.models.cache.infinispan.RealmCacheSession.getClientRole(RealmCacheSession.java:743)
>> at org.keycloak.models.cache.infinispan.ClientAdapter.getRole(ClientAdapter.java:572)
>> at org.keycloak.migration.migrators.MigrateTo3_2_0.addRoles(MigrateTo3_2_0.java:66)
>> at org.keycloak.migration.migrators.MigrateTo3_2_0.migrate(MigrateTo3_2_0.java:50)
>> at org.keycloak.migration.MigrationModelManager.migrate(MigrationModelManager.java:84)
>> at org.keycloak.services.resources.KeycloakApplication.migrateModel(KeycloakApplication.java:243)
>> at org.keycloak.services.resources.KeycloakApplication.migrateAndBootstrap(KeycloakApplication.java:184)
>> at org.keycloak.services.resources.KeycloakApplication$1.run(KeycloakApplication.java:143)
>> at org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:227)
>> at org.keycloak.services.resources.KeycloakApplication.<init>(KeycloakApplication.java:134)
>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>> at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:150)
>> at org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2209)
>> at org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:299)
>> at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:240)
>> at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:113)
>> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)
>> at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
>> at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
>> at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
>> at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:231)
>> at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:132)
>> at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:526)
>> at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:101)
>> at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
>> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>> at java.lang.Thread.run(Thread.java:745)
>> at org.jboss.threads.JBossThread.run(JBossThread.java:320)
>>
>> 2017-07-17 11:33:05,506 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (ServerService Thread Pool -- 57) SQL Error: 1, SQLState: 23000
>> 2017-07-17 11:33:05,506 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (ServerService Thread Pool -- 57) ORA-00001: unique constraint (XYZ_KEYCLOAK.UK_J3RWUVD56ONTGSUHOGM184WW2-2) violated
>>
>> ==================================================
>> The information transmitted via this e-mail is intended only for the person or
>> entity to which it is addressed and may contain confidential and/or privileged
>> material. Any review, retransmission, dissemination or other use of, or
>> taking of any action in reliance upon this information by persons or entities
>> other than the intended recipient is prohibited. If you received this in error,
>> please contact the sender and delete the material from any computer
>>
>> ________________________________
>>
>> This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.
>> ______________________________________________________________________________________
>>
>> www.accenture.com
>> _______________________________________________
>> keycloak-user mailing list
>> keycloak-user at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/keycloak-user
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
More information about the keycloak-user
mailing list