A DHIS2 database base was upgraded from an earlier 2.27 build to 2.27 build e33b34d . After the upgrade this error was reported when trying to generate resource tables:
Process failed: PreparedStatementCallback; SQL [insert into _dateperiodstructure_temp values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)]; ERROR: duplicate key value violates unique constraint “_dateperiodstructure_temp_pkey1” Detail: Key (dateperiod)=(1994-03-20) already exists.; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint “_dateperiodstructure_temp_pkey1” Detail: Key (dateperiod)=(1994-03-20) already exists.
I have checked the following:
- Period table…no duplication
- _periodstructure table…no duplication
- _dateperiodstructure table…no duplication.
I did find that the _periodstructure table has a few incorrect entries (everything else in this table looks fine). Where would this come from?
If I insert into the _dateperiodstructure_temp from _dateperiodstructure
(via script) then it successfuly inserts all the records without any duplicate key issues. But if I run “generate resource tables” then it only partially creates _dateperiodstructure_temp and stops at acertain point and displys the error.
I had a look at the logs … please find attached…but the logs did not provide any more clarity.
Has anyone experienced this before and found a solution?
Landline: 028 2713242
Health Information Systems Program - SA
This message and any attachments are subject to a disclaimer published at http://www.hisp.org/policies.html#comms_disclaimer. Please read the disclaimer before opening any attachment or taking any other action in terms of this electronic transmission. If you cannot access the disclaimer, kindly send an email to email@example.com and a copy will be provided to you. By replying to this e-mail or opening any attachment you agree to be bound by the provisions of the disclaimer.
Logs.log (18.7 KB)