We upgraded to 2.33 from 2.30 some time back and have noticed an issue with data import. In troubleshooting, I reverted to 2.30 on a test instance to see when the issue arises. It appears to be introduced from 2.31.
When I export a small data set then import using 2.30, I have no issue, but when I upgrade to 2.31 and attempt to export / import the same data (or indeed any data), I consistently get the “java.lang.String cannot be cast to java.lang.Boolean” error and the data fails to import (dry run or not).
This is the log on 2.31:
* INFO 2021-01-19 13:22:18,356 Starting data value import, options: ImportOptions{idSchemes=IdSchemes{idScheme=IdScheme{identifiableProperty=UID, attribute=null}, dataElementIdScheme=IdScheme{identifiableProperty=UID, attribute=null}, categoryOptionComboIdScheme=null, categoryOptionIdScheme=null, orgUnitIdScheme=IdScheme{identifiableProperty=UID, attribute=null}, programIdScheme=null, programStageIdScheme=null, trackedEntityIdScheme=null, trackedEntityAttributeIdScheme=null, dataSetIdScheme=null, attributeOptionComboIdScheme=null, programStageInstanceIdScheme=null}, dryRun=true, preheatCache=false, async=true, importStrategy=NEW_AND_UPDATES, mergeMode=REPLACE, skipExistingCheck=false, ignoreEmptyCollection=false, sharing=false, skipNotifications=false, datasetAllowsPeriods=false, strictPeriods=false, strictDataElements=false, strictCategoryOptionCombos=false, strictAttributeOptionCombos=false, strictOrganisationUnits=false, requireCategoryOptionCombo=false, requireAttributeOptionCombo=false, force=false, skipLastUpdated=false}: 00:00:00.000 (Clock.java [taskScheduler-5])
* INFO 2021-01-19 13:22:18,357 [Level: INFO, category: DATAVALUE_IMPORT, time: Tue Jan 19 13:22:18 CAT 2021, message: Process started] (InMemoryNotifier.java [taskScheduler-5])
* INFO 2021-01-19 13:22:18,359 Is ISO calendar: true, skip lock exception check: true (DefaultDataValueSetService.java [taskScheduler-5])
* INFO 2021-01-19 13:22:18,360 Skip audit: false, has authority to skip: true (DefaultDataValueSetService.java [taskScheduler-5])
* INFO 2021-01-19 13:22:18,361 Import options: ImportOptions{idSchemes=IdSchemes{idScheme=IdScheme{identifiableProperty=UID, attribute=null}, dataElementIdScheme=IdScheme{identifiableProperty=UID, attribute=null}, categoryOptionComboIdScheme=null, categoryOptionIdScheme=null, orgUnitIdScheme=IdScheme{identifiableProperty=UID, attribute=null}, programIdScheme=null, programStageIdScheme=null, trackedEntityIdScheme=null, trackedEntityAttributeIdScheme=null, dataSetIdScheme=null, attributeOptionComboIdScheme=null, programStageInstanceIdScheme=null}, dryRun=true, preheatCache=false, async=true, importStrategy=NEW_AND_UPDATES, mergeMode=REPLACE, skipExistingCheck=false, ignoreEmptyCollection=false, sharing=false, skipNotifications=false, datasetAllowsPeriods=false, strictPeriods=false, strictDataElements=false, strictCategoryOptionCombos=false, strictAttributeOptionCombos=false, strictOrganisationUnits=false, requireCategoryOptionCombo=false, requireAttributeOptionCombo=false, force=false, skipLastUpdated=false} (DefaultDataValueSetService.java [taskScheduler-5])
* INFO 2021-01-19 13:22:18,361 Data value set identifier scheme: IdScheme{identifiableProperty=null, attribute=null}, data element: IdScheme{identifiableProperty=null, attribute=null}, org unit: IdScheme{identifiableProperty=null, attribute=null}, category option combo: IdScheme{identifiableProperty=null, attribute=null}, data set: IdScheme{identifiableProperty=null, attribute=null} (DefaultDataValueSetService.java [taskScheduler-5])
* INFO 2021-01-19 13:22:18,362 Identifier scheme: IdScheme{identifiableProperty=UID, attribute=null}, data element: IdScheme{identifiableProperty=UID, attribute=null}, org unit: IdScheme{identifiableProperty=UID, attribute=null}, category option combo: IdScheme{identifiableProperty=UID, attribute=null}, data set: IdScheme{identifiableProperty=UID, attribute=null} (DefaultDataValueSetService.java [taskScheduler-5])
* ERROR 2021-01-19 13:22:18,362 java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
at org.hisp.dhis.dxf2.datavalueset.DefaultDataValueSetService.saveDataValueSet(DefaultDataValueSetService.java:720)
at org.hisp.dhis.dxf2.datavalueset.DefaultDataValueSetService.saveDataValueSetJson(DefaultDataValueSetService.java:594)
at org.hisp.dhis.dxf2.datavalueset.tasks.ImportDataValueTask.call(ImportDataValueTask.java:86)
at org.hisp.dhis.security.SecurityContextRunnable.run(SecurityContextRunnable.java:57)
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)
(DefaultDataValueSetService.java [taskScheduler-5])
* INFO 2021-01-19 13:22:18,363 [Level: ERROR, category: DATAVALUE_IMPORT, time: Tue Jan 19 13:22:18 CAT 2021, message: Process failed: java.lang.String cannot be cast to java.lang.Boolean] (InMemoryNotifier.java [taskScheduler-5])
The only difference in the log with 2.30 (apart from no error) is there are two new import options flags: strictDataElements=false, ignoreEmptyCollection=false. Where should I be looking for the source of the error? Is this a database structural issue or a data issue?