Dhis2 version 2.39.8 Users getting tracked entity type error when saving enrolment

I recently upgraded from DHIS2 version 2.36 to 2.39.8 and users are getting the error below when trying to save an enrolment in tracker capture app. admins are not experiencing this
{
“httpStatus”: “Internal Server Error”,
“httpStatusCode”: 500,
“status”: “ERROR”,
“message”: “Cannot invoke “org.hisp.dhis.trackedentity.TrackedEntityType.getUid()” because the return value of “org.hisp.dhis.program.Program.getTrackedEntityType()” is null”
}

Did you tried to clear cache? If not yet do it now

Hi Sami, yes i cleared the cache

@Gassim are you able to assist. even postman is throwing the same error when non admin account is used
https://fims.cidrz.org:8445/dhis/api/trackedEntityInstances/xm7NfhPeIlU.json?program=gcGuhK3IhjB&fields=* 500 (Internal Server Error)

Hi @Kanema

I tried to reproduce this error on play using a new account that only has

  • Child Health Program Manager
  • Child Health Tracker

But no other or Admin authorities. I did give this user Maximum data output level and National OU in capture and view. It worked:

One thing I noticed is that the endpoint is different than the one you mentioned. You could try the following please and provide more feedback please:

  1. Use Data Administration app → Maintenance to clear cache and reload apps
  2. Use your browser’s Guest mode
  3. Replicate one of the non-admin accounts and grant it one authority at a time to see which authority was missing.
  4. When you have the Capture TEIs dashboard open (same as the screenshot above), check which endpoints are being used.

Thank you!

Hi @Gassim ,

thank you for the feedback on this, i have tried according to your guidance but no luck. all the other end points for trackedentitytype, orgunit e.t.c are working. the only one not working is for trackedentityinstance unless i provide full authority to the user. see end points working for non admin in postman

https://fims.cidrz.org:8445/dhis/api/29/trackedEntityTypes/mBhPmdVJj8x

orgunit is also working. only trackedEntityInstance is not working

Thank you

Hi

Sorry that it’s not working for you. I can’t reproduce this issue on play because when I used a user without the full authority it worked. You can also test this on play.dhis2.org

Could it be that maybe there was an issue with the upgrade. Looks like no one is experiencing this

Could you test using a new and clean test program and TE type? If it works then yes it might be an issue, if not then maybe it’s the configuration.

Additionally, would you share the entire Catalina.out log (without any authentication/sensitive info)?

Thanks!

hi @Gassim , so i created a new program, with a new tracked Entity Type and a new attribute. when i try to register a new client am now getting an error in the picture

I will share the catalina.out log file soon

Thank you for your time.

1 Like

It looks like you are using the legacy/deprecated app. Would you please check again using the Capture app? If it works in the Capture app then we are sure that there’s no configuration/access issue to begin with, and this will help us eliminate all those as possible reasons.

Thanks!

Hi Gassim,

so apparently there was another program (example program) besides the one i was working with. this program had no trackedentitytype asigned—am wondering how it was even saved as trackedentitytype is a required field when creating a program—i think one of the guys was testing creation of programs via API. anyway this is what was causing the error, after deleting it everything works fine.

thank you for your time.

1 Like