Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to run 'build' command on upgrading version from 22.0.5 to 23.0.0 #25019

Closed
1 task done
selimppc opened this issue Nov 25, 2023 · 6 comments
Closed
1 task done
Labels
area/dist/quarkus kind/bug Categorizes a PR related to a bug team/cloud-native

Comments

@selimppc
Copy link

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

core

Describe the bug

I have a Keycloak server with the version of 22.0.5 which is working nicely.
Now I want to upgrade my version from 22.0.5 to 23.0.0 as below:

.env:

KC_DB_URL=jdbc:postgresql://host.docker.internal:5435/keycloak
KC_DB_USERNAME=postgres
KC_DB_PASSWORD=

docker-compose.yml:

version: '3.3'
services:
  keycloak:
    build:
      context: .
      dockerfile: Dockerfile
      args:
        ENCODED_PRIVATE_KEY: ${ENCODED_PRIVATE_KEY}
        KEYSTORE_PASSWORD: ${KEYSTORE_PASSWORD}
    environment:
      - KC_DB=postgres
      - KC_DB_URL=${KC_DB_URL}
      - KC_DB_USERNAME=${KC_DB_USERNAME}
      - KC_DB_PASSWORD=${KC_DB_PASSWORD}
      - KC_PORT=8080
      - KEYCLOAK_ADMIN=admin
      - KEYCLOAK_ADMIN_PASSWORD=admin@secret@this
      - QUARKUS_TRANSACTION_MANAGER_ENABLE_RECOVERY=true
      - QUARKUS_PROFILE=prod
      - HOSTNAME_STRICT=false
      - PROXY=edge
    ports:
      - "8080:8080"
    volumes:
      - ./ObjectStore/:/ObjectStore/

and my Dockerfile:

ARG KEYCLOAK_VERSION=23.0.0

FROM quay.io/keycloak/keycloak:${KEYCLOAK_VERSION} as keycloak-builder

# Enable health, metrics support, configure database vendor
ENV KC_HEALTH_ENABLED=true
ENV KC_METRICS_ENABLED=true
ENV KC_DB=postgres

WORKDIR /opt/keycloak

# for demonstration purposes only, please make sure to use proper certificates in production instead
# RUN keytool -genkeypair -storepass password -storetype PKCS12 -keyalg RSA -keysize 2048 -dname "CN=server" -alias server -ext "SAN:c=DNS:localhost,IP:127.0.0.1" -keystore conf/server.keystore
RUN /opt/keycloak/bin/kc.sh build

# Stage 3: Final Keycloak image with the built JAR file
FROM quay.io/keycloak/keycloak:${KEYCLOAK_VERSION}
COPY --from=keycloak-builder /opt/keycloak/ /opt/keycloak/

ENV KC_RESTART="SameSite"
ENV KC_HOSTNAME_STRICT_HTTPS=false
ENV KC_HOSTNAME_STRICT=false
ENV KC_HTTP_ENABLED=true
ENV KC_LOG_LEVEL=warning
# ENV KC_PROXY=edge
ENV KC_PROXY_ADDRESS_FORWARDING=true
ENV QUARKUS_TRANSACTION_MANAGER_ENABLE_RECOVERY=true
ENV QUARKUS_PROFILE=prod

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

When I run $ docker-compose up --build it gives error as below:

keycloak-iam-keycloak-1  | ERROR: Failed to run 'build' command.
keycloak-iam-keycloak-1  | ERROR: Cannot invoke "io.smallrye.config.ConfigValue.withConfigSourceName(String)" because the return value of "org.keycloak.quarkus.runtime.configuration.mappers.PropertyMapper.transformValue(String, java.util.Optional, io.smallrye.config.ConfigSourceInterceptorContext)" is null
keycloak-iam-keycloak-1  | For more details run the same command passing the '--verbose' option. Also you can use '--help' to see the details about the usage of the particular command.
keycloak-iam-keycloak-1 exited with code 1

Note:

  1. I have a custom SPI
  2. Dependencies are updated.
  3. I kept all configurations as needed.
  4. I checked that all syntax and paths are configured correctly.

I don't understand the source of the error. From where it's coming?

Version

23.0.0

Expected behavior

The expected behavior is it will run without exiting the container.

As I am using the version 22.0.5 - it is working perfectly with my themes and custom API. The latest version 23.0.0 should work when upgrading my Keycloak version.

Actual behavior

keycloak-iam-keycloak-1  | 2023-11-25 05:27:11,466 TRACE [io.quarkus.bootstrap.classloading.QuarkusClassLoader] (main) Class quarkus.properties not found in parent first load from java.net.URLClassLoader@b70da4c
keycloak-iam-keycloak-1  | 
keycloak-iam-keycloak-1  | ERROR: Failed to run 'build' command.
keycloak-iam-keycloak-1  | ERROR: Cannot invoke "io.smallrye.config.ConfigValue.withConfigSourceName(String)" because the return value of "org.keycloak.quarkus.runtime.configuration.mappers.PropertyMapper.transformValue(String, java.util.Optional, io.smallrye.config.ConfigSourceInterceptorContext)" is null
keycloak-iam-keycloak-1  | For more details run the same command passing the '--verbose' option. Also you can use '--help' to see the details about the usage of the particular command.
keycloak-iam-keycloak-1 exited with code 1

How to Reproduce?

I have shared the 3 files here .env, docker-compose.yml, and Dockerfile :

Steps:

  1. Keep 3 files in a directory.
  2. Update the DB URL and credentials in the .env file.
  3. Just run the command $ docker-compose up --build

Result: Error will occur

Note:

  1. I am using Mac OSX with an M1 chip

Anything else?

No response

@selimppc selimppc added kind/bug Categorizes a PR related to a bug status/triage labels Nov 25, 2023
@jbenguira
Copy link

jbenguira commented Nov 26, 2023

same issue here on Ubuntu 22 / x64

@walejandromt
Copy link

i have this issue too

@marviobezerra
Copy link

Same here!

@shawkins
Copy link
Contributor

More than likely this is the same issue as #25010

@SebastEnn
Copy link

I have this issue too

@shawkins
Copy link
Contributor

Resolving as a duplicate of #25010

@shawkins shawkins closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2023
@ghost ghost removed the status/triage label Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dist/quarkus kind/bug Categorizes a PR related to a bug team/cloud-native
Projects
None yet
Development

No branches or pull requests

7 participants