Bug in the api when querying a data element shared between two event programs

Hi all,

I would like resurrect an issue that I found in the api a few months back in 2.36.5 which appears to still be a problem in 2.36.10 and 2.37.5.

Original thread: Potential bug with api

Jira thread: Log in - DHIS 2 JIRA

Originally I managed to work around the issue with the application I was building but that isn’t possible anymore as the application has developed.

Quick description of the issue (full details in the Jira issue and the original post), but if you have a tracker data element that is used in multiple event programs, and then query them in two sequential api calls, the second call actually returns the data for event program in the first call. At the bottom of this post is an example of the returned json from the second call, and you can see in the dimensions.dx array the data element “wajLqlQiMMI.WLcl7YoLkZT”, but in the rows you can see the data element “FtyYnQzZ1d4.WLcl7YoLkZT” which was from the previous api call. If you wait about 60 seconds and rerun the query you get the correct value returned.

I have confirmed that this issue can be reproduced within the DHIS2 data visualizer tool too.

I’ve also just reproduced the error on a brand new instance of 2.37.5, spun up with the d2 cluster tool, just to make sure there isn’t a bug in my DHIS2 config.

    "headers": [
    "metaData": {
        "dimensions": {
            "dx": [
            "pe": [],
            "ou": [
            "co": []
    "rows": [

I would greatly appreciate it if this issue could be escalated in priority (if the bug can be reproduced at your end), as it is really disconcerting.

1 Like

Just an update to this.

I have recreated the issue in the 2.37.6 DHIS2 play instance. So this is defo a bug and not something dodgy with my instances.

1 Like

Thanks @HaydnJ!

I asked @geetha for support and she’s trying to figure out the reason for the error. You’ll get notifications for any updates on the jira issue. Will let you know if I get more/new input.:+1:

1 Like