Share via


SQLPackage publish timeout

Question

Wednesday, February 8, 2017 4:03 PM

Hi,

I deploy a database using a database schema file (.dacpac) and SQLPackage.exe tool to publish a database. In some cases the publish operation fails with a timeout error. I added the \tt (target timeout) and the /p:CommandTimeout command line parameters to define the connection timeout (\tt) and the command timeout. Unfortunately it looks like the SQLPackage.exe tool doesn't  use the CommandTimeout parameter because the deployment fails.

Do you know how can I set the timeouts to prevent this error?

Thank you!

All replies (5)

Wednesday, February 8, 2017 4:44 PM

Are you running the latest version of sqlpackage.exe, as the CommandTimeOut parameter was only introduced recently? 

Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com


Thursday, February 9, 2017 6:50 AM

Yes, I run the latest sqlpackage.exe but it looks than the CommandTimeout is not used. Do you know an other solution for timeout issues? 


Thursday, February 9, 2017 9:17 AM

What does your command line look like, and what file version is sqlpackage.exe ?

Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com


Thursday, February 9, 2017 9:52 AM

The command line is the following: 

SqlPackage.exe /a:publish /p:CommandTimeout=1800 /sf:"C:\Temp\db.dacpac" /pr:"C:\Temp\db.xml" /v:installation=UPDATE /v:appedition=PROFESSIONAL /tsn:"server\sql" /tdn:"MyDatabase" /tt:120 /tu:"username" /tp:"********"

The SQLPackage.exe's file version is 13.0.3485.1.

The publish profile is:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <IncludeCompositeObjects>True</IncludeCompositeObjects>
    <TargetDatabaseName>Database</TargetDatabaseName>
    <DeployScriptFileName>db.sql</DeployScriptFileName>
    <ProfileVersionNumber>1</ProfileVersionNumber>
    <ScriptDatabaseOptions>True</ScriptDatabaseOptions>
    <BlockOnPossibleDataLoss>False</BlockOnPossibleDataLoss>
    <DropObjectsNotInSource>True</DropObjectsNotInSource>
    <DoNotDropApplicationRoles>True</DoNotDropApplicationRoles>
    <DoNotDropAsymmetricKeys>True</DoNotDropAsymmetricKeys>
    <DoNotDropAudits>True</DoNotDropAudits>
    <DoNotDropBrokerPriorities>True</DoNotDropBrokerPriorities>
    <DoNotDropCertificates>True</DoNotDropCertificates>
    <DoNotDropContracts>True</DoNotDropContracts>
    <DoNotDropCredentials>True</DoNotDropCredentials>
    <DoNotDropCryptographicProviders>True</DoNotDropCryptographicProviders>
    <DoNotDropDatabaseAuditSpecifications>True</DoNotDropDatabaseAuditSpecifications>
    <DoNotDropDatabaseRoles>True</DoNotDropDatabaseRoles>
    <DoNotDropEndpoints>True</DoNotDropEndpoints>
    <DoNotDropEventNotifications>True</DoNotDropEventNotifications>
    <DoNotDropEventSessions>True</DoNotDropEventSessions>
    <DoNotDropFileTables>True</DoNotDropFileTables>
    <DoNotDropFilegroups>True</DoNotDropFilegroups>
    <DoNotDropLinkedServerLogins>True</DoNotDropLinkedServerLogins>
    <DoNotDropLinkedServers>True</DoNotDropLinkedServers>
    <DoNotDropLogins>True</DoNotDropLogins>
    <DoNotDropPermissions>True</DoNotDropPermissions>
    <DoNotDropQueues>True</DoNotDropQueues>
    <DoNotDropRemoteServiceBindings>True</DoNotDropRemoteServiceBindings>
    <DoNotDropRoleMembership>True</DoNotDropRoleMembership>
    <DoNotDropRoutes>True</DoNotDropRoutes>
    <DoNotDropSearchPropertyLists>True</DoNotDropSearchPropertyLists>
    <DoNotDropSequences>True</DoNotDropSequences>
    <DoNotDropServerAuditSpecifications>True</DoNotDropServerAuditSpecifications>
    <DoNotDropServerRoleMembership>True</DoNotDropServerRoleMembership>
    <DoNotDropServerRoles>True</DoNotDropServerRoles>
    <DoNotDropServerTriggers>True</DoNotDropServerTriggers>
    <DoNotDropServices>True</DoNotDropServices>
    <DoNotDropSignatures>True</DoNotDropSignatures>
    <DoNotDropSymmetricKeys>True</DoNotDropSymmetricKeys>
    <DoNotDropUsers>True</DoNotDropUsers>
    <TargetConnectionString>Data Source=localhost;Persist Security Info=True;User ID=username;Pooling=False</TargetConnectionString>
  </PropertyGroup>
  <ItemGroup>
    <SqlCmdVariable Include="appedition">
      <Value>PROFESSIONAL</Value>
    </SqlCmdVariable>
    <SqlCmdVariable Include="installation">
      <Value>FULL</Value>
    </SqlCmdVariable>
  </ItemGroup>
</Project>

Monday, April 9, 2018 11:36 PM

Hi, 

is this topic still open? did you try the following version of the parameters? (Should be unrelated to the publish profile btw)

/p:CommandTimeout=600 /TargetTimeout:600