While deploying version 2.37 we are getting the following error.
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657) ~[spring-beans-.3.6.jar:5.3.6] ... 57 more
Caused by: org.postgresql.util.PSQLException: ERROR: cannot drop table chart because other objects depend on it
Detail: constraint fk_interpretation_chartid on table interpretation depends on table chart constraint fk_objecttranslation_chartid on table charttranslations depends on table chart
Hint: Use DROP ... CASCADE to drop the dependent objects too.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553) ~[postgresql-42.2.19.jar:42.2.19] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2285) ~[postgresql-42.2.19.jar:42.2.19] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:323) ~[postgresql-42.2.19.jar:42.2.19] at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:481) ~[postgresql-42.2.19.jar:42.2.19]
-----------------------
Hi @Junaid_Mufti,
Please, what is the version of the DHIS2 instance that you are upgrading from? And did you follow these instructions: Upgrading - DHIS2 Documentation Thank you!
I’m also getting similar error during upgrade . We are trying to update form 2.36.4 to 2.37
Please note ours is a few years old system got all the upgrades done. 2.36.4 was working smooth. this upgrade of 2.37 failed with below error.
-----------------------------------------------------------
SQL State : 2BP01
Error Code : 0
Message : ERROR: cannot drop table reporttable because other objects depend on it
Detail: constraint fk_dashboarditem_reporttables_reporttableid on table dashboarditem_reporttables depends on table reporttable
Hint: Use DROP ... CASCADE to drop the dependent objects too.
Location : org/hisp/dhis/db/migration/2.37/V2_37_17__Remove_Chart_and_ReportTable.sql (/home/dhis2admin/tomcat-dhis/webapps/file:/home/dhis2admin/tomcat-dhis/webapps/ROOT/WEB-INF/lib/dhis-support-db-migration-2.37.0.jar!/org/hisp/dhis/db/migration/2.37/V2_37_17__Remove_Chart_and_ReportTable.sql)
Line : 36
Statement : -- Drop all ReportTable tables
DROP TABLE IF EXISTS reporttable```
Before upgrading to any version now you need to drop all SQL views. The message is clear that does tables were not dropped and therefore the upgrade will fail. Now you need to manually do it or revert to the previous version and try to drop all SQL views then you can try to upgrade again.
Hi @Gerald_Thomas I can confirm there is no SQL views in our system created by users in DHIS2.
Do you mean we have to delete all views which is even created by system before upgrades?
It looks during upgrade system is trying to drop reporttable, and is erroring out, because of foreign constraint with dashboarditem_reporttables - it looks both are not related to SQL views?
The table charttranslations is no longer used.
I think it has been dropped from 2.31, that’s before flyway, there should be a manual upgrade script back then.
I was able to update to 2.37 from 2.36.2. I got a message to drop material views. Since, my setup is still fresh, so, possible that I did not encounter any major errors except a notice to drop material views
Our instance started its journey from 2.28 and incrementally updated every time. So it had some older tables which are no longer needed
For 2.37.0 to work I needed to cascade drop several tables (not views) as errors were encountered in installation. After a few times of cascade drop table - rerun of installations. DHIS 2.37.0 got to work.