Skip to content
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

NPE in getDefaultRequiredActionCaseInsensitively #21123

Closed
2 tasks done
trixpan opened this issue Jun 21, 2023 · 1 comment · Fixed by #21178
Closed
2 tasks done

NPE in getDefaultRequiredActionCaseInsensitively #21123

trixpan opened this issue Jun 21, 2023 · 1 comment · Fixed by #21178
Assignees
Labels
area/admin/api kind/bug Categorizes a PR related to a bug
Milestone

Comments

@trixpan
Copy link
Contributor

trixpan commented Jun 21, 2023

Before reporting an issue

  • I have searched existing issues
  • I have reproduced the issue with the latest release

Area

admin/api

Describe the bug

2023-06-21 10:54:18,010 ERROR [org.keycloak.services.error.KeycloakErrorHandler] (executor-thread-1) Uncaught server error: java.lang.NullPointerException
     at org.keycloak.models.utils.DefaultRequiredActions.getDefaultRequiredActionCaseInsensitively(DefaultRequiredActions.java:307)
at org.keycloak.storage.datastore.LegacyExportImportManager.toModel(LegacyExportImportManager.java:1429)
     at org.keycloak.storage.datastore.LegacyExportImportManager.importRealm(LegacyExportImportManager.java:307)
     at org.keycloak.models.utils.RepresentationToModel.importRealm(RepresentationToModel.java:126)
     at org.keycloak.services.managers.RealmManager.importRealm(RealmManager.java:571)
     at org.keycloak.services.managers.RealmManager.importRealm(RealmManager.java:504)
     at org.keycloak.services.managers.RealmManagerProviderFactory.lambda$postInit$0(RealmManagerProviderFactory.java:54)
     at org.keycloak.services.DefaultKeycloakSessionFactory.publish(DefaultKeycloakSessionFactory.java:91)
     at org.keycloak.storage.ImportRealmFromRepresentationEvent.fire(ImportRealmFromRepresentationEvent.java:50)
     at org.keycloak.storage.datastore.LegacyExportImportManager.importRealm(LegacyExportImportManager.java:159)
     at org.keycloak.services.resources.admin.RealmsAdminResource.importRealm(RealmsAdminResource.java:133)
     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
     at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:170)
     at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:130)
     at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:660)
     at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:524)
     at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:474)
     at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
     at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:476)
     at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:434)
     at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:192)
     at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:141)
     at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:32)
     at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:492)

Version

21.1.1

Expected behavior

Partial import to succeed

Actual behavior

Partial import fails due to NPE

How to Reproduce?

import a realm where required actions are defined in skeleton form, e.g.

				Alias:   "Configure OTP",
				Enabled: false
			}

Haven't fully investigated but my guess is the code treats providerId as required, however the REST API documentation refers to it as optional.

image

Anything else?

No response

@trixpan trixpan added kind/bug Categorizes a PR related to a bug status/triage labels Jun 21, 2023
douglaspalmer added a commit to douglaspalmer/keycloak that referenced this issue Jun 22, 2023
@douglaspalmer douglaspalmer added this to the 22.0.0 milestone Jun 22, 2023
@douglaspalmer douglaspalmer self-assigned this Jun 22, 2023
@mposolda mposolda modified the milestones: 22.0.0, 23.0.0 Jun 27, 2023
@mposolda
Copy link
Contributor

Postponing as this is not strictly a blocker for Keycloak 22 (however if we manage to fix it in time, we can add it back to 22).

abstractj pushed a commit to douglaspalmer/keycloak that referenced this issue Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/admin/api kind/bug Categorizes a PR related to a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants