We had upgraded from a legacy 2.29 to 2.3x to 2.37.2 and was getting analytics error reported in DHIS2-12277
Now upgrading from 2.37.2 to 2.37.3 I got the following errors ERROR: "analytics" is not partitioned ERROR: "analytics_completeness" is not partitioned
and we had to
drop table analytics cascade drop table analytics_completeness cascade
to make analytics work. Is this a good fix? those tables got regenerated after we ran analytics succesfully
org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [create table if not exists analytics_2022 partition of analytics for values in (2022)]; nested exception is org.postgresql.util.PSQLException: ERROR: "analytics" is not partitioned
[taskScheduler-16] ERROR org.hisp.dhis.scheduling.AbstractSchedulingManager - org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [create table if not exists analytics_completeness_2022 partition of analytics_completeness for values in (2022)]; nested exception is org.postgresql.util.PSQLException: ERROR: "analytics_completeness" is not partitioned```
I think your recovery actions are safe, but I’m checking with our development team to confirm, and also to see if this issue can be avoided for other users. I’ll confirm on this thread when I have more information.
Hi @jthomas,
it is valid procedure how to recover this failure. I am not really sure why this happen. Maybe you migrated to 2.37 before without starting full analytics export. Basically you can manually remove all analytics table and then start full export. Those tables are just another view on existing entities(options,data element, …).
Kind regards,
Dusan
After upgrade to 2.37 we had encountered issue DHIS2-12277 hence analytics was failing halfway everytime till we upgraded to 2.37.3, may be that’s the reason? We couldn’t revert, so we waited till this patch