Upgrade Getting Failed from Version 2.34.4 to 2.35.6

Hello Team @dhis2-backend @dhis2-analytics @dhis2-platform @dhis2-projects @dhis2-test-qa

We require your help over this.

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)

Thank you

1 Like

@Karoline @Joakim Please look into this issue.

I require your suggestion/help on this.

Thank you

Thanks for your question @coolsinghbro! I see that there is a Jira issue similar to this issue, DHIS2-9813 | Upgrade from 2.34.1 to 2.35, isn’t it?

I also found this comment by @Lars on another related Jira issue and I hope you will find it helpful:

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.

Hope this helps. One final question please, were you able to follow the instructions on: Upgrading - DHIS2 Documentation

Thank you!

Hi @Gassim

I had already tried all this and it’s not working.

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! (:

can you try to drop the table colortranslations and upgrade again.

1 Like

@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.

  1. Login to URL
  2. Go to the Maintenance app
  3. Select Data Sets → find Health Facility Activities → click the 3 dots (on the right) and select Manage Sections
  4. 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`
1 Like

Just want to verify, are those the exact steps that you did ?

  1. Still in version 2.34.4, drop table colortranslations in your database.
  2. 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;
1 Like

@Ameen tagging you here related to Log in - DHIS 2 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;

@viet ,

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.

@coolsinghbro
Can you try to upgrade from 2.34.4 to 2.34.6 first.
Then from 2.34.6 to 2.35.6.

1 Like

@viet Without dropping colorset table or related table, it’s going to throw error of migration error.

@chase.freeman @Ameen @viet @Gassim Could you please help on this as it making trouble to move ahead with any step?

To fix this, you can run this query alter table chart drop constraint fk_chart_colorsetid;

1 Like

A post was split to a new topic: Can’t perform analysis tasks after upgrade