Repository navigation
ERROR: Failed to run 'build' command #36356
DescriptionFROM quay.io/keycloak/keycloak:26.0.6 AS builder ENV KC_HEALTH_ENABLED=true ENV KC_DB=mssql FROM quay.io/keycloak/keycloak:26.0.6 ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]apiVersion: apps/v1 apiVersion: v1 apiVersion: v1 kubectl logs -f -n keycloak keycloak-7b7896fd58-t4hjx 2025-01-10 17:52:41,511 DEBUG [io.smallrye.config] (main) SRCFG01006: Loaded ConfigSource io.smallrye.config.ConfigSourceContext$ConfigSourceContextConfigSource with ordinal 2147483647 2025-01-10 17:52:41,511 DEBUG [io.smallrye.config] (main) SRCFG01006: Loaded ConfigSource DefaultValuesConfigSource with ordinal -2147483648 2025-01-10 17:52:41,530 DEBUG [io.smallrye.config] (main) SRCFG01006: Loaded ConfigSource io.smallrye.config.ConfigSourceContext$ConfigSourceContextConfigSource with ordinal 2147483647 2025-01-10 17:52:41,530 DEBUG [io.smallrye.config] (main) SRCFG01006: Loaded ConfigSource DefaultValuesConfigSource with ordinal -2147483648 2025-01-10 17:52:41,532 DEBUG [io.smallrye.config] (main) SRCFG01006: Loaded ConfigSource PropertiesConfigSource[source=CliConfigSource] with ordinal 600 2025-01-10 17:52:41,532 DEBUG [io.smallrye.config] (main) SRCFG01006: Loaded ConfigSource KcEnvVarConfigSource with ordinal 500 2025-01-10 17:52:41,532 DEBUG [io.smallrye.config] (main) SRCFG01006: Loaded ConfigSource QuarkusProperties with ordinal 450 2025-01-10 17:52:41,532 DEBUG [io.smallrye.config] (main) SRCFG01006: Loaded ConfigSource file:/opt/keycloak/bin/../conf/keycloak.conf with ordinal 450 2025-01-10 17:52:41,532 DEBUG [io.smallrye.config] (main) SRCFG01006: Loaded ConfigSource SysPropConfigSource with ordinal 400 2025-01-10 17:52:41,532 DEBUG [io.smallrye.config] (main) SRCFG01006: Loaded ConfigSource EnvConfigSource with ordinal 300 2025-01-10 17:52:41,532 DEBUG [io.smallrye.config] (main) SRCFG01006: Loaded ConfigSource PropertiesConfigSource[source=jar:file:///opt/keycloak/lib/app/keycloak.jar!/application.properties] with ordinal 250 2025-01-10 17:52:41,532 DEBUG [io.smallrye.config] (main) SRCFG01006: Loaded ConfigSource PropertiesConfigSource[source=jar:file:///opt/keycloak/lib/lib/main/org.keycloak.keycloak-quarkus-server-26.0.6.jar!/application.properties] with ordinal 250 2025-01-10 17:52:41,532 DEBUG [io.smallrye.config] (main) SRCFG01006: Loaded ConfigSource PersistedConfigSource with ordinal 200 2025-01-10 17:52:41,532 DEBUG [io.smallrye.config] (main) SRCFG01006: Loaded ConfigSource jar:file:///opt/keycloak/lib/lib/main/org.keycloak.keycloak-quarkus-server-26.0.6.jar!/META-INF/keycloak.conf with ordinal 150 2025-01-10 17:52:41,532 DEBUG [io.smallrye.config] (main) SRCFG01006: Loaded ConfigSource DefaultValuesConfigSource with ordinal -2147483648 2025-01-10 17:52:41,825 DEBUG [org.keycloak.quarkus.runtime.configuration.mappers.PropertyMappers] (main) Duplicated mappers for key 'kc.dir'. Used the first found. 2025-01-10 17:52:41,826 DEBUG [org.keycloak.quarkus.runtime.configuration.mappers.PropertyMappers] (main) Duplicated mappers for key 'kc.dir'. Used the first found. 2025-01-10 17:52:41,826 DEBUG [org.keycloak.quarkus.runtime.configuration.mappers.PropertyMappers] (main) Duplicated mappers for key 'kc.dir'. Used the first found. 2025-01-10 17:52:41,827 DEBUG [org.keycloak.quarkus.runtime.configuration.mappers.PropertyMappers] (main) Duplicated mappers for key 'kc.dir'. Used the first found. 2025-01-10 17:52:41,828 DEBUG [org.keycloak.quarkus.runtime.configuration.mappers.PropertyMappers] (main) Duplicated mappers for key 'kc.dir'. Used the f 10000 irst found. 2025-01-10 17:52:41,927 WARN [org.keycloak.quarkus.runtime.cli.Picocli] (main) The following run time options were found, but will be ignored during build time: kc.db-url, kc.db-url-port, kc.db-username, kc.db-password, kc.db-pool-initial-size, kc.db-pool-min-size, kc.db-pool-max-size, kc.hostname, kc.hostname-strict, kc.log-level, kc.bootstrap-admin-username, kc.bootstrap-admin-password 2025-01-10 17:52:41,941 TRACE [java.io.serialization] (main) Builtin factory: null -> new: null 2025-01-10 17:52:42,330 TRACE [java.io.serialization] (main) Builtin factory: null -> new: null ERROR: Failed to run 'build' command. |
Replies: 5 comments
|
Trying to deploy this on a minikube cluster. Keycloak pods failed to start with the build error as seen in the above comment. Also tried to pass "build" argument instead of "start --optimized", no luck though. why is it not running up successfully when deployed on cluster when the docker image is running without any issues? |
|
Generally you'll want to use the operator to manage keycloak on kubernetes. I see you have 2 replicas - you should not use a Deployment - see https://www.keycloak.org/getting-started/getting-started-scaling-and-tuning.
Seems like the image is not what you expected as the build is being performed there. |
|
the only reason I use replicas 2 to test the infinispan clustering.... I strongly believe deployment should work, I'm able to run 2 replicas using bitnami/keycloak image. the image is the custom image, only add sqlserver driver for rebuilding the image. Its no different otherwise. |
For the sake of anyone else reading this discussion, that is not yet recommended. The scaling guide should be consulted to understand the current limitations.
Something is definitely not right. "start --optimized" for example will not cause a build to run at all, so it doesn't appear that your command args are bing used. I would try using the default non-optimized image instead with just a start command to further determine what is amiss with what you are doing. |
|
I figured out the issue, responding here for anyone experienced the same issue. the reason that the container is throwing failed to run the build command is because the docker image is built before the jdbc jar is copied. All I have to do on the Dockerfile is to move this build command to the end of the file just before the ENTRYPOINT and it worked just fine. ... That's all I have to do. |
I figured out the issue, responding here for anyone experienced the same issue.
the reason that the container is throwing failed to run the build command is because the docker image is built before the jdbc jar is copied. All I have to do on the Dockerfile is to move this build command to the end of the file just before the ENTRYPOINT and it worked just fine.
...
RUN /opt/keycloak/bin/kc.sh build
ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]
That's all I have to do.