Keycloak 17 - cannot create realm with java client

I want to create a new realm via the java client.
Here is my code - its pretty simple - I use the quarkus keycloak client (quarkus-keycloak-admin-client)

@Dependent
public class InitKeycloak {

    private static final String serverUrl = "http://localhost:8099/";
    private static final String realm = "master";
    private static final String username = "admin";
    private static final String password = "admin";
    private static final String clientId = "admin-cli";
    private static final String appRealmName = "test";

    public void createSimpleRealm() {

        RealmRepresentation realm = new RealmRepresentation();
        realm.setRealm(appRealmName);
        realm.setEnabled(true);

        Keycloak keycloak = KeycloakBuilder
                .builder()
                .serverUrl(serverUrl)
                .realm("master")
                .username(username)
                .password(password)
                .clientId(clientId)
                .resteasyClient(new ResteasyClientBuilderImpl().connectionPoolSize(10).build())
                .build();

        keycloak.realms().create(realm);
    }

keycloak 17 is running in a local docker container.

docker run -d -p 8099:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:17.0.0 start-dev

The code is executed in a quarkus 2.7.1 project.

In Quarkus I get an HTTP 500 and in Keycloak I see the following error:

2022-02-18 09:54:26,562 ERROR [org.keycloak.services.error.KeycloakErrorHandler] (executor-thread-44) Uncaught server error: java.lang.NullPointerException
        at org.keycloak.services.managers.RealmManager.determineDefaultRoleName(RealmManager.java:610)
        at org.keycloak.services.managers.RealmManager.importRealm(RealmManager.java:518)
        at org.keycloak.services.managers.RealmManager.importRealm(RealmManager.java:495)
        at org.keycloak.services.resources.admin.RealmsAdminResource.importRealm(RealmsAdminResource.java:133)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:170)
        at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:130)
        at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:660)
        at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:524)
        at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:474)
        at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)

Can you give me a hint whats going wrong? I checked several test suites where you do the same …
Reading stuff (like realm details) works - but the realm creation fails …

Thanks Max

Getting a very similar error when trying to create the realm from an export using the REST-api -

(using curl & co like shown in the examples here - https://www.lisenet.com/2020/create-a-keycloak-realm-using-admin-rest-api/)

When importing the realm-export via Web-UI - everything works fine…

I think the minimum viable realm is

{"enabled":true,"id":"foo","realm":"foo"}