Unable to create events after upgrade from 2.33 to 2.35.1

Iam facing the same issues and followed the @Markus solution and i found one categorycombo with default name but pk is preventing from deleting

1 Like

Yes, I think that’s supposed to happen. This solution is for when as @Markus puts it:

it should prevent you from deleting the one used by the DB;

Hello team,

I have this error when I launch the event from my tracker … how will he fix it
this error is : “Erreur dans la création de l’évènement
Incorrect result size: expected 1, actual 2”


May you please share screenshots of the issue with the Network tab, and if it’s possible share the Tomcat log (without including sensitive info)? You might also try to clear the browser cache, and use the Data Administration app to make sure you don’t have any issues with your database. Thanks!

Please also include the version of the DHIS2 instance that you are using. (:

I am not admin for the server… just super user in dhis2.

Thanks for your help

Help please, have you a solution for this problem.

Thank you

We can ask the developers for support but we need to give them more info to understand the situation.

Please what is the version of the DHIS2 instance that you are using? And would you please take a screenshot of the Network tab (F12 → Network) see if there’s a red line and click on it and take a screenshot. Thank you!

Hello @Gassim,

Our instance DHIS2 is 2.36.3


Okay, I searched in the previous CoP posts, and found this topic which is exactly the same as the issue you are facing so I will move this topic. I know you said you are not admin in the server but to solve this issue you will probably need access to the database. Please read the instructions by @Markus and see if it solves the issue:

We had the same problem today, and deleting the “extra” default categoryoptioncombo resolved it.

What is interesting, though, is that the “extra” default was created just before midnight yesterday without any obvious reason - it was NOT created during any upgrades or any other modifications to the database. We are on 2.35.15eos and have been so for a few weeks.

So the question is what exactly is triggering this duplication of the “default” categoryoptioncombo during normal database operations?

It also made me wonder if the core devs have considered adding code to automatically scan for such duplicates and delete them when they appear… @Markus ??

Best regards
Calle Hedberg

I am running DHIS2 version, I am using new Capture App. For the Tracker as program type I can create an event without any problem. However, when the program is Event, I receive the error below. I guess the error is not caused by multiple “defaults” value on categorycomb

Error Caused by: org.postgresql.util.PSQLException: ERROR: null value in column “programinstanceid” of relation “programstageinstance” violates not-null constraint
Detail: Failing row contains (71, RqQqBP8iXqj, null, 2022-10-15 21:44:30.093, 2022-10-15 21:44:30.093, null, null, 1970-01-01 03:00:00, null, 1343, 24, f, null, null, 2022-09-25 00:00:00, 102, ACTIVE, null, null, null, {“DNBXfKwdUdV”: {“value”: “Nguli”,

Any insight will be appreciated

Hi @sele

Are you still facing this issue? It will be easier to get support if we can reproduce this issue. Please can you reproduce this issue on play.dhis2.org? If you can please share the steps to reproduce.

Thank you!

Hi Gassim,

I think the problem caused by downgrading the database from 2.38.2 Snapshot back to

Since it not a production database, I solved the problem by creating fresh and Export &Import the Event program metadata.

It solved my problem.

Best regards



Hi @sele

Thank you so much for sharing! Glad to it solved :+1:

Dear @Calle_Hedberg @Gassim @Markus
We seem to have developed this same issue overnight.
We are running

When I run the SQL statement, select * from categorycombo where name = ‘default’;
I get this error


Requesting guidance on how to proceed with this.

Thank you.


Dear @ifeanyiokoye,

Could you try double quotation? “default”

I don’t think “SNAPSHOT” version is recommended. I think the stable release is so it might help if you return to that stable version.


Dear @Gassim, thank you for your support. The use of the SNAPSHOT instance has been corrected. We are now on When we ran the select query on the categorycombo table it showed only one record for the default categorycombo.
We then checked the categoryoptioncombo table, we found 3 records named default. Of the additional two, one was created last week Friday (18th March 2023) and the other was created this Monday (20th March 2023). We updated the record names and things are working well now.
What we could not figure out was how and why those additional records were created and what process brought it about. This is so arbitrary that we are concerned that it may recur.

1 Like

Hi @ifeanyiokoye

One question I received is if there were imports? Are the imports being done normally or which method is being used?

Anything significant during those dates you mentioned above? Anything from imports, server restarts…etc

Hopefully we’ll get more insight from community experts and the software team. I will let you know if I get more insight, but for now it’d be helpful if you share as much information as possible :slight_smile: Thanks!

@Gassim No, we did not do any imports over that weekend. The most we did was run the analytics table manually due to data entry activities going on at the sites. The additional categoryoptioncombos were created using the account of one of our admin users.
We did a server restart when we first noticed that folks were having issues with entering data on the tracker.


Okay, thanks for sharing the info. So you figured out how these COCs were created? :slight_smile:

No idea how they were created @Gassim.

A bit boggling right now and concerning!