Edited TEI is not saved in Tracker Capture version 2.30

Hi,

I am using Tracker Capture to track HIV services with DHIS 2 version 2.30. I edited some information on already saved TEI by clicking on Edit and changes the value of attribute. I saved TEI.

But I again opened that TEI and I see that the changes are not saved. Old value is showing there.

Please suggest.

Regards,
Pradeep

Hi there,
In a simple attempt at reproducing I tried opening an existing 2.30 person in play, and changing their tracked entity attribute values.

Can you reproduce in 2.30 play? Do you see any output in the browser console while saving the TEI?

Markus

1 Like

Hi,

We have customized DHIS2 for our project and there we are facing this issue.

Pradeep

1 Like

I see, it would be great if you can open the browsers javascript console and see what output you get there. Also, check the server log from the time when you are trying to save the TEI.

1 Like

image

1 Like

Did this snapshot come from when you clicked “save” in the tracked entity instance?

1 Like

Yes

That was strange, there is no relevant error messages in the console. Can you also check the server log from the same period @Pradeep ?

1 Like

@Markus, I am also facing this issue with 2.30. There are no messages in the browser console or in the log - the original names stubbornly remain in the Tracker Capture form after apparently successful editing. I have tried everything including rebooting.

We are about to upgrade - I hope this fixes it.

1 Like

There are lots of errors in the PostgreSQL log however. Could this be related to my previous attempt to enable the audit log? Postgresql: "cannot execute nextval() in a read-only transaction"

