Tentacle.exe Crashing

We’ve recently upgraded from 1.6 to 2.0.8.977.

We have a process step that is supposed to create a SQL deployment script based on the comparison of two databases. It is during this step that the listening Octopus Tentacle on the SQL server crashes with the following:
Application: Tentacle.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentNullException
Stack:
at Octopus.Platform.Deployment.Logging.LogMessageEvent…ctor(System.String, Octopus.Platform.Diagnostics.TraceCategory, System.DateTimeOffset, System.String, System.String)
at Octopus.Platform.Deployment.Logging.Activity+<>c__DisplayClass1.b__0(System.String)
at Octopus.Platform.Deployment.Logging.Activity.SendToLoggerActor(Octopus.Platform.Deployment.Logging.LoggerReference, System.Func`2<System.String,Pipefish.IMessage>)
at Octopus.Platform.Deployment.Logging.Activity.Write(Octopus.Platform.Deployment.Logging.LoggerReference, Octopus.Platform.Diagnostics.TraceCategory, System.Exception, System.String)
at Octopus.Platform.Deployment.Logging.Activity.Write(Octopus.Platform.Deployment.Logging.LoggerReference, Octopus.Platform.Diagnostics.TraceCategory, System.String)
at Octopus.Tentacle.ServiceMessages.ServiceMessageParser.Append(System.String)
at System.Diagnostics.AsyncStreamReader.FlushMessageQueue()
at System.Diagnostics.AsyncStreamReader.GetLinesFromStringBuilder()
at System.Diagnostics.AsyncStreamReader.ReadBuffer(System.IAsyncResult)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.IO.Stream+ReadWriteTask.System.Threading.Tasks.ITaskCompletionAction.Invoke(System.Threading.Tasks.Task)
at System.Threading.Tasks.Task.FinishContinuations()
at System.Threading.Tasks.Task.Finish(Boolean)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean)
at System.Threading.ThreadPoolWorkQueue.Dispatch()

Is anyone experiencing something similar?

To add more detail, the portion of the PS script that is failing relates to the RedGate SQL Compare command that is executed on line 49 of the attached script.

That is where the crash occurs.

migration_script_generator_scrubbed.ps1 (7 KB)

Yes I am experiencing something similar when running SqlPackage.exe to deploy a DacPac file.

An unhandled exception of type ‘System.ArgumentNullException’ occurred in Octopus.Platform.Deployment.dll

Where did you find the exception with full stack trace?

I got the stack trace from the Application log in Event Viewer.

Yes that is the exact method throwing the same exception

at Octopus.Platform.Deployment.Logging.LogMessageEvent…ctor(System.String, Octopus.Platform.Diagnostics.TraceCategory, System.DateTimeOffset, System.String, System.String)

Thanks - we just tracked this down yesterday and should have an updated build out before long. https://github.com/OctopusDeploy/Issues/issues/471

In the meantime, examining the log for the general output that Tentacle is crashing on should allow you to modify the script to pipe the output elsewhere (e.g. to a file).

Hope this helps, thanks for the report.

You can also try this workaround …

PostDeploy.ps1
@@@
function Write-Octo {
process { Write-Host “(SQL) $_” }
}
& $SqlPackageCmd $SqlPackageArgs | Write-Octo
@@@

This will append “(SQL)” or the text of your choice to the beginning of every logged line, ensuring that there are no blank messages

Thanks Nicholas!
I’ve deployed Octopus Deploy 2.0.9.1020 and that is working great now!