Issue
Opening a Studio Pro project results in the following (example) error:
It is not possible to open the project file 'Project/File/Path', because it has an invalid format.
Usually this issue is caused by setting invalid property values in the project with the Mendix Model SDK.
Change attribute 'Attribute' in microflow 'Module.Microflow' is invalid, because it specifies both an attribute and an association.Environment
Studio Pro (all versions with AI capabilities)
Cause
There is a fundamental check within Studio Pro that a microflow must internally refer to either an entity or an association, but not neither and not both. Maia, and as an extension the model context protocol (MCP) server, does not know this, which sometimes results in improperly generated microflows. These microflows cause the entire project to fail to open.
Solution / Workaround
This workaround is not relevant for projects where the cause of this issue is proven to be from the Mendix Model Software Development Kit (SDK) or the Mendix Command Line Interface (MxCLI). Those tools have their own fixes and workarounds. This workaround is only relevant for microflows created via Maia or an artificial intelligence (AI) agent connected to the Mendix MCP server.
Initially, confirm that Maia or an AI tool is the likely culprit for the corruption. As in, confirm if these tools are regularly used. If so, have the requestor share the entire project directory, not just a simple .mpk replication. Directories that are too large can be sent via a .zip file, or similar method.
The next step is to identify the problem microflow unit identity (ID) values. Within the Mendix project file structure, microflows are referred to as $UnitID.mxunit files in the mprcontents directory. This identification is done via the mprtool.
- Open the latest installation file folder for Mendix Studio Pro itself (not the project) and navigate to the modeler folder.
- Example: C:\Program Files\Mendix\11.12.1\modeler
- Search for mprtool.exe, and open the program.
- From the File menu of the mprtool, open the issue project .mpr file.
- In the mprtool file explorer in the left-hand panel, select the issue microflow.
- For example: Module folder > Microflows folder > Microflow 'Issue'
- The error message should refer to the exact module and microflow names that are issues.
- For each issue microflow, save the $UnitID value, found in the metadata panel, in notepad or a similar program.
Once the issue files are identified, the first, and preferred, option is to rollback those specific microflows via GIT. This means the microflow changes will be lost, but the microflow itself will still be present, and anything referring to it will remain unimpacted.
- Via File Explorer, open the issue project directory.
- Delete the .mendix-cache folder.
- Viewing hidden files might need to be enabled for the operating system, if the folder is not shown.
- For each issue microflow, search for the $UnitID, and save the file path.
- Each $UnitID should refer to a .mxunit file in the mprcontents parent directory
- Open PowerShell, CMD, or a similar command line interface (CLI).
- CD (change directory) to the mprcontents directory containing the .mxunit file.
- Command: CD filePath
- A quicker way to do this is to type CMD in the File Explorer address path. This will automatically create a command prompt window that is set to that directory.
- Run this command: git log -- [$UnitID].mxunit
- If only one file is in the directory, the tab key will auto-fill the file name.
- If GIT changes are present, logs will be present. If so, then this microflow can be rolled back via this command: git restore --source=<commit-ish> -- path/to/file
- Where <commit-ish> is the commit ID of the commit to be restored to, not the commit ID to be removed/rolled-back.
- This is found in the commit section of the log and is highlighted orange/yellow.
- If only one file is in the directory, the tab key will auto-fill the file name.
- Where <commit-ish> is the commit ID of the commit to be restored to, not the commit ID to be removed/rolled-back.
- An empty line will appear, signaling the restore has completed.
- To confirm, run the following command: git status
- Under Changes not staged for commit a modified tag should appear for the issue .mxunit file.
- If too many changes are present to read, execute: git status [$UnitID].mxunit
- This will only show the changes to the issue file.
- Confirm the project now opens as expected.
For clarity, an example of the GIT CLI is as follows:
If GIT is unable to roll back the microflow, as there's no history to roll back to, or it fails, then the only option is to delete/remove the issue microflows.
- Delete each $UnitID.mxunit issue file found.
- Open DBeaver or a similar SQLite database (DB) viewing tool.
- Connect to the Mendix project.
- Example, for DBeaver: Database > New Connection > SQLite > Open project .mpr file
- For each issue file:
- Run the following statement:
SELECT * FROM Unit
WHERE lower( substr(hex(UnitID) , 7,2) || substr(hex(UnitID) , 5,2) || substr(hex(UnitID) , 3,2) || substr(hex(UnitID) , 1,2) || '-' || substr(hex(UnitID) ,11,2) || substr(hex(UnitID) , 9,2) || '-' || substr(hex(UnitID) ,15,2) || substr(hex(UnitID) ,13,2) || '-' || substr(hex(UnitID) ,17,4) || '-' || substr(hex(UnitID) ,21,12) )
= '$UnitID' - Confirm that only one value is returned.
- Run the following statement:
DELETE FROM Unit
WHERE lower( substr(hex(UnitID) , 7,2) || substr(hex(UnitID) , 5,2) || substr(hex(UnitID) , 3,2) || substr(hex(UnitID) , 1,2) || '-' || substr(hex(UnitID) ,11,2) || substr(hex(UnitID) , 9,2) || '-' || substr(hex(UnitID) ,15,2) || substr(hex(UnitID) ,13,2) || '-' || substr(hex(UnitID) ,17,4) || '-' || substr(hex(UnitID) ,21,12) )
= '$UnitID' - Confirm that only one row is updated.
- Rerun the SELECT * command to ensure it has been removed, as now nothing should be returned or found.
- Run the following statement:
- Close the DB connection and/or shutdown the DB viewer program.
- Confirm the project now opens as expected.
The project should now be able to be opened, with the issue microflows removed or rolled back, but no other parts of that commit or code change impacted.
- Navigate to the project file directory.
- Copy the mprcontents folder and the .mpr file, and save in a new file folder.
- Zip and share that file in the ticket, with instructions to replace the issue project's mprcontents folder and .mpr file with the attached.
- Inform that this change will result in the removal or change (with content loss) of the issue microflows.
- For tech-savvy requesters, the above workaround steps can also be shared.
Since Maia or an AI agent via the MCP server has created or modified these microflows, removing them and recreating them should be a suitable workaround. If the issue microflows must be recovered, R&D can run a script on the code to resolve this problem via a Teams session. This script involves removing the fundamental check, opening the project, fixing the microflows, and re-enabling the fundamental check. This is meant to be a last-ditch offer and not advertised.
Additionally, the Studio-Pro team is working with the Version-Control team to see if this service can be offered in the mx.exe tool.
Internal information related
- C0A5EDRD2/p1784910972492889
- [SPAM-497]
- 284269
Additional information
Not Applicable
0 Comments