UID error in custom data entry form crashes data validation

Bug #1569817 reported by Calle Hedberg on 2016-04-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DHIS
Medium
Lars Helge Øverland

Bug Description

If there are one or more UIDs referenced in a custom data entry form, those errors will be intercepted and displayed to the user when trying to open that form.

The same errors caused a total crash when running Data Validation, though, yielding only the following non-helpful tomcat log thread below.

The Data Validation process should either provide the user with an actionable error message as is done when opening the data entry form, or else it should at least continue Validation Processing.

The bug has been verified in the DHIS2 Demo:
1. Data Validation runs fine.
2. Open the custom data entry form for e.g. the Child Health Data Set, switch to source code and change some of the Data Element UIDs (the changed UID obviously do not exist in the dataelement table).
3. Data Validation no longer runs.

TOMCAT LOG:
* ERROR 2016-04-07 11:16:26,155 Unexpected error occurred in scheduled task. (TaskUtils.java [taskScheduler-1])
java.lang.NullPointerException
        at org.hisp.dhis.dataintegrity.DefaultDataIntegrityService.getCategoryOptionCombosNotInDataElementCategoryCombo(DefaultDataIntegrityService.java:326)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
        at com.sun.proxy.$Proxy105.getCategoryOptionCombosNotInDataElementCategoryCombo(Unknown Source)
        at org.hisp.dhis.dataintegrity.tasks.DataIntegrityTask.run(DataIntegrityTask.java:96)
        at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

After this the log hangs - there is no "caused by" etc that usually provides a better guide to the source of the problem.

Hi Calle,

I assume you refer to "Data Integrity" and not "Data Validation" ?

Could you please indicate which DHIS 2 version it is?

The stack trace indicates this is an older version. If that is correct, could you potentially upgrade?

Changed in dhis2:
milestone: none → 2.23
assignee: nobody → Lars Helge Øverland (larshelge)
importance: Undecided → Medium
Calle Hedberg (calle-hedberg) wrote :

Firstly, I initially encountered it in the 2.20za instance (that is the latest 2.20 war file with some South African code additions, although no addition relates to Data Integrity (sorry - yes it is called Data Integrity and not Data Validation).

Secondly, I then tested the same issue on the 2.22 demo instance 2 days ago - so the bug is definitely there in all the latest versions of 2.20, 2.21, and 2.22.

Regards
Calle

Changed in dhis2:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers