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

Broken error page if internationalization is enabled

    Details

    • Steps to Reproduce:
      Hide
      1. Create a user and configure their's OTP authenticator
      2. Login to Account Console as that user
      3. Go to "Authenticator"
      4. Click recycle bin next to "Mobile"
      5. And click "Sign Out" → an exception is thrown

      -OR-

      Navigate to a non-existing page, something like http://localhost:8080/auth/realms/test/account/test

      Show
      Create a user and configure their's OTP authenticator Login to Account Console as that user Go to "Authenticator" Click recycle bin next to "Mobile" And click "Sign Out" → an exception is thrown -OR- Navigate to a non-existing page, something like http://localhost:8080/auth/realms/test/account/test
    • Docs QE Status:
      NEW
    • QE Status:
      VERIFIED

      Description

      ERROR [org.keycloak.services.error.KeycloakErrorHandler] (default task-62) Failed to create error page: org.keycloak.theme.FreeMarkerException: Failed to process template error.ftl
      	at org.keycloak.theme.FreeMarkerUtil.processTemplate(FreeMarkerUtil.java:65)
      	at org.keycloak.services.error.KeycloakErrorHandler.toResponse(KeycloakErrorHandler.java:84)
      	at org.jboss.resteasy.core.ExceptionHandler.executeExceptionMapper(ExceptionHandler.java:102)
      	at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:245)
      	at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:179)
      	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:422)
      	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:213)
      	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:228)
      	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
      	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
      	at org.keycloak.services.filters.KeycloakSessionServletFilter.doFilter(KeycloakSessionServletFilter.java:90)
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
      	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
      	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
      	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
      	at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
      	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
      	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
      	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
      	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
      	at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
      	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
      	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
      	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
      	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
      	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
      	at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
      	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
      	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
      	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
      	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
      	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
      	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
      	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:326)
      	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:812)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
      ==> locale  [in template "template.ftl" at line 48, column 71]
       
      ----
      Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
      ----
       
      ----
      FTL stack trace ("~" means nesting-related):
      	- Failed at: ${locale.current}  [in template "template.ftl" in macro "registrationLayout" at line 48, column 69]
      	- Reached through: @layout.registrationLayout displayMes...  [in template "error.ftl" at line 2, column 1]
      ----
      	at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134)
      	at freemarker.core.UnexpectedTypeException.newDesciptionBuilder(UnexpectedTypeException.java:80)
      	at freemarker.core.UnexpectedTypeException.<init>(UnexpectedTypeException.java:43)
      	at freemarker.core.NonHashException.<init>(NonHashException.java:49)
      	at freemarker.core.Dot._eval(Dot.java:48)
      	at freemarker.core.Expression.eval(Expression.java:81)
      	at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:96)
      	at freemarker.core.DollarVariable.accept(DollarVariable.java:59)
      	at freemarker.core.Environment.visit(Environment.java:326)
      	at freemarker.core.Environment.visit(Environment.java:368)
      	at freemarker.core.Environment.invoke(Environment.java:714)
      	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:83)
      	at freemarker.core.Environment.visit(Environment.java:326)
      	at freemarker.core.Environment.visit(Environment.java:332)
      	at freemarker.core.Environment.process(Environment.java:305)
      	at freemarker.template.Template.process(Template.java:378)
      	at org.keycloak.theme.FreeMarkerUtil.processTemplate(FreeMarkerUtil.java:62)
      	... 53 more
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                stianst Stian Thorgersen
                Reporter:
                vmuzikar Václav Muzikář
                Tester:
                Václav Muzikář
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: