Error in generating Event Report for any data element linked with the Option set

I am having a problem generating an event report that includes any data element connected to an Option set for any Program stage. The event report keeps running (as shown in the image).

But a report can only be generated by placing the data element in Layout within the Report filter section (as shown in the image), and The options within the table show their codes, but their names do not appear.

Thank you for your post @jamal_aljadan! Please share the dhis2 version number so we can try to reproduce this? I want to reproduce this issue in any of the instances to verify if it’s a bug or not.

If it’s a bug then we will create a Jira bug issue. Thanks!

Hello, I had a similar problem in the past

Hope this will helps.

1 Like

@Gassim @didate Thanks for your help.
@Gassim We use version 2.38.2
@didate but how do I re-create the options set manually and there is stored data using this options set??

1 Like

Dear team, I am managing several tracker instances. After upgrading them to I am facing a challenge on generating report using an Event Report.
I wanted to report this on Jira, but for some reasons. I couldn’t log in. @Gassim or anyone around, I will appreciate if you can test from your side, and if it is bug please help me to post to JIRA. This is very important for any one using version and

The challenge can be replicated on Demo sites (DHIS 2 Demo - Sierra Leone and also DHIS 2 Demo - Sierra Leone)

  1. Open “Event report App” and table style “Pivot”
  2. Select Program (Malaria Focus Investigation),
  3. Program stage: “Foci response” and Data element : “Follow-up diagnosis action”
  4. Period : Last five years
  5. Update

  1. The database just keep rotating, the error message from the console is: “Uncaught TypeError: Cannot read properties of undefined (reading ‘code’)

If you repeat the same, but this time set a table style “Line listing”. the database just keep rotating but with different error (See image below). “Response.js:335 Uncaught TypeError: Cannot read properties of undefined (reading 'getCachedOptionName’)”


1 Like

It is important to note that not all data elements or attributes linked with option set don’t work. Some data elements and attributes linked with optionset works even though the configuration is the same

1 Like

Hello @sele ,
Thank you for your share on this Problem. I am facing this same problem but I am using version 2.38.2

We hope that the problem will be resolved as soon as possible.

1 Like

@sele @jamal_aljadan, thank you!

The steps to reproduce with the version numbers helped, thanks! I was able to reproduce the issue and clearing the cache using both the Data administrator app as well as the Browser Cache Cleaner app didn’t solve the issue either. Here’s the Jira ticket ([DHIS2-14454] - Jira)

Triaging this post for follow up. Thank you!


I recently upgraded my instance from 2.35 to 2.39

I have a program with a few data elements and attributes based on option sets. I can view the line list in event reports but when l change from line list to aggregate data the results does not even show… the system gets stuck. I checked the developers console and I am seeing Response.js:206 Uncaught TypeError: Cannot read properties of undefined (reading ‘code’)
at Response.js:206:42
at ()
at Response.js:205:1
at Array.forEach ()
at Response.js:202:10
at new Response (Response.js:218:6)
at Object. (InstanceManager.js:48:32)
at i (jquery.min.js:2:28017)
at Object.fireWith [as resolveWith] (jquery.min.js:2:28783)
at A (jquery.min.js:4:14017)

1 Like

Hello @tawanda ,

This issue is being followed by the developer team and has been brought to Jira.
Here’s the Jira ticket ([DHIS2-14454] - Jira )


I’m having a very similar issue with option sets but instead of in event reports, the problem is affecting the loading of a data element in the maintenance app. Details here: 2.36.12 - Some Data Elements not loading in maintenance app - #7 by chase.freeman

1 Like

Dear @Gassim , is there any progress on this issue. I think it is very critical especially for those using tracker. It is a blocker for most of analysis using even report.

The work around to select options one by one, it partially work, because it doesn’t work for all data elements.


I believe I’m seeing the same problem. Dropping any Data element linked to an Option Set resolves the problem. I’m running 2.38.0. @Gassim, I wouls concur with @sele that this is critical. Thanks!


Uncaught RangeError: Invalid array length
at Array.push ()
at arrayRepeat (arrayRepeat.js:50:1)
at PivotTableAxis.js:125:1
at ()
at new PivotTableAxis (PivotTableAxis.js:123:1)
at new PivotTable (PivotTable.js:116:1)
at createPivotTable (index.js:168:26)
at index.js:211:13
at _fn (InstanceManager.js:20:9)
at Object. (InstanceManager.js:50:13)
arrayRepeat @ arrayRepeat.js:50
(anonymous) @ PivotTableAxis.js:125
PivotTableAxis @ PivotTableAxis.js:123
PivotTable @ PivotTable.js:116
createPivotTable @ index.js:168
(anonymous) @ index.js:211
_fn @ InstanceManager.js:20
(anonymous) @ InstanceManager.js:50
i @ jquery.min.js:2
fireWith @ jquery.min.js:2
A @ jquery.min.js:4
(anonymous) @ jquery.min.js:4
load (async)
send @ jquery.min.js:4
ajax @ jquery.min.js:4
a.ajax @ jquery-migrate.min.js:2
r. @ jquery.min.js:4
getJSON @ jquery.min.js:4 @ Request.js:211 @ Layout.js:467
_d2Analysis.InstanceManager.getReport @ InstanceManager.js:47
fn @ InstanceManager.js:176
success @ InstanceManager.js:195
i @ jquery.min.js:2
fireWith @ jquery.min.js:2
A @ jquery.min.js:4
(anonymous) @ jquery.min.js:4
load (async)
send @ jquery.min.js:4
ajax @ jquery.min.js:4
a.ajax @ jquery-migrate.min.js:2
r. @ jquery.min.js:4
getJSON @ jquery.min.js:4 @ Request.js:211
InstanceManager.getById @ InstanceManager.js:210
element.load @ FavoriteWindow.js:432
element.handler @ FavoriteWindow.js:440
onclick @ index.html?id=dv9NMBQfBwk:1

We are also facing this issue in version

I encountered the same problem and I posted a note on the link: Event Reports not loading on Dhis2 2.38 and 2.39
I hope this issue will be resolved soon.

1 Like

We are experiencing this on 2.38 and I hope this issue will be resolved soon.

1 Like

Was about to test on Thanks for update

Experiencing the same in 2.39. Would be good to know how soon this would be resolved