Mendix 7 UniquenessChecker seemingly causing app to go down
Hi all, We recently upgraded a very big Mendix solution (5 interacting apps) from Mendix 6.2.1 to Mendix 7.23.8. The first days everything went smoothely, but after the first week multiple of the 5 apps went down one by one, seemingly unrelated. The error we are getting is a high level: ‘com.mendix.core.CoreRuntimeException: Failed to commit’ Going through the StackTrace the most important part of the message we can find is: Caused by: java.lang.NullPointerException at java.lang.AbstractStringBuilder.append(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at com.mendix.basis.action.user.UniquenessChecker.findEntityOnAttribute(UniquenessChecker.scala:103) at com.mendix.basis.action.user.UniquenessChecker.existsInDatabase(UniquenessChecker.scala:81) We investigated the issue and found out that in our project settings a newly introduced setting (‘Runtime’ > ‘Uniqueness validation’) seemed to be the cause of this. We toggled it from ‘Runtime’ to ‘Database (recommended)’ and for 3 weeks the issues were gone. Now, we are actually getting back the same issue again. If I look on the forum more people have been struggling with this (i.e. https://forum.mendix.com/link/questions/92676) and no proper answer yet.. I hope somebody has found the culprit, as it seems it has to do with a Mendix built in UniquenessChecker… Thanks for any help! EDIT 10-03-2020 After we contacted another Mendix developer from another company who also had this issue, we found that they resolved it by updating their Java version. So, even though we were on a prescribed Java version, we did upgrade to the newest AdoptOpenJDK. After running in production for 2 weeks now, we didn't encounter the error anymore.
Not really sure if this helps or even applies to your situation in the same way, but I've ran into issues which also involved the uniqueness constraint validation a while ago. This was on a Mendix 8 release though. Does the rest of the stacktrace include one or more nullpointer exceptions?
I had contact with Mx Support about this back then, and they pointed out that it was fixed with the newer Mx8.3 release, according to these release notes: We fixed a NullPointerException issue that occurred during database synchronization where the same name attribute was recreated. (Tickets 88584, 88663, 89063, 89138)
I'm not sure whether this fix is implemendet in a Mendix 7 release.