Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-73067

This plugin is not compatible with the relatively latest version of keycloak service like V24.0.1

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • keycloak-plugin
    • None
    • with Jenkins versionV2.440

      with Jenkins versionV2.440,this plugin works well with keycloak V18.0.2, but reported an  error log with keycloak V24.0.1.
      Hope this bug can be fixed as soon as possible, Thanks.

          [JENKINS-73067] This plugin is not compatible with the relatively latest version of keycloak service like V24.0.1

          Pinned comments

          Pinned by tianshu

          Vishal added a comment - - edited

          [^jenkins.log]

          For me its failing with this error

          java.lang.NullPointerException: Cannot invoke "org.keycloak.common.util.KeycloakUriBuilder.clone()" because the return value of "org.keycloak.adapters.KeycloakDeployment.getAuthUrl()" is null

          docker run -p 8081:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins

          docker run -p 8084:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:24.0.4 start-dev

           

          {   "realm": "ci",   "auth-server-url": "http://localhost:8084/",   "ssl-required": "external",   "resource": "jenkins",   "public-client": true,   "confidential-port": 0 }

          Vishal added a comment - - edited [^jenkins.log] For me its failing with this error java.lang.NullPointerException: Cannot invoke "org.keycloak.common.util.KeycloakUriBuilder.clone()" because the return value of "org.keycloak.adapters.KeycloakDeployment.getAuthUrl()" is null docker run -p 8081:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins docker run -p 8084:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:24.0.4 start-dev   {   "realm": "ci",   "auth-server-url": "http://localhost:8084/",   "ssl-required": "external",   "resource": "jenkins",   "public-client": true,   "confidential-port": 0 }

          All comments

          Matt R added a comment -

          Thank you for the bug report wangtianshu , are you able to post the error log too?

          Matt R added a comment - Thank you for the bug report wangtianshu , are you able to post the error log too?

          tianshu added a comment -

          I just uploaded the error log which running exception on  keycloak -V24.0.1 after I configured the plugin json data

          tianshu added a comment - I just uploaded the error log which running exception on  keycloak -V24.0.1 after I configured the plugin json data

          Matt R added a comment -

          Thank you! That helps. I will spin up a newer keycloak install to try and reproduce. It looks like from the log that there is an issue within the plugin that the library it is using to parse out the keycloak json is not getting some values set correctly. Recently we have seen that the json format has changed between Keycloak versions which has impacted that...so I am wondering if that might be the cause here too.

          I'll let you know what I am able to find and if I have a workaround/fix for it.

          Matt R added a comment - Thank you! That helps. I will spin up a newer keycloak install to try and reproduce. It looks like from the log that there is an issue within the plugin that the library it is using to parse out the keycloak json is not getting some values set correctly. Recently we have seen that the json format has changed between Keycloak versions which has impacted that...so I am wondering if that might be the cause here too. I'll let you know what I am able to find and if I have a workaround/fix for it.

          Brandy added a comment - - edited

          Thanks for sharing this with us. It's so interesting. https://www.mydestiny-card.com

          Brandy added a comment - - edited Thanks for sharing this with us. It's so interesting. https://www.mydestiny-card.com

          Matt R added a comment -

          Hi wangtianshu ,

          Sorry for the delay but I was unable to reproduce it locally using the current release of this plugin (2.3.2) with the latest Keycloak version (24.0.4). Relooking at your log, the original error appears to be that the keycloak plugin within jenkins was unable to access your keycloak server - 

          2024-04-26 00:43:37.699+0000 [id=17]	WARN	o.k.adapters.KeycloakDeployment#resolveUrls: Failed to load URLs from http://localhost:8080/realms/himalaya-web/.well-known/openid-configuration
          java.lang.Exception: Forbidden
          

          Are you able to make sure all of the URLs within both your client settings in Keycloak and also in the configuration json within Jenkins are correct? Also, if you haven't yet, try to re-export the configuration json from keycloak and paste it back in to keycloak.

          Thanks!

          Matt R added a comment - Hi wangtianshu , Sorry for the delay but I was unable to reproduce it locally using the current release of this plugin (2.3.2) with the latest Keycloak version (24.0.4). Relooking at your log, the original error appears to be that the keycloak plugin within jenkins was unable to access your keycloak server -  2024-04-26 00:43:37.699+0000 [id=17] WARN o.k.adapters.KeycloakDeployment#resolveUrls: Failed to load URLs from http: //localhost:8080/realms/himalaya-web/.well-known/openid-configuration java.lang.Exception: Forbidden Are you able to make sure all of the URLs within both your client settings in Keycloak and also in the configuration json within Jenkins are correct? Also, if you haven't yet, try to re-export the configuration json from keycloak and paste it back in to keycloak. Thanks!

          Pinned by tianshu

          Vishal added a comment - - edited

          [^jenkins.log]

          For me its failing with this error

          java.lang.NullPointerException: Cannot invoke "org.keycloak.common.util.KeycloakUriBuilder.clone()" because the return value of "org.keycloak.adapters.KeycloakDeployment.getAuthUrl()" is null

          docker run -p 8081:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins

          docker run -p 8084:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:24.0.4 start-dev

           

          {   "realm": "ci",   "auth-server-url": "http://localhost:8084/",   "ssl-required": "external",   "resource": "jenkins",   "public-client": true,   "confidential-port": 0 }

          Vishal added a comment - - edited [^jenkins.log] For me its failing with this error java.lang.NullPointerException: Cannot invoke "org.keycloak.common.util.KeycloakUriBuilder.clone()" because the return value of "org.keycloak.adapters.KeycloakDeployment.getAuthUrl()" is null docker run -p 8081:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins docker run -p 8084:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:24.0.4 start-dev   {   "realm": "ci",   "auth-server-url": "http://localhost:8084/",   "ssl-required": "external",   "resource": "jenkins",   "public-client": true,   "confidential-port": 0 }

          tianshu added a comment -

          open the error log which I uploaded ,as you can see it was the same error log content chowdhuryvishal97 

          tianshu added a comment - open the error log which I uploaded ,as you can see it was the same error log content chowdhuryvishal97  

          Vishal added a comment -

          I installed both jenkins and keycloak on my windows machine and its woking.
          Most probably I didn't handle docker networking properly.

          Vishal added a comment - I installed both jenkins and keycloak on my windows machine and its woking. Most probably I didn't handle docker networking properly.

            mrmateo Matt R
            wangtianshu tianshu
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: