Last week, I was upgrading AX 2012 R2 CU7 to CU8 and ran into a model store error. The error was similar to http://blogs.msdn.com/b/axsupport/archive/2014/01/08/violation-of-primary-key-constraint-pk-modelelementdata-elementhandle-error-installing-some-hotfixes-on-microsoft-dynamics-ax-2012-r2.aspx
It scared the hell out of me! First thing that came to mind was: is my model store corrupt in production?
But the source of the problem was indeed different; found out that the issue was label files.
In the AX 2012 R2 CU7, the DMF labels were missing, so this was fixed by adding them manually (see picture below)
This means that my AX2012 R2CU7 model store was consistent.
Label files cannot be deleted directly from the AOT. In such cases, the following workaround is necessary: