Difficult to troubleshoot errors with custom form upgrade process

Hi,

I have seen lots of these error messages when starting up DHIS 2 databases:

  • ERROR 2014-06-03 11:28:12,560 java.lang.NullPointerException (ExpressionUpgrader.java [Thread-2])

  • ERROR 2014-06-03 11:28:12,562 Upgrading custom data entry form failed: Inpatient Department (ExpressionUpgrader.java [

Thread-2])

This is caused by the upgrade script as part of the startup routines for updating custom forms from using internal IDs to use UIDs.

I assume the nullpointer either refers to either a dataelementid or a categoryoptioncomboid that does no longer exist in the database, so the upgrade process fails with a nullpointer.

The problem is that it since the id of the missing object is not in the log it becomes hard to actually modify the custom form html to remove it, and then to re-do the upgrade (restart DHIS).

The form is represented in the database as a big string with html code and IDs all over the place, so it is no straightforward simple way to list which DHIS IDs that are used in the form.

Unless anyone has a better idea for debugging this I suggest that we add a little more information to the log, e.g.

“Upgrading custom data entry form failed: Inpatient Department. dataelementid XXX does not exist”

Another improvement could be to actually ignore the missing objects and continue with replacing IDs with UIDs for the rest of the form, since the upgraded form will not be worse off than the old one.

And if possible still add information to the log as a warning that the following IDs in the form are missing: dataelementid XXX etc."

Comments?

Ola

···

Ola Hodne Titlestad (Mr)
HISP
Department of Informatics
University of Oslo

Mobile: +47 48069736
Home address: Eftasåsen 68, 0687 Oslo, Norway. Googlemaps link

I just realised that this is somewhat implemented for the upgrade of aggregate (dataset) forms, there I get log messages in startup routine like:

  • ERROR 2014-06-04 01:20:58,346 Upgrading custom data entry form failed: BCC report (ExpressionUpgrader.java [Thread-2])

  • ERROR 2014-06-04 01:20:58,346 java.lang.NumberFormatException: For input string: “YB17LGcpxMY” (ExpressionUpgrader.jav

a [Thread-2])

But for the tracker (program stage) this seems to be missing.

Ola

···

Ola Hodne Titlestad (Mr)
HISP
Department of Informatics
University of Oslo

Mobile: +47 48069736
Home address: Eftasåsen 68, 0687 Oslo, Norway. Googlemaps link

On 3 June 2014 14:31, Ola Hodne Titlestad olati@ifi.uio.no wrote:

Hi,

I have seen lots of these error messages when starting up DHIS 2 databases:

  • ERROR 2014-06-03 11:28:12,560 java.lang.NullPointerException (ExpressionUpgrader.java [Thread-2])
  • ERROR 2014-06-03 11:28:12,562 Upgrading custom data entry form failed: Inpatient Department (ExpressionUpgrader.java [

Thread-2])

This is caused by the upgrade script as part of the startup routines for updating custom forms from using internal IDs to use UIDs.

I assume the nullpointer either refers to either a dataelementid or a categoryoptioncomboid that does no longer exist in the database, so the upgrade process fails with a nullpointer.

The problem is that it since the id of the missing object is not in the log it becomes hard to actually modify the custom form html to remove it, and then to re-do the upgrade (restart DHIS).

The form is represented in the database as a big string with html code and IDs all over the place, so it is no straightforward simple way to list which DHIS IDs that are used in the form.

Unless anyone has a better idea for debugging this I suggest that we add a little more information to the log, e.g.

“Upgrading custom data entry form failed: Inpatient Department. dataelementid XXX does not exist”

Another improvement could be to actually ignore the missing objects and continue with replacing IDs with UIDs for the rest of the form, since the upgraded form will not be worse off than the old one.

And if possible still add information to the log as a warning that the following IDs in the form are missing: dataelementid XXX etc."

Comments?

Ola



Ola Hodne Titlestad (Mr)
HISP
Department of Informatics
University of Oslo

Mobile: +47 48069736
Home address: Eftasåsen 68, 0687 Oslo, Norway. Googlemaps link

Dear @olatitle ,
What is the solution for this startup error ?