Error: Attempt to illegally change a value for object with id <id> (<entity>). Object hash is invalid!

0
(See my answer to this problem in the comments)   Hi all,   Since moving from Mendix 10.6 to 10.9 users been encountering the following error: Attempt to illegally change a value for object with id '<id>'  (<entity>). Object hash is invalid!   Here are some details about the error. Encountered since: moving from Mendix 10.6 to 10.9. Until this day users are still having this issue. Error frequency: This problem is encountered everyday, multiple times. Application wide problem: Yes, it's not an error that occurs on a specific page or in a specific module, but application wide. It happens both on the local host and in the cloud. Affected users: Anonymous and non-anonymous users. The problem is user specific though, meaning user 1 might have the error, while user 2 doesn't. Affected browsers: Chrome we know for sure, other browsers we don't know. How to reproduce: Unfortunately, it is unclear how to reproduce exactly. It seems to happen if you use the application, and then do not use it for a while, to come back to it later. It seems like it might have to do with the session. Solution: Not known. Temporary fix is to delete the cookies. The problem will arise at a random moment in the future again.   Problem After not using the app for an undisclosed time, our error screen will popup for the user showing that something went wrong. After closing the popup and pressing a button/going to another page, the error popup will show again (and a new log message is logged). Only after clearing the browser cookies the problem is temporary fixed.   Example error log: 2024-06-04T10:31:19.027171 [APP/PROC/WEB/0]   ERROR - Connector: An error has occurred while handling the request. [User 'Anonymous_378ccd7b-b0a6-4bb9-b002-56cef8a47970' with session id '7262e649-XXXX-XXXX-XXXX-XXXXXXXXcae1' and roles 'Anonymous']2024-06-04T10:31:19.027191 [APP/PROC/WEB/0]  com.mendix.webui.WebUIException: Attempt to illegally change a value for object with id '5066549622469729' (Inschrijfformulier.Locatie). Object hash is invalid!2024-06-04T10:31:19.027204 [APP/PROC/WEB/0]      at com.mendix.webui.requesthandling.HashUtilImpl$.verifyHash(HashUtilImpl.scala:58)   Our hunch We checked the changelog of Mendix 10.9 and it says Session and Login Token Improvements. We are afraid that this problem has to do with these improvements. We think the error is related to the cookies/session management, since deleting the cookies temporarily solves the problem. Since the problem occurs with different entities that are being loaded, and not necessarily the top-most entity, we cannot relate it to our own application logic. Also, we've never had this issue before and all of a sudden it started showing up on every page, which makes us think it is not specific to our app logic.   What we've done so far We've searched the community for answers, and found this error occurred with other users but without a clear solution. We've contacted Mendix, but Mendix somehow was unable to reproduce the error in our application. After a long back and forth without progress (since Mendix could not reproduce the error and we are unable to give a reliable way of reproducing the error), we've discussed the issue with our Mendix partner. After explaining the error to our partner, they were able to (unreliably) reproduce the error themselves within 10 minutes on our acceptance environment. Our Mendix partner is continuing to look into this.   Relevant community questions Q132473: Attempt to illegally change a value for object with id '166351711236054100' (BTIC_Mobile.Language). Object hash is invalid! Q100896: Getting Error - Object hash is invalid! Q128896: Attempt to illegally change a value for object with id ' 123 ' & Frozen Launch screen Q119391: What reason will cause the `roles` of a `User` being empty? Q124790: Hash is invalid , Connector error Q102301: Attempt to illegally change a value for object with id %id%! etc.
asked
5 answers
2

Any progress with this? Starting to see the same in my 10.12.0 app, sporadically.

answered
2

We are also facing the same issue. We are using studio pro version 10.12.3. We started getting this error after changing the version from 10.6.1 to 10.12.3 .

answered
0

Update: it is clear to us that this is a platform problem. We do not expect this to be picked up by Mendix soon. We did find a workaround for now, which has worked for us for over a month now and thus seems safe.

 

Temporary fix until the issue is solved by Mendix

The problem seems to be connected to the session timeout. Increasing the SessionTimeout runtime setting seems to (completely) mitigate the problem. The Mendix standard setting is 600.000 (10 minutes). We changed it to 6.000.000 (100 minutes). We also set the EnableKeepAlive runtime setting to false, read below why.

 

Impact of changing the SessionTimeout

The expected impact of this change is possibly increasing the memory usage of the server. Mendix documentation notes (https://docs.mendix.com/refguide/tricky-custom-runtime-settings/#general-settings):

Increasing the session timeout can improve the user experience, especially on mobile devices. It is important to keep in mind that entities used to present data to the user or entities that are created or retrieved when a user executes a microflow are tied to that user’s session, and those entities can remain in memory for long periods of time. When a user signs out, these entities will be removed from memory, but if the user idles but does not sign out (for example, if they leave the browser tab open while executing other tasks or simply close the browser without signing out), the session timeout can act as a safeguard that prevents memory usage from being tied up by idle sessions. The first case can also be mitigated by setting the EnableKeepAlive custom setting to false. On most browsers, this setting will ensure that any idle browser tab will be affected by the session timeout as well.

 

We have not found any implications by putting this 'hotfix' into use.

 

Hopefully this helps other people, since we were lost on this problem for a long time ourselves and Mendix Support was unable to help.

answered
0

Please do not follow the recommendation to extend the SessionTimeout. This is not recommended and can negatively impact the performance of your Mendix application and can also have an impact on your billing.

 

We have identified an issue with session handling that was introduce in 10.9 and released a fix in 10.12.3. Please test if this version resolves the issue for you. If not, please reach out to our support, so we can investigate the issue and provide a fix.

 

We will soon release a feature to allow users to stay logged in beyond the lifetime of a session using authentication tokens. This is already used in offline-first PWAs and native mobile apps.

answered
0

It would be nice if the fix Mendix implemented in v10 was backported to v9.  We have been seeing this exact same issue for the entire time we have been on v9 and are currently on the latest 9.24.26.  We see it every single day.

answered