In the situation where you are trying to deploy an MDS model via the package to your Master Data Services in SQL Server 2012 you can sometimes encounter failures. Sometimes it says “See exception details for more information.” and you want to get more context on the failure.

This failure is a pretty trivial one, but showing it for illustrative purposes:

MDS Error: 0 : Microsoft.MasterDataServices.Deployment.Utility.ModelDeployUtilityException: A new CustomerSample model cannot be created. There is already a model with the same name.
at Microsoft.MasterDataServices.Deployment.Utility.ModelDeploy.DeployNew(String serviceName, String packageFile, String modelName)
at Microsoft.MasterDataServices.Deployment.Utility.ModelDeploy.Main(String[] args)

Example of MDSModelDeploy.exe command lines if you are curious:


Three techniques I would do to troubleshoot MDS deployment errors are

1. Turn on logging for the deployment utility as shown below.

2. Turn on MDS logging via the web server configuration file. Following this KB:

3. Run a SQL profiler trace to watch the stored procedures being run if necessary.




To get more detailed logging on the context of the failure, please follow these steps to enable the logging.


1. Launch Notepad.exe as elevated administrator.



2. Then in notepad, File > Open and point to the location of your MDS Deployment Wizard Configuration file...

"C:\Program Files\Microsoft SQL Server\110\Master Data Services\Configuration\MDSModelDeploy.exe.config"



3. Uncomment the LogFileListener XML tag line, by removing the comment markers on this line item.

In other words, remove the comments prefix <!-- and suffix –>

< add name="LogFileListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="MdsModelDeployTrace.log" traceOutputOptions="DateTime"/>

This is the output file name and you are saying to write to the text file for logging.


4. Change the logging level to ALL by replacing the word Off in this line.
< source name="MDS" switchType="System.Diagnostics.SourceSwitch" switchValue="All">


Example of notepad for steps 3 and 4:



Example of the text in the config file with logging turned on.

<?xml version="1.0"?>
            <!-- Adjust the switch value to control the types of messages that should be logged. -->
            <source name="MDS" switchType="System.Diagnostics.SourceSwitch" switchValue="All">
                    <!-- Enable and configure listeners as desired to obtain trace messages. –>
                        <add name="LogFileListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="MdsModelDeployTrace.log" traceOutputOptions="DateTime"/>  
                    <!--<add name="EtwListener" type="System.Diagnostics.Eventing.EventProviderTraceListener, System.Core, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089"initializeData="{F2A341B8-CA5F-49ad-B00C-A82D3FCF948B}"/>-->
                    <!--<remove name="Default"/>-->
        <trace autoflush="true" />


5. Now save the edits. If you get access denied when saving, check if you have launched notepad as Administrator, since it is a Program Files folder it may be protected.

Close out of MDSModelDeploy.exe if you still have it running. Probably it had the error and returned to the prompt already. The application must start again from scratch to get the logging output. If you are back at the C:\ prompt, you don’t need to close out the window.


6. Repeat the original failure using the MDSModelDeploy.exe command line.


7. Now locate the log output and review the details.
C:\Program Files\Microsoft SQL Server\110\Master Data Services\Configuration\MdsModelDeployTrace.log



8. Later, you may reverse the logging setting changes to the config file by commenting out the LogFileListener line item (add <!-- and --> to surround the XML tag) and reverting back to the switchValue="OFF"

Hope this helps somebody out there! Jason