[Issue][2.40.4.1] Null Key Serializer

Hi @Gassim @DHIS2-Community

Recently from last 2-3 weeks we have been facing issue related to Null key Serializer (Error as Below) in our dhis2 production environment, which makes the application completely inaccessible post login for all the users. Quick work around that we are currently following is we clear the application cache using the api but still unable to identify the root cause. We tried multiple scenarios to reproduce the steps including race conditions and stress testing to see if are able to put NULL values into hibernate cache in lower environment which didnt help.

{httpStatus: “Internal Server Error”, httpStatusCode: 500, status: “ERROR”,…}

httpStatus: “Internal Server Error”

httpStatusCode: 500

message: “Null key for a Map not allowed in JSON (use a converting NullKeySerializer?) (through reference chain: java.util.HashMap[\“null\”])”

status: “ERROR”

Is anybody else facing the issue? and are aware of the root cause to this? along with the reproduction steps.

Production env infra specifics:
DHIS Version: 2.40.4.1
Postgres Version: 16.9
CPU: 16 GB RAM

QA Envvironment:
DHIS Version: 2.40.4.1
Postgres Version: 13.20
CPU: 8 GB RAM