none
Deploy 72002 - Unable to connect to master or target server RRS feed

  • Question

  • Hi Folks,

      I am trying to use TFS Build to build and deploy a Visual Studio Database project using a publish.xml file.   I can build and deploy the project in Visual Studio by right clicking and choosing publish then selecting the profile.

    When I use TFS Build, it is building the project but the deploy is failing with the error Deploy 72002 - Unable to connect to master or target server 'abcde'.  You must have a user with the same password in master or target server.

    The value of abcde is set to the database name, not the server.

    My msbuild arguments are: /p:VisualStudioVersion=12.0 /t:Build;Publish /p:SqlPublishProfilePath=abcde.publish.xml

    I am using TFS and VS 2013.5

    Does anyone know how to fix this?

    Sunday, July 10, 2016 11:56 PM

All replies

  • Hi Andy,

    >>"The value of abcde is set to the database name, not the server."

    It seems that the tool could no be unrecognized, could you please provide more detail info about this? I'm not so clear your parameters.

    >>"I can build and deploy the project in Visual Studio by right clicking and choosing publish then selecting the profile."

    In addition, could you publish and build directly on the target machine? If you could, I guess that this issue is more related to TFS and I will move this thread to the suitable forum.

    Regards,
    Li Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, July 11, 2016 2:55 AM
  • Hi,

       I can do a publish from the command line (msbuild) using the same settings from the Build definition.

       When I queue the build definition it builds the project but fails to deploy with the above error.

    Tuesday, July 12, 2016 9:48 PM
  • Hi Andy,

    Build Visual Studio Database project using TFS Build is totally different from MSBuild. Please view below article and follow the steps which mentioned in the article.

    SQL Server Database Projects and Team Foundation Build

    In addition, if you have further question which related to TFS build. Please post your question on Team Foundation Server - Build and release management forum for dedicated support.

    Best Regards,
    Li Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Saturday, July 30, 2016 7:22 AM
  • Hi,

     The issue is not with the build process but with the deployment process. I understand that there is a work-a-round for this and I am trying to find out what it is.

    Sunday, July 31, 2016 8:42 PM
  • Hi AndyW2007,

    >>When I use TFS Build, it is building the project but the deploy is failing with the error Deploy 72002 - Unable to connect to master or target server 'abcde'.  You must have a user with the same password in master or target server.

    Before you can perform an action on a database in Visual Studio, you must log on with an account that has certain permissions on that database. The specific permissions that you need vary based on what action you want to perform. The following sections describe each action that you might want to perform and the specific permission that you need to perform it.

    For more information, please refer to this document below.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, August 2, 2016 8:20 AM
  • Hi Li and all,

    I performed several changes on my dev SQL Server, and now have this same error. My change management process didn't catch this error, as all other functions work perfectly. The only issue is deployment with SSDT.

    The changes were:

    * Upgraded code from .net 4.5.1 to 4.6.

    * Upgrade to SQL 2016

    * Separated dev vs. QA AD web site users for integrated security = true

    * Centralized developers under AD Department Development group

    I restored the SQL Server from a 30 day old checkpoint, that did not fix the issue (which downgraded the server to SQL 2014.) This did not fix the issue.

    The problem is on the Visual Studio 2015 side. All developers are affected, none can publish.

    Will post back here when the solution is found.

    Thanks!

    Robert J. Good

    Monday, August 15, 2016 2:50 PM
  • Hi Li and all,

    For this error: Deploy 72002 - Unable to connect to master or target server 'abcde'.  You must have a user with the same password in master or target server.

    Solution was: An invalid DNS entry for the database server. Correcting the DNS resolution fixed the issue. Basically, SSDT couldn't connect to the server.

    Did not see this problem when manually connecting via SSMS/ODBC, as the SSDT deploy DNS is unique to the deployment process.

    Hope this helps somebody in the future.

    Monday, August 15, 2016 8:43 PM
  • Hi all,

    In my case the issue was the same - after moving to SQL Server 2016 and upgrading to VS2015.3, I could deploy DTA to server from VS, but not from my build scripts using SSDT. None of solutions found for this error worked for me.

    Finally I noticed, that my connections string use only 'server' parameter and do not specify 'integrated security'. Setting integrated security to True solved the issue for me.

    I still don't know if this is a mistake of DBA or SSDT changed default security mode from Windows security to login/password, but for me it seems that second is true.

    Hope this will helps someone in future to save few hours.

    Monday, August 29, 2016 4:37 AM
  • Hi andy,

    Can you check your publish profile file password is stored or not ? If it is not stored add manually and try again. 

    Thursday, December 15, 2016 1:16 PM
  • I will also add that when you try to use a Windows Authentication account, by default the connection string has the integrated security = true. 

    I just added as a db_owner of the source and target database, the same user that runs the <g class="gr_ gr_7 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling ins-del multiReplace" data-gr-id="7" id="7">tfs</g> process. With that, I just pass the error. If you try to pass on the <g class="gr_ gr_9 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling ins-del multiReplace" data-gr-id="9" id="9">MSBUILD</g>, for example, the TargetUsername and TargetPassword to not use windows authentication it always fails with that error, even if both local users has the same name and password.

    Monday, October 9, 2017 7:30 PM
  • For future reference, I got past this error by installing the latest SSDT.
    Wednesday, October 25, 2017 10:23 PM
  • For future reference, I got past this error by installing the latest SSDT.

    Me too. I was on SSDT 14.0.600xx.yyy or something like that and the publish process was using the "Initial Catalog" as the "Data Source". It would also ignore the ConnectionString in the .sqlproj.user file. I just updated to SSDT 17.4 (Build # 14.0.61712.050 ) for Visual Studio 2015 and now it works.

    https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt?view=sql-server-2017#ssdt-for-visual-studio-2015


    Tuesday, May 1, 2018 10:26 PM
  • For future reference, I got past this error by installing the latest SSDT.

    Same for me. Build server still has Visual Studio 2015 on it. After upgrading to SQL Server 2016 our VSTS build that was executing a SQL Publish Profile started failing with the "Unable to Connect to Target Server" error. I upgraded to the latest version of SSDT for Visual Studio 2015 and it solved my issue.

    https://docs.microsoft.com/en-us/sql/ssdt/previous-releases-of-sql-server-data-tools-ssdt-and-ssdt-bi?view=sql-server-2017


    • Edited by Brad falk Tuesday, October 9, 2018 6:08 PM
    Tuesday, October 9, 2018 6:07 PM