We started upgrading DHIS2 application from from version 2.34.4 to 2.35.6 but it’s failed.
Thereafter we checked logs and got bellow error.
We tried to drop color table and it’s dependent but getting same error. Please help on this.
Error Code : 0
Message : ERROR: cannot drop table color because other objects depend on it
Detail: constraint fk_objecttranslation_colorid on table colortranslations depends on table color
Hint: Use DROP ... CASCADE to drop the dependent objects too.
Location : org/hisp/dhis/db/migration/2.35/V2_35_4__Remove_color_set.sql (/opt/test/bin/file:/opt/test/webapps/ROOT/WEB-INF/lib/dhis-support-db-migration-2.35.6.jar!/org/hisp/dhis/db/migration/2.35/V2_35_4__Remove_color_set.sql)
before you upgrade (ie. while running the previous DHIS 2 version), try going to Data administration > Maintenance > Drop SQL views. Also double check in the database that the _view_test2 is not there anymore as it might be a non-DHIS 2 managed SQL view (in psql, do “\d” or “\d _view_test”).
Then upgrade and start DHIS 2. You can now do Data administration > Maintenance > Create SQL views.
What’s happening is that DHIS 2 tries to change the column type of some columns on startup, but that is not allowed by PostgreSQL if there are SQL views referring to those columns/tables.
Okay, sorry it’s not working. I will work on getting support for you. Please feel free to add any additional useful details to add your first post if you believe will be important or helpful to solve the issue. Thank you! (:
@viet I tried dropping tables but still same issue. @Gassim Thank you so much
Earlier we have issue and it still persist. When we are performing below steps not getting any data. The same issue is not reflecting in same version. I tried with other DHIS2 application with same version and it’s working as expected.
I think it might be helpful.
Login to URL
Go to the Maintenance app
Select Data Sets → find Health Facility Activities → click the 3 dots (on the right) and select Manage Sections
Go to Screening activities → click on the 3 dots and select Manage Grey Fields → select the first or second Category Combination (SAM or MAM ) → you won’t be able to see or add anything`
Just want to verify, are those the exact steps that you did ?
Still in version 2.34.4, drop table colortranslations in your database.
Upgrade the database with 2.35.6 DHIS2 war file.
If you did above steps and still get error, is it same error message or different ?
FYI this is all the queries in the upgrade script V2_35_4__Remove_color_set.sql
-- Remove colorset references
alter table visualization drop column if exists colorsetid;
-- Remove colorset tables
drop table if exists colorset_colors;
drop table if exists color;
drop table if exists colorset;
@Ameen tagging you here related to [DHIS2-9813] - Jira which you closed as “invalid” but it is looking to be a common issue. Some guidance on how to overcome the issue would be appreciated?
Is it safe to manually drop the the tables?
alter table visualization drop column if exists colorsetid;
-- Remove colorset tables
drop table if exists colorset_colors;
drop table if exists color;
drop table if exists colorset;
I tried to follow step shared by you but not bale to proceed further:-
– Remove colorset tables
drop table if exists colorset_colors;
Executed successfully
drop table if exists color;
Getting error of other object dependent on it , so I dropped dependent table first drop table if exists colortranslations;
drop table if exists colorset;
Getting dependency error as below, please suggest on this,
ERROR: cannot drop table colorset because other objects depend on it
DETAIL: constraint fk_chart_colorsetid on table chart depends on table colorset
HINT: Use DROP ... CASCADE to drop the dependent objects too.
Also can you please share the link of V2_35_4__Remove_color_set.sql ?
Manually deleting creating lots table dependency, so this script will help to drop easily.