Analytics is failing to complete on my DHIS2 and below is an extract of the error message. This happened when we upgraded to 2.41.2, now I upgraded to 2.41.6 and I am still having the issue. Kindly support.
Thanks.
\* INFO 2025-10-15T05:25:50,563 Query failed, likely because the requested analytics table does not exist: (AnalyticsUtils.java \[http-nio-8080-exec-9\]) IDgwh0Lnrac82AdBdcYNamYAsVR/yI958juzMNYfPu1Uw=
org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar \[select count(ax."psi") as value,ax."monthly",ax."uidlevel3",ax."sZ3DCe8WrbD" as "mi1hbF4tinC.sZ3DCe8WrbD",ax."uMfREBn1pLQ" from analytics_event_nxjcecijiyg as ax where (ax."monthly" in ('202410', '202411', '202412', '202501', '202502', '202503', '202504', '202505', '202506', '202507', '202508') ) and ax."uidlevel3" in ('AHX13wi17KB','iLzrJ76Uvjg','o185cEpgNR8','mFRBRkNeeFL','qploy3YwpdQ','zPKX5UAm26i','daY7uOpravr','xzL7zrLmzEF','Zkk6ZYCO3dB','q6KsMm29bFu','M0YaE44oJVh','K3cb7CedppH','z7EN37oPlH2','zJLpGWyTRc7','BzN9C03haLC','CDWRhj3Cbv1','WIfM0iD2epV','klMhJYLRMGl') and ax."ps" = 'mi1hbF4tinC' and ax."sZ3DCe8WrbD" in (2,1) and ax."JddhZTlrLEv" in ('Maison Faradja Kitumaini') and ax."yearly" in ('2025', '2024') group by ax."monthly", ax."uidlevel3", ax."sZ3DCe8WrbD", ax."uMfREBn1pLQ" limit 1000001\]; nested exception is org.postgresql.util.PSQLException: ERROR: relation "analytics_event_nxjcecijiyg" does not exist
Position: 129
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:236)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1575)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:398)
Sorry to hear that you are facing an issue. Generally, there could be several reasons to why you are seeing this error.
To double check, which version did you upgrade from to 2.41? If you upgraded from an earlier version there are important tasks to do before hand, please did you make sure to follow the upgrade and release notes:
1)
Did you try to run the analytics tables export in the Data Administration app? I’d first use clear application cache and reload apps in Maintenance then run the Analytics Tables Export.
The other thing you could try is check if any of these apply to your instance: @Stephan_Mestach
I hope that helps. Please check the Catalina.out log to see if you find any additional details, and as you try the steps above, if it is still not resolved please report back with as much details as possible.
the sql shown look more like a sql issued to read the analytics tables (triggered by pivotable/dashboard/…)
If I remember well, one of the version at somepoint introduced new columns on the analytics tables (new period types) and it may explain the columns indexes don’t match anymore
I would try to regenerate the analytics table and watch the log as they run see if they complete or why don’t complete.
We upgraded from 2.39.x to 2.40, then to 2.41.2. I also cleared application cache, reload apps and run the Analytics table export, yet I get same issue. I also doubled RAM from 32GB to 64GB, doubled disk space from 1TB to 2TB, yet the issue persists. I upgraded two other DHIS2 instances to 2.41.5 from 2.39, one of them worked well with Analytics, while Analytics still failed on the other instance. One thing I observed is that the two instances that failed analytics are far larger than the one that works. I am still troubleshooting though.
Just in case, did you try to clear the analytics [that will remove the analytics tables in the database] (using the Data Administration app) and the run the full analytics ?