# Analytics failing after upgrade to 2.27 build e33b34d

**URL:** <https://community.dhis2.org/t/analytics-failing-after-upgrade-to-2-27-build-e33b34d/4988>\
**Category:** Support - Assistance technique\
**Created:** [4 April 2018 14:44 UTC](https://community.dhis2.org/t/analytics-failing-after-upgrade-to-2-27-build-e33b34d/4988 "2018-04-04T14:44:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ant\_Snyman](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/a/b4bc9f/32.png) [@Ant\_Snyman](https://community.dhis2.org/u/Ant_Snyman)\
**Post date:** [4 April 2018 14:44 UTC](https://community.dhis2.org/t/analytics-failing-after-upgrade-to-2-27-build-e33b34d/4988/1 "2018-04-04T14:44:21Z")

</div>

Dear UserGroup,

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:

1. Period table…no duplication
2. \_periodstructure table…no duplication
3. \_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?

periodid  
iso  
daysno  
startdate  
enddate  
182669  
201803  
31  
2018/03/01  
2018/03/31  
182670  
201804  
29  
2018/04/01  
2018/04/30  
182672  
201805  
30  
2018/06/01  
2018/06/30  
182673  
201806  
31  
2018/07/01  
2018/07/31  
182674  
201807  
31  
2018/08/01  
2018/08/31  
182675  
201808  
30  
2018/09/01  
2018/09/30

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?

Regards  
_Ant Snyman_

_Cell: 0824910449_

_Landline: 028 2713242_

![](https://mail.google.com/mail/u/1/?ui=2&ik=724514e697&view=fimg&th=14edf55be996df4f&attid=0.2&disp=emb&attbid=ANGjdJ8CzBKffrjicH_BFL-_4mldZs70m0LEVp4SHaxTINfbWOD7FLDYj3cHBAcAJkW2CMpxLzv_OGzop7SUZ3Q8dc-RrdfHxOn7MZfW-R4yP1Vo-pdoCdVL9q2VJjo&sz=w154-h152&ats=1438663624662&rm=14edf55be996df4f&zw&atsh=1)

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](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 [disclaimer@hisp.org](mailto:disclaimer@hisp.org) 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](https://dhis2.b-cdn.net/uploads/default/original/2X/0/0c2b878d6e08b1fe45738474f2bd0a8ba1941c09.log) (18.7 KB)
