Resource tables error

Hi all;

i amusing version 2.33 and I am facing the below error when run resource tables from mAINTAINANCE APP

Process failed: PreparedStatementCallback; SQL [insert into _dateperiodstructure_temp values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)];
ERROR: duplicate key value violates unique constraint “_dateperiodstructure_temp_pkey” Detail: Key (dateperiod)=(2017-10-31) already exists.;
nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint “_dateperiodstructure_temp_pkey”
Detail: Key (dateperiod)=(2017-10-31) already exists.

Hello @Abdin,

Firstly, which patch of 2.33 are you using?

I searched a bit in the CoP here and see others have reported this similar kind of error log. In one of the topics, @Alex_Tumwesigye suggested the following:

This date is ‘1975-01-01’ duplicated in your period table.
Look out for the same date from the period table with wrong (or mutliple) periodTypeId e.g 1975-01-01 as startdate and 1975-01-01 as enddate with periodTypeId of 3 (yet 3 is monthly).

So could you review your period table and see if you see anything like this, specifically with the date 2017-10-31?

Also tagging @dhis2-backend to provide any additional input.

Best regards,

Hi @Abdin,

thanks for reporting. The error indicates an issue which was fixed several years ago. Could you double check that you are really running 2.33? Which patch release is it?

Would you let us know which calendar you are running on your system? You check this from Apps > System settings > Calendar.



If no calendar setting issues, or period database-level issues can be identified, check the timezone setting of the server. The exact same issue of resource tables not being able to populate helped when setting the timezone back to UTC.