Sunday, January 15, 2017

AX 2012 – TFS Build Error: The AXUtil command was started in the mode: export. Working against model store SQLServerName /ModelDatabaseName. ERROR: The file exists

Hi Guys

I am using the CodeCrib Library in order to handle my TFS Build Process.

During the last run, I faced the follow error:

Exception Message: Error exporting model: AXUtil 6.3 - Microsoft Dynamics AX Admin Utility (6.3.3000.2948) (c) Copyright, Microsoft Corporation, 2011. All rights reserved. The AXUtil command was started in the mode: export. Working against model store XXXXXX/XXXXXXX_model. ERROR: The file exists. (type Exception) Exception Stack Trace: at CodeCrib.AX.Manage.ModelStore.ExportModelShell(String modelName, String modelPublisher, String modelFile, String strongNameKeyFile) in c:\Users\xxxxxxxx\Documents\Visual Studio 2013\Projects\MainAxTFSLib\CodeCrib.AX.Manage\CodeCrib.AX.Manage\ModelStore.cs:line 144 at CodeCrib.AX.Manage.ModelStore.ExportModel(String modelName, String modelPublisher, String modelFile, String strongNameKeyFile) in c:\Users\ xxxxxxxx\Documents\Visual Studio 2013\Projects\MainAxTFSLib\CodeCrib.AX.Manage\CodeCrib.AX.Manage\ModelStore.cs:line 84 at CodeCrib.AX.TFS.ExportModel.Execute(CodeActivityContext context) in c:\Users\ xxxxxxxx\Documents\Visual Studio 2013\Projects\MainAxTFSLib\CodeCrib.AX.TFS\CodeCrib.AX.TFS\ModelStore.cs:line 96 at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
An error occurred while copying diagnostic activity logs to the drop location. Details: The file exists.

Resolution: You have to clean the TEMP folder related to the Agent User that will run the Build Process. 
Something like C:\Users\xxxxxxx\AppData\Local\Temp. After many TFS Build run, this folder contains a lot of files and an certain point the process try to create a file that already exist.

If possible, create a batch process that clean this folder at regular basis.

That is it!

Sunday, January 1, 2017

AX 2012 - TFS Build Failed, Timeout during XPO Import

Hi Guys

Let me say, start the New Year with a post is a good start. What do you say?

Back to us, if the TFS Build fail, the causes could be many.

However, from my experience if fails with a Timeout during the XPO Import (you can achieve this through the Build Txt log), the reasons can be two:


1-    Someone delete an AOT object without commit the operation on TFS. Afterward someone else create a new AOT object and add it to TFS. This one could have the same GUID of the deleted object.

2-    Someone rename an AOT object but on TFS (through TFS Solution Explorer), the object have the new name but inside the XPO is present the old name (In my opinion this is a Microsoft bug)!!!

In both case the TFS Build fails.

In order to understand which object create the issue you have to:


1-    Restore the AX Baseline Database (the DBs without any AX Customizations) on your TFS Build AX Environment
2-    Run the XPO Import process manually and verify the error
3-    Fix the error on Dynamics AX or TFS as mentioned above
4-    Rerun the TFS Build Process

Happy New Year!