Cannot invoke \"org.hisp.dhis.user.UserGroup.getDisplayName()\" because the return value of \"org.hisp.dhis.user.UserGroupStore.getByUidNoAcl(String)\" is null"}

maintenance-c7112a3fa6addc8e3d71.js:55735 Uncaught (in promise) {“pager”:{“page”:1,“total”:13,“pageSize”:50,“pageCount”:1},“programs”:[{“created”:“2023-09-20T04:04:00.630”,“lastUpdated”:“2025-06-19T12:52:31.384”,“sharing”:{“owner”:“M5zQapPyTZI”,“external”:false,“users”:{“a0yEVfNsBzZ”:{“displayName”:“Teste Teste”,“access”:“rwrw----”,“id”:“a0yEVfNsBzZ”}},“userGroups”:{“bApgKiBZ6sI”:{“displayName”:“FVF-HIV”,“access”:“rwrw----”,“id”:“bApgKiBZ6sI”},“cnq2R8uhzKv”:{“displayName”:“KUSINGATA”,“access”:“rwrw----”,“id”:“cnq2R8uhzKv”}},“public”:“rwrw----”},“shortName”:“ATS CASO INDEX”,“programType”:“WITHOUT_REGISTRATION”,“displayName”:“ATS”,“access”:{“manage”:true,“externalize”:true,“write”:true,“read”:true,“update”:true,“delete”:true,“data”:{“write”:true,“read”:true}},“href”:“http://url:/api/29/programs/eMqjaXDXWdn”,“id”:“eMqjaXDXWdn”},{“created”:“2024-05-27T11:51:14.132”,“lastUpdated”:“2025-04-10T15:23:35.981”,“sharing”:{“owner”:“M5zQapPyTZI”,“external”:false,“users”:{},“userGroups”:{},“public”:“--------”},“shortName”:“AVALIACAO DOS PADROS M&A”,“programType”:“WITHOUT_REGISTRATION”,“displayName”:“AVALIACAO DOS PADROES M&A”,“access”:{“manage”:true,“externalize”:true,“write”:true,“read”:true,“update”:true,“delete”:true,“data”:{“write”:true,“read”:true}},“href”:“http://url:/api/29/programs/aoJY7ceVgLv”,“id”:“aoJY7ceVgLv”},{“created”:“2025-04-10T04:41:07.247”,“lastUpdated”:“2025-04-24T09:00:02.587”,“sharing”:{“owner”:“M5zQapPyTZI”,“external”:false,“users”:{},“userGroups”:{“bApgKiBZ6sI”:{“displayName”:“FVF-HIV”,“access”:“rwrw----”,“id”:“bApgKiBZ6sI”},“dV3ytdDCtzd”:{“displayName”:“FVF-Child Protection”,“access”:“rwrw----”,“id”:“dV3ytdDCtzd”}},“public”:“--------”},“shortName”:“Dialogos Comunitarios”,“programType”:“WITH_REGISTRATION”,“displayName”:“Dialogos Comunitarios”,“access”:{“manage”:true,“externalize”:true,“write”:true,“read”:true,“update”:true,“delete”:true,“data”:{“write”:true,“read”:true}},“href”:“http://url:/api/29/programs/Oq9Z3JoSDMp”,“id”:“Oq9Z3JoSDMp”}]}{“httpStatus”:“Internal Server Error”,“httpStatusCode”:500,“status”:“ERROR”,“message”:“Cannot invoke "org.hisp.dhis.user.UserGroup.getDisplayName()" because the return value of "org.hisp.dhis.user.UserGroupStore.getByUidNoAcl(String)" is null”}

Hi @dguambe,

Welcome back to the community! :slight_smile:

Would you be able to identify where and how this error is appearing? I assume the error is copied from the Network/Console logs in the DevTools, if so does it appear after a specific action in the UI?

It appears that there is an issue with the UserGroups metadata. Would you double check that all the UserGroups are configured correctly? Were there any recent changes to user groups such as user group deletion? Perhaps try the Data Administration app > Maintenance > Clear cache and apps reload.

Thanks!

Thanks @Gassim

This error appears when a try to access program in maintenance app , I didn’t made changes in my user groups recently.
I have tried clean cache and apps reload.

PS. It’s working good in versions 40 but it’s not loading in 41+

1 Like

Hi @Gassim

What you suggest me to do because I really need to upgrade the version.

The matter is that in version 40 I can upgrade for any 40.xxx but I can’t go for 41

1 Like

Hi @gassim , i think finnaly i found the problem and the solution

The database has a migration (version 2.40.32) applied, but this migration is not present in your current DHIS2 version (2.40.8.1). This creates a version mismatch that Flyway detects during validation.
Steps to solve:

  1. Connect to your PostgreSQL database:
  2. Execute these commands to remove the problematic migrations: in my case was(DELETE FROM flyway_schema_history WHERE version IN (‘2.40.29’, ‘2.40.30’, ‘2.40.31’, ‘2.40.32’):wink:
  3. Then upgrade to the desired version
    Thanks for support
1 Like

Hi @dguambe

It looks like you had installed/deployed latest canary/development version of v40 (which is not yet released). Which is why your database had 2.40.32 version applied. Once you do this, flyway blocks you from downgrading. You are technically downgrading from 2.40.9(unreleased) to 2.40.8.1. This is probably the error you were seeing from flyway. It would be nice if you post the exact error message that Flyway reported. Your original post did not mention any upgrade or startup issues.

Also note that, it is strongly advised not to modify flyway_schema_history table in production databases unless you are absolutely sure of what you are doing. There is a huge risk of future migrations/upgrades failing and ending up in a corrupt state.

Glad that you sorted this. But in case of any future flyway issues, please do not hesitate to ask in this forum and share the flyway error message with us :+1:

1 Like