Potential Issue with DHIS2 Capture 3.0

While using the application, I noticed in dhis capture version 3.0 when the organization unit name contains the apostrophe character “'” the application crashes.

To better diagnose the problem, it would be helpful if others could share their experiences:

Has anyone encountered similar problems with DHIS2 Capture 3.0?
By working together, we hope to be able to identify the root cause of the problem and find a solution.

android.database.sqlite.SQLiteException: near “dop”: syntax error (code 1 SQLITE_ERROR[1]): , while compiling: SELECT * FROM OrganisationUnit WHERE uid = 'csi N’dop ’ LIMIT 1;
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:1540)
at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:975)
at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:590)
at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:63)
at android.database.sqlite.SQLiteQuery.(SQLiteQuery.java:37)
at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:46)
at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:2278)
at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:2217)
at org.hisp.dhis.android.core.arch.db.access.internal.UnencryptedDatabaseAdapter.rawQuery(UnencryptedDatabaseAdapter.java:82)
at org.hisp.dhis.android.core.arch.db.access.internal.ParentDatabaseAdapter.rawQuery(ParentDatabaseAdapter.java:85)
at org.hisp.dhis.android.core.arch.db.stores.internal.ReadableStoreImpl.selectOneWhere(ReadableStoreImpl.kt:78)
at org.hisp.dhis.android.core.arch.db.stores.internal.ReadableStoreImpl.selectOneWhere(ReadableStoreImpl.kt:38)
at org.hisp.dhis.android.core.arch.repositories.object.internal.ReadOnlyOneObjectRepositoryImpl.blockingGetWithoutChildren(ReadOnlyOneObjectRepositoryImpl.kt:48)
at org.hisp.dhis.android.core.arch.repositories.object.internal.ReadOnlyObjectRepositoryImpl.blockingGet(ReadOnlyObjectRepositoryImpl.kt:63)
at org.dhis2.form.data.metadata.OrgUnitConfiguration.orgUnitByUid(OrgUnitConfiguration.kt:9)
at org.dhis2.form.ui.provider.DisplayNameProviderImpl.getValueTypeValue(DisplayNameProviderImpl.kt:45)
at org.dhis2.form.ui.provider.DisplayNameProviderImpl.provideDisplayName(DisplayNameProviderImpl.kt:28)
at org.dhis2.form.ui.FieldViewModelFactoryImpl.create(FieldViewModelFactoryImpl.kt:95)
at org.dhis2.form.ui.FieldViewModelFactory$DefaultImpls.create$default(FieldViewModelFactory.kt:16)
at org.dhis2.form.data.EventRepository.createEventOrgUnitField(EventRepository.kt:365)
at org.dhis2.form.data.EventRepository.getEventDetails(EventRepository.kt:190)
at org.dhis2.form.data.EventRepository.access$getEventDetails(EventRepository.kt:45)
at org.dhis2.form.data.EventRepository$list$2.invoke(EventRepository.kt:157)
at org.dhis2.form.data.EventRepository$list$2.invoke(EventRepository.kt:156)
at org.dhis2.form.data.EventRepository.list$lambda$2(EventRepository.kt:156)
at org.dhis2.form.data.EventRepository.$r8$lambda$xYtDIZeqvwviQvzO_VpoHYqt7gs(Unknown Source:0)
at org.dhis2.form.data.EventRepository$$ExternalSyntheticLambda4.apply(Unknown Source:2)
at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onSuccess(SingleMap.java:57)
at io.reactivex.internal.operators.single.SingleFlatMap$SingleFlatMapCallback$FlatMapSingleObserver.onSuccess(SingleFlatMap.java:111)
at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:56)
at io.reactivex.Single.subscribe(Single.java:3666)
at io.reactivex.internal.operators.single.SingleFlatMap$SingleFlatMapCallback.onSuccess(SingleFlatMap.java:84)
at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:56)
at io.reactivex.Single.subscribe(Single.java:3666)
at io.reactivex.internal.operators.single.SingleFlatMap.subscribeActual(SingleFlatMap.java:36)
at io.reactivex.Single.subscribe(Single.java:3666)
at io.reactivex.internal.operators.single.SingleMap.subscribeActual(SingleMap.java:34)
at io.reactivex.Single.subscribe(Single.java:3666)
at io.reactivex.internal.operators.single.SingleToFlowable.subscribeActual(SingleToFlowable.java:37)
at io.reactivex.Flowable.subscribe(Flowable.java:14935)
at io.reactivex.Flowable.blockingFirst(Flowable.java:5698)
at org.dhis2.form.data.FormRepositoryImpl.fetchFormItems(FormRepositoryImpl.kt:48)
at org.dhis2.form.ui.FormViewModel$loadData$1$result$1.invokeSuspend(FormViewModel.kt:725)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@d892d6e, Dispatchers.IO]

Hi @zforce,

thanks for reporting this issue and sorry for the inconvenience it might have caused you. We had already identified and fixed the problem (this jira ticket) and it will be included in the next patch version of the Android app.

2 Likes

A post was split to a new topic: Tracker Capture web app will crash if the option value code has apostrophe

Hi @vgarciabnz
Thanks for quick reply.
We look forward to the next release without this bug.
Best regards.

1 Like