I’m hitting a similar issue QuarterlyNov is coming from the periodType
and it has appeared with this commit : feat: QuarterlyNovember period type (#13256) · dhis2/dhis2-core@d0670a2 · GitHub
select * from periodtype;
┌──────────────┬─────────────────┐
│ periodtypeid │ name │
├──────────────┼─────────────────┤
│ 3 │ Daily │
│ 4 │ Weekly │
│ 5 │ WeeklyWednesday │
│ 6 │ WeeklyThursday │
│ 7 │ WeeklySaturday │
│ 8 │ WeeklySunday │
│ 9 │ BiWeekly │
│ 10 │ Monthly │
│ 11 │ BiMonthly │
│ 12 │ Quarterly │
│ 13 │ SixMonthly │
│ 14 │ SixMonthlyApril │
│ 15 │ SixMonthlyNov │
│ 16 │ Yearly │
│ 17 │ FinancialApril │
│ 18 │ FinancialJuly │
│ 19 │ FinancialOct │
│ 20 │ FinancialNov │
│ 83907 │ QuarterlyNov │
│ SELECT 19 │ │
└──────────────┴─────────────────┘
(20 rows)
Time: 0.029s
but loading it via the ORM seem to fails
SEVERE: Exception sending context initialized event to listener instance of class [org.hisp.dhis.system.startup.StartupListener]
java.lang.RuntimeException: Failed to run startup routines: org.hibernate.WrongClassException: Object [id=83907] was not of the specified subclass [org.hisp.dhis.period.PeriodType] : Discriminator: QuarterlyNov
at org.hisp.dhis.system.startup.StartupListener.contextInitialized(StartupListener.java:76)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4697)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5165)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1412)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1402)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: javax.persistence.PersistenceException: org.hibernate.WrongClassException: Object [id=83907] was not of the specified subclass [org.hisp.dhis.period.PeriodType] : Discriminator: QuarterlyNov
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1626)
at org.hibernate.query.Query.getResultList(Query.java:165)
at org.hibernate.query.criteria.internal.compile.CriteriaQueryTypeQueryAdapter.getResultList(CriteriaQueryTypeQueryAdapter.java:76)
at org.hisp.dhis.period.hibernate.HibernatePeriodStore.getAllPeriodTypes(HibernatePeriodStore.java:259)
at org.hisp.dhis.period.PeriodTypePopulator.executeInTransaction(PeriodTypePopulator.java:76)
at org.hisp.dhis.system.startup.TransactionContextStartupRoutine$1.doInTransaction(TransactionContextStartupRoutine.java:57)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at org.hisp.dhis.system.startup.TransactionContextStartupRoutine.execute(TransactionContextStartupRoutine.java:52)
at org.hisp.dhis.system.startup.DefaultStartupRoutineExecutor.execute(DefaultStartupRoutineExecutor.java:113)
at org.hisp.dhis.system.startup.DefaultStartupRoutineExecutor.execute(DefaultStartupRoutineExecutor.java:70)
at org.hisp.dhis.system.startup.StartupListener.contextInitialized(StartupListener.java:70)
... 9 more
Caused by: org.hibernate.WrongClassException: Object [id=83907] was not of the specified subclass [org.hisp.dhis.period.PeriodType] : Discriminator: QuarterlyNov
at org.hibernate.loader.Loader.getInstanceClass(Loader.java:1963)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1732)
at org.hibernate.loader.Loader.getRow(Loader.java:1624)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:748)
at org.hibernate.loader.Loader.getRowsFromResultSet(Loader.java:1047)
at org.hibernate.loader.Loader.processResultSet(Loader.java:998)
at org.hibernate.loader.Loader.doQuery(Loader.java:967)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:357)
at org.hibernate.loader.Loader.doList(Loader.java:2868)
at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2712)
at org.hibernate.loader.Loader.list(Loader.java:2674)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:540)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400)
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1459)
at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649)
at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617)
Is it possible that the period type was added then removed ?