[keycloak-user] Issue with database schema

Benoit Brouard bbr at activeviam.com
Fri Dec 8 04:00:43 EST 2017


Hi,

While upgrading to Keycloak 3.4.0, I just found that the database cannot 
be initialized when there is a schema.

I have the following error:
> Table "RESOURCE_SERVER_POLICY" not found; SQL statement:
> UPDATE RESOURCE_SERVER_POLICY p SET RESOURCE_SERVER_CLIENT_ID = 
> (SELECT CLIENT_ID FROM RESOURCE_SERVER s WHERE s.ID = 
> p.RESOURCE_SERVER_ID)

This issue seems to come from /jpa-changelog-authz-3.4.0.CR1.xml/ which 
contains hard coded SQL statements.

To reproduce the issue you have to do 2 changes in standalone.xml file:

  * Use the following connection url for the KeycloakDS data source:
    /jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE;INIT=CREATE
    SCHEMA IF NOT EXISTS mySchema/
  * add /<property name="schema" value="mySchema"/>/ in /connectionsJpa/


Thanks,
Benoit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: standalone.xml
Type: text/xml
Size: 30546 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/keycloak-user/attachments/20171208/e14e6837/attachment-0001.xml 


More information about the keycloak-user mailing list