byuweb / byu-browser-oauth-implicit

OAuth Implicit Grant provider for byu-browser-oauth
Apache License 2.0
2 stars 0 forks source link

HTTP Status 500 – Internal Server Error. How can I deal with this error? #12

Closed sot232 closed 5 years ago

sot232 commented 5 years ago

For some reasons, I started to receive this error message about 20 or 30 minutes ago.

Right now, if I access BYU CAS on an incognito mode, I have no problem with CAS. But I can't access CAS without an incognito mode. I tried to clear browser cache, wait for a bit and try logging in again, and tried to log in on a sub url. However, nothing has been worked.

My guess is that I have to wait for an hour or so to resolve this issue. But after my web app launches, users shouldn't experience the same issue and wait for a long time to resolve it. How can I deal with the Internal Server Error in the future?

Type: Exception Report

Message: Ticket [09f7fc4f1a33090c96e9fa4a8dc31e4d301bfa86f2e2494b1cfedf6eebc40b5b137919382b4bc788aa406b8163d32e734cf81f30a3a93d3f9979e72708629db7 is of type class org.apereo.cas.ticket.registry.EncodedTicket when we were expecting interface org.apereo.cas.ticket.TicketGrantingTicket

Description: The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception:

java.lang.ClassCastException: Ticket [09f7fc4f1a33090c96e9fa4a8dc31e4d301bfa86f2e2494b1cfedf6eebc40b5b137919382b4bc788aa406b8163d32e734cf81f30a3a93d3f9979e72708629db7 is of type class org.apereo.cas.ticket.registry.EncodedTicket when we were expecting interface org.apereo.cas.ticket.TicketGrantingTicket
    org.apereo.cas.ticket.registry.AbstractTicketRegistry.getTicket(AbstractTicketRegistry.java:60)
    org.apereo.cas.ticket.registry.DefaultTicketRegistrySupport.getAuthenticationFrom(DefaultTicketRegistrySupport.java:28)
    org.apereo.cas.ticket.registry.DefaultTicketRegistrySupport.getAuthenticatedPrincipalFrom(DefaultTicketRegistrySupport.java:34)
    org.apereo.cas.ticket.registry.DefaultTicketRegistrySupport$$FastClassBySpringCGLIB$$885171cb.invoke(<generated>)
    org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
    org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:283)
    org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671)
    org.apereo.cas.ticket.registry.DefaultTicketRegistrySupport$$EnhancerBySpringCGLIB$$d4786c8c.getAuthenticatedPrincipalFrom(<generated>)
    org.apereo.cas.logging.web.ThreadContextMDCServletFilter.doFilter(ThreadContextMDCServletFilter.java:86)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101)
    org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:123)
    org.apereo.inspektr.common.web.ClientInfoThreadLocalFilter.doFilter(ClientInfoThreadLocalFilter.java:66)
    org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:64)
    org.springframework.boot.web.support.ErrorPageFilter.forwardToErrorPage(ErrorPageFilter.java:197)
    org.springframework.boot.web.support.ErrorPageFilter.handleException(ErrorPageFilter.java:180)
    org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:145)
    org.springframework.boot.web.support.ErrorPageFilter.access$000(ErrorPageFilter.java:66)
    org.springframework.boot.web.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:105)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:123)
    org.apereo.inspektr.common.web.ClientInfoThreadLocalFilter.doFilter(ClientInfoThreadLocalFilter.java:66)
    org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
Note: The full stack trace of the root cause is available in the server logs.
snelg commented 5 years ago

Yeah, CAS had some issues today. In such a situation, there's absolutely nothing that can be done in a browser plugin like this. Or a server-based plugin for that matter. If the "Central Authentication System" is broken, then by definition Authentication isn't working.

sot232 commented 5 years ago

I am sorry if my question wasn't clear.

I know I can't do a whole lot when CAS is broken. But I was able to access CAS on incognito mode even though I couldn't access the same thing on a normal browser. To me, it seems like somewhere on your side stores my broken call and blocks accessing CAS even if CAS is properly working.

Is there anything I can do for this particular situation?

snelg commented 5 years ago

I can see how it would seem like that. Yes, saved session/cookies were involved in the whole mess today, but they were browser cookies on the CAS site itself. So still nothing this code library could handle in any way.