Uploaded image for project: 'Keycloak'
  1. Keycloak
  2. KEYCLOAK-14388

OCP-RHSSO 7.4 not able to connect to external postgresql database ("No connection to the controller.")

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Out of Date
    • Affects Version/s: RH-SSO-7.4.0
    • Fix Version/s: None
    • Component/s: Containers - RH-SSO
    • Labels:
      None
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      1. we are is trying to map an external datasource as indicated in Red Hat doc [1].

      2. A custom batch file has been written to remove existing datasource, and connect to external datasource, as described per RH-SSO documentation [1].

      [1] https://access.redhat.com/documentation/en-us/red_hat_single_sign-on/7.4/html/red_hat_single_sign-on_for_openshift_on_openjdk/advanced_concepts#sso-using-custom-jdbc-driver

      3. Upon pod startup, this batch script is executed and generates an error: "No connection to the controller."

      ~~~
      batch

      set DB_DRIVER_NAME=postgresql
      set DB_USERNAME=username
      set DB_PASSWORD=password
      set DB_JDBC_URL="jdbc:postgresql://example.com:4000/dev?ssl=true&sslmode=verify-ca&sslfactory=org.postgresql.ssl.DefaultJavaSSLFactory"

      /subsystem=datasources/data-source=KeycloakDS:remove()
      /subsystem=datasources/data-source=KeycloakDS:add(jndi-name=java:jboss/datasources/KeycloakDS, enabled=true, use-java-context=true, connection-url=$DB_JDBC_URL, driver-name=$DB_DRIVER_NAME, user-name=$DB_USERNAME, password=$DB_PASSWORD )

      run-batch
      quit

      ~~~

      4. As the current postgre datasource connection has been removed, and as it is not able to connect to external datasource

      due to previous error, it uses h2 database as fallback.

      5. Info log trace
      ~~~
      INFO Access log is disabled, ignoring configuration.
      You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
      [disconnected /] embed-server --std-out=echo --server-config=standalone-openshift.xml
      15:27:20,342 INFO [org.jboss.modules] (CLI command executor) JBoss Modules version 1.9.1.Final-redhat-00001
      ...
      ...
      ...
      15:27:42,751 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: Red Hat Single Sign-On 7.4.0.GA (WildFly Core 10.1.2.Final-redhat-00001) started in 22207ms - Started 55 of 86 services (40 services are lazy, passive or on-demand)
      [standalone@embedded /] batch
      [standalone@embedded / #]
      [standalone@embedded / #]
      [standalone@embedded / #]
      [standalone@embedded / #] set DB_DRIVER_NAME=postgresql
      [standalone@embedded / #]
      [standalone@embedded / #] set DB_USERNAME=username
      [standalone@embedded / #]
      [standalone@embedded / #] set DB_PASSWORD=password
      [standalone@embedded / #]
      [standalone@embedded / #] set DB_JDBC_URL="jdbc:postgresql://example.com:4000/dev?ssl=true&sslmode=verify-ca&sslfactory=org.postgresql. ssl.NonValidatingFactory&"
      [standalone@embedded / #]
      [standalone@embedded / #]
      [standalone@embedded / #]
      [standalone@embedded / #] /subsystem=datasources/data-source=KeycloakDS:remove()
      No connection to the controller.
      [standalone@embedded / #]
      [standalone@embedded / #] /subsystem=datasources/data-source=KeycloakDS:add(jndi-name=java:jboss/datasources/KeycloakDS, enabled=true, use-java-context=true, co nnection-url=$DB_JDBC_URL, driver-name=$DB_DRIVER_NAME, user-name=$DB_USERNAME, password=$DB_PASSWORD )
      No connection to the controller.
      [standalone@embedded / #]
      [standalone@embedded / #]
      [standalone@embedded / #]
      [standalone@embedded / #] run-batch
      The command is not available in the current context (e.g. required subsystems or connection to the controller might be unavailable).
      [standalone@embedded / #] quit

      ~~~

      https://access.redhat.com/documentation/en-us/red_hat_single_sign-on/7.4/html/red_hat_single_sign-on_for_openshift_on_openjdk/advanced_concepts#sso-using-custom-jdbc-driver

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                abstractj Bruno Oliveira da Silva
                Reporter:
                orivat_redhat Olivier Rivat
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: