Have you changed your access rules after the first deployment in Prod?
I have never encounted this case but I suspect that this might be the issue with the user session or data and might not be code issue.
If I faced this scenario i will approach this issue by following
Association context mismatch: If the nanoflow is trying to set an association on an object that was retrieved in a context where it’s not editable (e.g., via XPath from a non-editable source, or from a cached object in memory).
Security constraints: The user role in Production may not have write access to the entity or association. Even if DB and code are the same, check if this user has a slightly different role assignment or inherited role.
Object state: Mendix marks objects as read-only if they are committed and retrieved in a context where editing is not allowed (for example, system-owned objects, or objects retrieved via association from a non-editable parent).
Corrupted session cache: Sometimes a specific user session can hold onto stale objects. If the object was retrieved earlier in a read-only context, the nanoflow may be trying to update that cached instance.
Special data condition: The user’s data might be linked to a classroom or user record that is already committed and locked by another process (e.g., background microflow, scheduled event, or workflow). That would make the association immutable in this context.
Maybe the above pointer will help you to debug with a idea and solve the item
Let me know if it helps
Hi,
This error usually indicates that the object in the nanoflow is not editable in the current client context, even though it works for other users.
Given that it happens only for one user in production, this is most likely data/state or access-related, not code.
Common causes and checks:
Try:
It can become read-only.
Fix:
Test:
Try:
Recommended debugging approach:
This is almost always caused by entity access or object state specific to that user’s data, leading Mendix to treat the object as read-only in the nanoflow. Verifying access rules and re-retrieving the object in the correct context typically resolves it.