-
Notifications
You must be signed in to change notification settings - Fork 325
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
Crash after upgrade to v5.1.0: Panic due to nil pointer dereference #1091
Comments
I have the same problem when I try to upgrade from 4.5.0 to 5.0.0 or to 5.1.0 with same stack trace. |
@SND33 @sebastienbaillet Do you have a reproducer you could share? Does it also happen against KC 26.0.8 (which is the latest version we have in CI)? |
It happens against KC 26.0.5. I can test against 26.0.8 and 26.1.0 if you need. |
That would be good. CI is green and tests run fine locally also against 26.1.0. |
I got the same problem with KC 24.x. No issues with provider 5.0.0. |
So, I've tested with the following KC version: 26.0.5, 26.0.8, 26.1.01. Applying (for the first time) this terraform code crash: terraform {
required_providers {
keycloak = {
source = "keycloak/keycloak"
version = "= 5.1.0"
}
}
required_version = ">= 1.6"
}
variable "keycloak_admin_password" {
type = string
}
locals {
keycloak_url = "https://my-url"
realm_name = "provider-crash-realm-test"
}
provider "keycloak" {
client_id = "admin-cli"
username = "admin"
password = var.keycloak_admin_password
url = local.keycloak_url
initial_login = false
}
resource "keycloak_realm" "platform_realm" {
realm = local.realm_name
enabled = true
} with the following stack trace:
For information, I've installed the 3 following plugins in Keycloak: I'll see if I can try without those plugins. Other informations, I'm running Terraform in a Ubuntu WSL on Windows 11. |
OK, I can reproduce it locally using your example. I'll check whats wrong... |
@sebastienbaillet @unbreakabl3 @SND33 I have found the problem, the reason is that the Keycloak version is not correctly initialized if initial_login is set to false in the provider settings. I'll come up wit the fix. Until then, would it work for you to set initial_login to true or do you need it set to false? |
Sounds great. I can test both tomorrow and update. |
So, KC 24.x:
|
Nice ! |
Describe the bug
After upgrading to version
5.1.0
, the plugin crashes with a panic caused by a nil pointer dereference. The issue appears to occur during the usage ofsetRealmData
, within theCompare
andGreaterThanOrEqual
methods when handling anil
Keycloak version object. I initially observed the crash when the plugin attempted to refresh thekeycloak_realm
resource (see stack trace below), however, I tried to temporarily disable the realm resource and started getting the same crash on other resources, so there is probably another underlying issue. Happy to provide more details if needed.Version
26.1.0
Expected behavior
No response
Actual behavior
No response
How to Reproduce?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: