Skip to content

In imported realms, the ability to use environment variables has disappeared #33578

Closed
@eabykov

Description

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

import-export

Describe the bug

In imported realms, the ability to use environment variables has disappeared

Works on the Keycloak 25.0.6 and crashes on the Keycloak: 26.0.0

Running as container in the docker compose. Startup options: start-dev --import-realm

Realm JSON:

{
  "id": "${KC_REALM_NAME}",
  "realm": "${KC_REALM_NAME}",
  "sslRequired": "none",
  "enabled": true,
  "eventsEnabled": true,
  "eventsExpiration": 900,
  "adminEventsEnabled": true,
  "adminEventsDetailsEnabled": true,
  "attributes": {
    "adminEventsExpiration": "900"
  },
  "clients": [
    {
      "id": "grafana",
      "clientId": "grafana",
      "name": "grafana",
      "enabled": true,
      "publicClient": true,
      "rootUrl": "${GF_URL}",
      "adminUrl": "${GF_URL}",
      "baseUrl": "${GF_URL}",
      "redirectUris": [
        "${GF_URL}/*"
      ],
      "webOrigins": [
        "${GF_URL}"
      ]
    }
  ],
  "users": [
    {
      "id": "admin",
      "email": "${GF_ADMIN_USERNAME}@admin",
      "username": "${GF_ADMIN_USERNAME}",
      "firstName": "DevOps",
      "lastName": "SRE",
      "enabled": true,
      "emailVerified": true,
      "credentials": [
        {
          "temporary": false,
          "type": "password",
          "value": "${GF_ADMIN_PASSWORD}"
        }
      ]
    }
  ]
}

Version

26.0.0

Regression

  • The issue is a regression

Expected behavior

The Realm was imported with the substitution of environment variables

Actual behavior

Keycloak crashes with message:

keycloak-1    | 2024-10-04 10:17:16,990 INFO  [org.keycloak.exportimport.singlefile.SingleFileImportProvider] (main) Full importing from file /opt/keycloak/bin/../data/import/realm.json
keycloak-1    | 2024-10-04 10:17:16,993 WARN  [org.keycloak.utils.ReservedCharValidator] (main) Character '$' not allowed.
keycloak-1    | 2024-10-04 10:17:17,019 WARN  [io.agroal.pool] (main) Datasource '<default>': JDBC resources leaked: 3 ResultSet(s) and 0 Statement(s)
keycloak-1    | 2024-10-04 10:17:17,053 INFO  [com.arjuna.ats.jbossatx] (main) ARJUNA032014: Stopping transaction recovery manager
keycloak-1    | 2024-10-04 10:17:17,071 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (development) mode
keycloak-1    | 2024-10-04 10:17:17,071 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Character '$' not allowed.
keycloak-1    | 2024-10-04 10:17:17,071 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) 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-1 exited with code 1

How to Reproduce?

Run the current version of the project: https://github.com/eabykov/keycloak-compose/tree/26.0.0

The main branch works with version 25.0.6

Anything else?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions