Error when running analytics

Greetings,
I am using DHIS2.29.
Since last week, the following message is shown when running analytics:
Process failed: StatementCallback; uncategorized SQLException for SQL [drop table if exists analytics_event_gvc2pjecncm;alter table analytics_event_temp_gvc2pjecncm rename to analytics_event_gvc2pjecncm;]; SQL state [2BP01]; error code [0]; ERROR: cannot drop table analytics_event_gvc2pjecncm because other objects depend on it Detail: table analytics_event_2019_gvc2pjecncm depends on table analytics_event_gvc2pjecncm Hint: Use DROP … CASCADE to drop the dependent objects too.; nested exception is org.postgresql.util.PSQLException: ERROR: cannot drop table analytics_event_gvc2pjecncm because other objects depend on it Detail: table analytics_event_2019_gvc2pjecncm depends on table analytics_event_gvc2pjecncm Hint: Use DROP … CASCADE to drop the dependent objects too

I will be thankful if you can provide assistance.
Sincerely
NG

1 Like

Hi @Esumohleb,

this seems to be an issue related to table partitioning which we use for analytics in DHIS2. This seems to be a bug, so I have created a bug issue for it on Jira: https://jira.dhis2.org/browse/DHIS2-7236

In the meantime, I will give you some potential workarounds:

  • Upgrade DHIS2 to a newer version
    This does not seem to be an issue in newer versions of DHIS2, so upgrading should solve your issue.

  • Drop tables causing issues
    Tables with names starting with “analytics_” are generated by running analytics and are safe to drop since they can be recreated. That means you can drop the problematic tables manually using this sql:

  1. (1 table at the time) DROP TABLE <table_name>;
  2. (1 table and all depending tables) DROP TABLE <table_name> CASCADE;

Hope this solves your issue.

1 Like