Uploaded image for project: 'Red Hat build of Keycloak'
  1. Red Hat build of Keycloak
  2. RHBK-2906

The root cause of error is suppressed in KC 26 at building [GHI#36482]

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Before reporting an issue

      [x] 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

      dependencies

      Describe the bug

      If we have any error at KC's building phase, then the real root cause of error is suppressed. Threrefore the KC's admin is not able to detect real root cause of error.

      In KC 25 and less KC's admin is able to see real stacktrace. This bug is reproduced in version 26 only.

      Version

      26.0.8

      Regression

      [x] The issue is a regression

      Expected behavior

      The stacktrace looks like:

      ...
      Caused by: java.lang.ClassNotFoundException: some.required.ClassName
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:525)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:473)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:523)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:473)
        ... 24 more
      

      And root cause of error is clear. We missed dependency in providers directory.

      Actual behavior

      The stacktrace looks like:

      ERROR: Failed to run 'build' command.
      Error details:
      java.lang.NullPointerException
        at java.base/java.util.Objects.requireNonNull(Objects.java:233)
        at java.base/java.util.ImmutableCollections$List12.<init>(ImmutableCollections.java:563)
        at java.base/java.util.List.of(List.java:937)
        at io.quarkus.paths.OpenContainerPathTree.getRoots(OpenContainerPathTree.java:96)
        at io.quarkus.paths.SharedArchivePathTree$CallerOpenPathTree.getRoots(SharedArchivePathTree.java:142)
        at io.quarkus.bootstrap.classloading.PathTreeClassPathElement.toString(PathTreeClassPathElement.java:214)
        at java.base/java.util.Formatter$FormatSpecifier.printString(Formatter.java:3158)
        at java.base/java.util.Formatter$FormatSpecifier.print(Formatter.java:3036) 
      

      The root cause is not clear.
      Stacktrace of root cause is suppressed.

      How to Reproduce?

      1. Add any extension, with a dependency to another jar, to providers directory
      2. Exclude the dependency from providers directory
      3. Run Keycloak building as kc.bat|sh build --verbose

      Anything else?

      Existing issue with same error
      https://github.com/keycloak/keycloak/issues/35742

              Unassigned Unassigned
              pvlha Pavel Vlha
              Keycloak Cloud Native
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: