Client deploy fails with "sqlcmd.exe exited with a non-zero exit code"

A deploy script executes successfully on our development and production environments but fails on our clients environment with "sqlcmd.exe exited with a non-zero exit code".

The deployment succeeds with a backup copy of our clients database on our systems making us believe it may be environmental.

This is the log captured from the script execution:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Using default value for ForceDeployWithoutBaseline variable: False
Using Windows Authentication
Using default value for DefaultDataPath variable: D :\MSSQLDATA\MSSQL14.CUITRACKM\MSSQL\DATA\
Using default value for DefaultLogPath variable: D :\MSSQLDATA\MSSQL14.CUITRACKM\MSSQL\DATA\
Using default value for DefaultBackupPath variable: E:\Backup\\
Starting 'iFastrack' Database Deployment to 'INSTRACKPRD_ALIAS'
sqlcmd.exe -b -S "INSTRACKPRD_ALIAS" -v DatabaseName="iFastrack" ReleaseVersion="1.1.0" DeployPath="C:\inetpub\wwwroot\iFastrack\Utilities\packages\iFastrack_902004.1.1.0\" ForceDeployWithoutBaseline="False" DefaultFilePrefix="iFastrack" DefaultDataPath="D:\MSSQLDATA\MSSQL14.CUITRACKM\MSSQL\DATA\" DefaultLogPath="D:\MSSQLDATA\MSSQL14.CUITRACKM\MSSQL\DATA\" DefaultBackupPath="E:\Backup\\" -d "iFastrack" -i "C:\inetpub\wwwroot\iFastrack\Utilities\packages\iFastrack_902004.1.1.0\iFastrack_SQL_902004_Package.sql" -E
The database already exists. An incremental deployment will be performed.
C:\inetpub\wwwroot\iFastrack\Utilities\packages\iFastrack_902004.1.1.0\iFastrack_SQL_902004_DeployPackage.ps1 : A 
deployment error occurred: sqlcmd.exe exited with a non-zero exit code. 
At line:1 char:127
+ ... on='1.1.0'; &'C:\inetpub\wwwroot\iFastrack\Utilities\packages\iFastra ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,iFastrack_SQL_902004_DeployPackage.ps1
 
sqlcmd.exe exited with a non-zero exit code.
At C:\inetpub\wwwroot\iFastrack\Utilities\packages\iFastrack_902004.1.1.0\iFastrack_SQL_902004_DeployPackage.ps1:228 
char:5
+     throw 'sqlcmd.exe exited with a non-zero exit code.'
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (sqlcmd.exe exit...zero exit code.:String) [], RuntimeException
    + FullyQualifiedErrorId : sqlcmd.exe exited with a non-zero exit code.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

It appears to be able to communicate with the SQL Server and database since it found that it already exists.
Not sure if the use of an Alias for the instance name has any negative affects.

How can I determine what the returned error was from sqlcmd.exe?

Any ideas on where to begin on locating/isolating an issue would be greatly appreciated.

Thanks,

John

Tagged:

Answers

Sign In or Register to comment.