Hi,
When I try to deploy a NuGet package with Deploy.ps1 file which calls sqlpackage.exe to deploy a dacpac file I can not see sql related error messages which I see when I call Deploy.ps1 script manually.
Therefore it is hard to understand the root cause of the issue.
Octopus log doesn’t show the error like below
Error SQL72014: .Net SqlClient Data Provider: Msg 8134, Level 16, State 1, Line 13 Divide by zero error encountered.
Error SQL72045: Script execution error. The executed script:
SELECT 1 / 0;
Final part of the Deploy.ps1:
& “$sqlPackageFileName” /Action:Publish
/SourceFile:"""$sourceFile""" `
/Profile:"""$profileDirectory$profile""" 2>&1 | tee -filePath $logFilesDirectory\Output_$timestamp.txt
Output in console (the same message is in Output.txt):
Initializing deployment (Start)
Initializing deployment (Complete)
Analyzing deployment plan (Start)
Analyzing deployment plan (Complete)
Updating database (Start)
An error occurred while the batch was being executed.
Updating database (Failed)
sqlpackage.exe : *** Could not deploy package.
At C:\Projects\MyProject\Project\bin\Debug\MyProject.Deploy.ps1:43 char:1
+ & “$sqlPackageFileName” `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (*** Could not deploy package.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Error SQL72014: .Net SqlClient Data Provider: Msg 8134, Level 16, State 1, Line 13 Divide by zero error encountered.
Error SQL72045: Script execution error. The executed script:
SELECT 1 / 0;
Log in octopus (the same message is in Output.txt):
Initializing deployment (Start)
Initializing deployment (Complete)
Analyzing deployment plan (Start)
Analyzing deployment plan (Complete)
Updating database (Start)
An error occurred while the batch was being executed.
Updating database (Failed)
sqlpackage.exe : *** Could not deploy package.
At C:\Projects\MyProject\Project\bin\Debug\MyProject.Deploy.ps1:43 char:1
+ & “$sqlPackageFileName” `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (*** Could not deploy package.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
The remote script failed with exit code 1
Thanks,
Oleksii