2019-11-13 19:27:11.120 UTC [5088] dhis@dhis2 ERROR:  column "groupby" of relation "trackedentityattribute" does not exist
2019-11-13 19:27:11.120 UTC [5088] dhis@dhis2 STATEMENT:  ALTER TABLE trackedentityattribute DROP COLUMN groupBy
2019-11-13 19:27:11.128 UTC [5089] dhis@dhis2 ERROR:  column "aggregationype" of relation "trackedentityattribute" does not exist at character 35
2019-11-13 19:27:11.128 UTC [5089] dhis@dhis2 STATEMENT:  update trackedentityattribute set aggregationype='AVERAGE' where aggregationtype is null
2019-11-13 19:27:11.136 UTC [5090] dhis@dhis2 ERROR:  column "searchscope" of relation "trackedentityattribute" does not exist
2019-11-13 19:27:11.136 UTC [5090] dhis@dhis2 STATEMENT:  ALTER TABLE trackedentityattribute DROP COLUMN searchscope
2019-11-13 19:27:11.144 UTC [5091] dhis@dhis2 ERROR:  table "orgunitgroupprograms" does not exist
2019-11-13 19:27:11.144 UTC [5091] dhis@dhis2 STATEMENT:  DROP TABLE orgunitgroupprograms
2019-11-13 19:27:11.152 UTC [5092] dhis@dhis2 ERROR:  column "completed" of relation "programstageinstance" does not exist
2019-11-13 19:27:11.152 UTC [5092] dhis@dhis2 STATEMENT:  ALTER TABLE programstageinstance DROP COLUMN completed
2019-11-13 19:27:11.170 UTC [5094] dhis@dhis2 ERROR:  column "searchscope" of relation "program_attributes" does not exist
2019-11-13 19:27:11.170 UTC [5094] dhis@dhis2 STATEMENT:  ALTER TABLE program_attributes DROP COLUMN searchscope
2019-11-13 19:27:11.212 UTC [5099] dhis@dhis2 ERROR:  relation "programstage_dataelements" does not exist at character 8
2019-11-13 19:27:11.212 UTC [5099] dhis@dhis2 STATEMENT:  update programstage_dataelements set allowfuturedate = allowdateinfuture where allowfuturedate is null
2019-11-13 19:27:11.219 UTC [5100] dhis@dhis2 ERROR:  relation "programstage_dataelements" does not exist at character 8
2019-11-13 19:27:11.219 UTC [5100] dhis@dhis2 STATEMENT:  update programstage_dataelements set allowfuturedate = false where allowfuturedate is null
2019-11-13 19:27:11.225 UTC [5101] dhis@dhis2 ERROR:  relation "programstage_dataelements" does not exist
2019-11-13 19:27:11.225 UTC [5101] dhis@dhis2 STATEMENT:  ALTER TABLE programstage_dataelements DROP COLUMN allowdateinfuture
2019-11-13 19:27:11.234 UTC [5102] dhis@dhis2 ERROR:  column "allowdateinfuture" does not exist at character 49
2019-11-13 19:27:11.234 UTC [5102] dhis@dhis2 STATEMENT:  update program_attributes set allowfuturedate = allowdateinfuture where allowfuturedate is null
2019-11-13 19:27:11.251 UTC [5104] dhis@dhis2 ERROR:  column "allowdateinfuture" of relation "program_attributes" does not exist
2019-11-13 19:27:11.251 UTC [5104] dhis@dhis2 STATEMENT:  ALTER TABLE program_attributes DROP COLUMN allowdateinfuture
2019-11-13 19:27:11.268 UTC [5106] dhis@dhis2 ERROR:  sequence "period_periodid_seq" does not exist
2019-11-13 19:27:11.268 UTC [5106] dhis@dhis2 STATEMENT:  DROP SEQUENCE period_periodid_seq
2019-11-13 19:27:11.276 UTC [5107] dhis@dhis2 ERROR:  constraint "programstagesection_name_key" of relation "programstagesection" does not exist
2019-11-13 19:27:11.276 UTC [5107] dhis@dhis2 STATEMENT:  ALTER TABLE programstagesection DROP CONSTRAINT programstagesection_name_key
2019-11-13 19:27:11.319 UTC [5113] dhis@dhis2 ERROR:  column "valuetype" of relation "programindicator" does not exist
2019-11-13 19:27:11.319 UTC [5113] dhis@dhis2 STATEMENT:  alter table programindicator drop column valuetype
2019-11-13 19:27:11.323 UTC [5114] dhis@dhis2 ERROR:  column "rootdate" of relation "programindicator" does not exist
2019-11-13 19:27:11.323 UTC [5114] dhis@dhis2 STATEMENT:  alter table programindicator drop column rootdate
2019-11-13 19:27:11.327 UTC [5115] dhis@dhis2 ERROR:  column "eventoutputtype" of relation "programindicator" does not exist
2019-11-13 19:27:11.327 UTC [5115] dhis@dhis2 STATEMENT:  alter table programindicator drop column eventoutputtype
2019-11-13 19:27:11.341 UTC [5118] dhis@dhis2 ERROR:  index "index_patientdatavalue" does not exist
2019-11-13 19:27:11.341 UTC [5118] dhis@dhis2 STATEMENT:  drop index index_patientdatavalue
2019-11-13 19:27:11.345 UTC [5119] dhis@dhis2 ERROR:  relation "trackedentityform" does not exist at character 69
2019-11-13 19:27:11.345 UTC [5119] dhis@dhis2 STATEMENT:  update program p set dataentryformid = (select dataentryformid from trackedentityform tf where tf.programid=p.programid limit 1)
2019-11-13 19:27:11.349 UTC [5120] dhis@dhis2 ERROR:  table "trackedentityform" does not exist
2019-11-13 19:27:11.349 UTC [5120] dhis@dhis2 STATEMENT:  drop table trackedentityform
2019-11-13 19:27:11.445 UTC [5137] dhis@dhis2 ERROR:  column "programstagesectionid" does not exist at character 104
2019-11-13 19:27:11.445 UTC [5137] dhis@dhis2 HINT:  There is a column named "programstagesectionid" in table "programstagesection_dataelements", but it cannot be referenced from this part of the query.
2019-11-13 19:27:11.445 UTC [5137] dhis@dhis2 STATEMENT:  insert into programstagesection_dataelements (programstagesectionid, sort_order, dataelementid) select programstagesectionid, section_sort_order, dataelementid from programstagedataelement where programstagesectionid is not null and section_sort_order is not null
2019-11-13 19:27:11.490 UTC [5147] dhis@dhis2 ERROR:  column "allowauditlog" of relation "program" does not exist
2019-11-13 19:27:11.490 UTC [5147] dhis@dhis2 STATEMENT:  alter table program drop column allowauditlog
2019-11-13 19:27:11.525 UTC [3637] dhis@dhis2 ERROR:  relation "reporttable_indicators" does not exist at character 40
2019-11-13 19:27:11.525 UTC [3637] dhis@dhis2 STATEMENT:  select reporttableid, indicatorid from reporttable_indicators order by reporttableid, sort_order
2019-11-13 19:27:11.526 UTC [3637] dhis@dhis2 ERROR:  current transaction is aborted, commands ignored until end of transaction block
2019-11-13 19:27:11.526 UTC [3637] dhis@dhis2 STATEMENT:
2019-11-13 19:27:11.527 UTC [3637] dhis@dhis2 ERROR:  relation "reporttable_orgunitgroups" does not exist at character 61
2019-11-13 19:27:11.527 UTC [3637] dhis@dhis2 STATEMENT:  select distinct d.reporttableid, gsm.orgunitgroupsetid from reporttable_orgunitgroups d inner join orgunitgroupsetmembers gsm on d.orgunitgroupid=gsm.orgunitgroupid
2019-11-13 19:27:11.530 UTC [3637] dhis@dhis2 ERROR:  current transaction is aborted, commands ignored until end of transaction block
2019-11-13 19:27:11.530 UTC [3637] dhis@dhis2 STATEMENT:
1 Like

Solved most of this without upgrading (though I still will do soon). After setting up our case-based surveillance data collection I had directly deleted all dummy data values and references to them in the database. Or so I thought.

This error (and a similar one) in the PostgreSQL log seem to be the relevant ones:

 2019-11-16 01:29:43.042 UTC [55215] dhis@dhis2 ERROR:  update or delete on table "trackedentityinstance" violates foreign key constraint "fk_trackedentityprogramowner_trackedentityinstanceid" on table "trackedentityprogramowner"
2019-11-16 01:29:43.042 UTC [55215] dhis@dhis2 DETAIL:  Key (trackedentityinstanceid)=(11810740) is still referenced from table "trackedentityprogramowner".

Logging in to the database (sudo -u dhis psql dhis2 dhis) I ran the following for each of the offending IDs:

delete from trackedentityprogramowner where trackedentityinstanceid=11810740;

I then cleared the cache in the database, as per https://stackoverflow.com/questions/1216660/see-and-clear-postgres-caches-buffers:

sudo su
service postgresql stop
sync
echo 3 > /proc/sys/vm/drop_caches
service postgresql start
exit

Also cleared browser cache and ran maintenance and analytics. No errors in the PostgreSQL log now. Additional attributes of my TEI now show correctly (except for the field names, which remain as the old names, but I can live with this until the upgrade).

1 Like