CAS 6.5.2 JPA Google OTP broken

112 views
Skip to first unread message

Gregory G

unread,
Apr 7, 2022, 1:21:05 PM4/7/22
to CAS Community
Hello,

I have this error with this :

cas.authn.mfa.gauth.jpa.driver-class=org.mariadb.jdbc.Driver
cas.authn.mfa.gauth.jpa.url=jdbc:mariadb://xxx
cas.authn.mfa.gauth.jpa.dialect=org.hibernate.dialect.MariaDB103Dialect

2022-04-07 17:19:44,129 ERROR [org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler] - <Unexpected error occurred in scheduled task>
javax.persistence.TransactionRequiredException: Executing an update/delete query
        at org.hibernate.internal.AbstractSharedSessionContract.checkTransactionNeededForUpdateOperation(AbstractSharedSessionContract.java:445) ~[hibernate-core-5.6.5.Final.jar!/:5.6.5.Final]
        at org.hibernate.query.internal.AbstractProducedQuery.executeUpdate(AbstractProducedQuery.java:1692) ~[hibernate-core-5.6.5.Final.jar!/:5.6.5.Final]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
        at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:406) ~[spring-orm-5.3.18.jar!/:5.3.18]
        at com.sun.proxy.$Proxy327.executeUpdate(Unknown Source) ~[?:?]
        at org.apereo.cas.gauth.token.GoogleAuthenticatorJpaTokenRepository.cleanInternal(GoogleAuthenticatorJpaTokenRepository.java:42) ~[cas-server-support-gauth-jpa-6.5.2.jar!/:6.5.2]
        at org.apereo.cas.otp.repository.token.BaseOneTimeTokenRepository.clean(BaseOneTimeTokenRepository.java:21) ~[cas-server-support-otp-mfa-core-6.5.2.jar!/:6.5.2]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.3.18.jar!/:5.3.18]
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) ~[spring-aop-5.3.18.jar!/:5.3.18]
        at com.sun.proxy.$Proxy248.clean(Unknown Source) ~[?:?]
        at org.apereo.cas.otp.repository.token.OneTimeTokenRepositoryCleaner.clean(OneTimeTokenRepositoryCleaner.java:29) ~[cas-server-support-otp-mfa-core-6.5.2.jar!/:6.5.2]
        at org.apereo.cas.config.support.authentication.GoogleAuthenticatorAuthenticationEventExecutionPlanConfiguration$GoogleAuthenticatorOneTimeTokenRepositoryCleaner.clean(GoogleAuthenticatorAuthenticationEventExecutionPlanConfiguration.java:336) ~[cas-server-support-gauth-6.5.2.jar!/:6.5.2]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
        at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.3.18.jar!/:5.3.18]
        at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.3.18.jar!/:5.3.18]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:?]
        at java.util.concurrent.FutureTask.runAndReset(Unknown Source) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
        at java.lang.Thread.run(Unknown Source) [?:?]

Stéphane Delcourt

unread,
May 3, 2022, 5:29:25 AM5/3/22
to CAS Community, Gregory G
Hi Gregory,

Have you find something to stop the error ?

greg....@gmail.com

unread,
May 3, 2022, 7:29:19 AM5/3/22
to Stéphane Delcourt, CAS Community
Hello

No, I just stop the schedule of cleanup in the properties and I schedule with jobscheduler and restart the nodes in rollout for avoir unavailability.
It's tricky and not the ideal fix 

Le 3 mai 2022 à 11:29, Stéphane Delcourt <the...@gmail.com> a écrit :

Hi Gregory,
Reply all
Reply to author
Forward
0 new messages