Keycloak 17 "failed to initialize keycloak"

Hi,

Trying to run Keycloak 17 in container behind load balancer. Current setup:

AWS ALB
1 EC2 instance
Docker

Dockerfile:

FROM quay.io/keycloak/keycloak:17.0.0 as builder

ENV KC_METRICS_ENABLED=true
ENV KC_DB=mariadb

RUN /opt/keycloak/bin/kc.sh build

FROM quay.io/keycloak/keycloak:17.0.0
COPY --from=builder /opt/keycloak/lib/quarkus/ /opt/keycloak/lib/quarkus/
WORKDIR /opt/keycloak

ENV KC_LOG_LEVEL=DEBUG
ENV KC_PROXY=edge
ENV KC_HTTP_ENABLED=true

ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start"]

Docker run command:

docker run -d -p 8080:8080 \
    -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin \
    -e KC_DB_URL=jdbc:mariadb://ip-1-2-3-4.us-west-2.compute.internal:3306/keycloak17 \
    -e KC_DB_USERNAME=keycloak \
    -e KC_DB_PASSWORD=keycloak \
    -e KC_PROXY=edge \
    -e KC_HOSTNAME=keycloak.not-a-rea-ldomain.net \
    -e KC_HOSTNAME_STRICT=false \
    local/keycloak17

Everything seems to be fine, except when I try to go to an account console such as https://keycloak.not-a-real-domain.net/realms/Test123/account/ it fails with the below error:

failed to initialize keycloak

I don’t see anything obvious in the DEBUG log, I’ve also tried to set the frontend URL for the realm but that didn’t help either.

Any advice?

Thanks.

Hi,
goto the client ‘Account-console’ (under Master realms) and add ‘+’ to web origins.
tell me if it works for you.
Thanks.

1 Like

Hi @Raf,

Thanks, that worked. I had to do it for both “account” and “account-console”, which wasn’t immediately obvious, but thanks for your assistance.