You are viewing limited content. For full access, please sign in.

Question

Question

An Underlying Connection Was Closed Error

asked on September 4

Hello

Can anyone please help.

I am getting an An Underlying Connection Was Closed error. When i try to publish a workflow that has a business process designed in forms. At the end of the business process a document is createdBut I dont get the same error when i publish other workflows with no business process.

Am using LF 11 with |Forms Professional 11

Below is the full error log

----------------------------------------
Timestamp: 2024-09-04 17:56:32.235
Local Time: 9/4/2024 6:56:32 PM
Category: Activity
Machine: OVP-LFSERVER
Severity: Error
Application Domain: Laserfiche.Workflow.Service.exe
Process Id: 3796
Process Name: C:\Program Files\Laserfiche\Workflow\Laserfiche.Workflow.Service.exe
Win32 Thread Id: 18392 - 
Thread Name: 
Message: <Exception handlingInstanceId="a787fa70-985b-43c6-878a-43707d3b5426">
  <Description>An exception of type 'System.Exception' occurred and was caught.</Description>
  <DateTime>2024-09-04 18:56:32Z</DateTime>
  <ExceptionType>System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
  <Message>The underlying connection was closed: An unexpected error occurred on a send.</Message>
  <Source>Laserfiche.Workflow.Activity.Base</Source>
  <HelpLink />
  <Property name="ActivityName">RetrieveBusinessProcessVariables</Property>
  <Property name="ActivityType">Laserfiche.Workflow.Activities.Forms.RetrieveFormFieldValueActivity</Property>
  <Property name="InstanceId">a3f335ea-2bd9-4fdd-9d26-75437a14e5c4</Property>
  <Property name="TargetSite">Void ProcessTaskQueueEvent(System.Workflow.ComponentModel.ActivityExecutionContext)</Property>
  <Property name="HResult">-2146233088</Property>
  <StackTrace>   at Laserfiche.Workflow.Activities.TaskActivityBase.ProcessTaskQueueEvent(ActivityExecutionContext context)
   at Laserfiche.Workflow.Activities.TaskActivityBase.OnEvent(Object sender, QueueEventArgs e)
   at System.Workflow.ComponentModel.ActivityExecutorDelegateInfo`1.ActivityExecutorDelegateOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
   at System.Workflow.Runtime.Scheduler.Run()</StackTrace>
  <additionalInfo>
    <info name="MachineName" value="OVP-LFSERVER" />
    <info name="TimeStamp" value="9/4/2024 5:56:32 PM" />
    <info name="FullName" value="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <info name="AppDomainName" value="Laserfiche.Workflow.Service.exe" />
    <info name="ThreadIdentity" value="" />
    <info name="WindowsIdentity" value="NT AUTHORITY\SYSTEM" />
  </additionalInfo>
  <InnerException>
    <ExceptionType>System.Net.WebException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
    <Message>The underlying connection was closed: An unexpected error occurred on a send.</Message>
    <Source>System</Source>
    <HelpLink />
    <Property name="Status">SendFailure</Property>
    <Property name="Response">&lt;undefined value&gt;</Property>
    <Property name="Status">SendFailure</Property>
    <Property name="URI">http://localhost/forms/api/BusinessProcess/Instance/8066/Submission/9135</Property>
    <Property name="RequestHeader:FormClientVersion">9.0.0.0</Property>
    <Property name="RequestHeader:LFWF-Workflow-Host">OVP-LFSERVER</Property>
    <Property name="RequestHeader:Host">localhost</Property>
    <Property name="RequestHeader:Connection">Keep-Alive</Property>
    <Property name="Details" />
    <Property name="StartTime">9/4/2024 5:56:32 PM</Property>
    <Property name="EndTime">9/4/2024 5:56:32 PM</Property>
    <Property name="Duration">00:00:00.0258859</Property>
    <Property name="InstanceId">a3f335ea-2bd9-4fdd-9d26-75437a14e5c4</Property>
    <Property name="ActivityName">RetrieveBusinessProcessVariables</Property>
    <Property name="Workflow">OVPCREATEMEMOWF</Property>
    <Property name="ContextGuid">a3f335ea-2bd9-4fdd-9d26-75437a14e5c4</Property>
    <Property name="TargetSite">System.Net.WebResponse GetResponse()</Property>
    <Property name="HResult">-2146233079</Property>
    <StackTrace>   at System.Net.HttpWebRequest.GetResponse()
   at Laserfiche.Workflow.Runtime.Forms.FormActionBase.GetResponse(Uri uri)
   at Laserfiche.Workflow.Runtime.Forms.GetBusinessProcessSubmissionAction.GetData(String instanceId, String submissionId)
   at Laserfiche.Workflow.Activities.Forms.Runtime.FormsTaskExecutor.RetrieveFormFields(RetrieveFormFieldsTaskOptions options, TaskExecutorContext status, TaskResult result)
   at Laserfiche.Workflow.Activities.Forms.Runtime.FormsTaskExecutor.Execute(ITaskOptionsSerialize options, TaskExecutorContext status)
   at Laserfiche.Workflow.Runtime.Systems.Delegator.WorkThread.DoWork(Object state)</StackTrace>
    <InnerException>
      <ExceptionType>System.IO.IOException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
      <Message>Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.</Message>
      <Source>System</Source>
      <HelpLink />
      <Property name="TargetSite">Int32 Read(Byte[], Int32, Int32)</Property>
      <Property name="HResult">-2146232800</Property>
      <StackTrace>   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest, Boolean renegotiation)
   at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
   at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.ConnectStream.WriteHeaders(Boolean async)</StackTrace>
      <InnerException>
        <ExceptionType>System.Net.Sockets.SocketException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
        <Message>An existing connection was forcibly closed by the remote host</Message>
        <Source>System</Source>
        <HelpLink />
        <Property name="ErrorCode">10054</Property>
        <Property name="SocketErrorCode">ConnectionReset</Property>
        <Property name="NativeErrorCode">10054</Property>
        <Property name="TargetSite">Int32 Read(Byte[], Int32, Int32)</Property>
        <Property name="HResult">-2147467259</Property>
        <StackTrace>   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)</StackTrace>
      </InnerException>
    </InnerException>
  </InnerException>
</Exception>
----------------------------------------
 

CAn anyone please help

 

 

0 0

Replies

replied on September 4

This is almost always a TLS version issue. Please run the following script in an Administrative PowerShell session on both the Workflow and Forms servers, reboot them for the changes to take effect, and retest.

# PowerShell
# Enable TLS 1.2 for .NET Framework 4.5+ x64/x86
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -value '1' -Type 'DWord' -Force | Out-Null
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type 'DWord' -Force | Out-Null
New-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type 'DWord' -Force | Out-Null
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type 'DWord' -Force | Out-Null

#SCHANNEL - Client
New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client' -Force | Out-Null
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client' -name 'Enabled' -value '1' -Type 'DWord' -Force | Out-Null
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client' -name 'DisabledByDefault' -value 0 -Type 'DWord' -Force | Out-Null
Write-Host 'TLS 1.2 (Client) has been enabled in SCHANNEL.'

#SCHANNEL - Server
New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server' -Force | Out-Null
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server' -name 'Enabled' -value '1' -Type 'DWord' -Force | Out-Null
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server' -name 'DisabledByDefault' -value 0 -Type 'DWord' -Force | Out-Null
Write-Host 'TLS 1.2 (Server) has been enabled in SCHANNEL.'

# Reboot for changes to take effect
0 0
replied on September 5

Thanks Carson...But the workflow has been working hitherto and i dont TLS configured.

You see I have a Business Process with a Form that is used to generate a document from the form input data after the approval is done.

I have a workflow that creates the document using Retrieve Business Process Variables etc. What i also noticed now is that when i try to edit the process variables fields n the Retrieve Business Process Variables the error comes up.

The other workflows that have no business Process or forms work just well without error. Only this  with Business Process has an issue. I think this is related to the Retrieve Business Process Variables

I am scared of implementing your suggestion so I dont upset anything.

 

Any other idea of what else could be the issue?

0 0
replied on September 5

Hi Adeyemi,

First, please reply to the comment rather than the thread so the responses display in order. It makes things easier to follow.

You are using TLS. This is probably from having an "https://" Forms web service URL in Workflow (which is good).

The stack trace in your original post clearly shows SSL/TLS in use (as it would be for https to Forms):

   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest, Boolean renegotiation)
   at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)

...

   at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
   at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)

 

The issue is TLS related. 99% of the time this error occurs it's because of using an old TLS protocol version. 1% of the time it's a different part of the TLS handshake.

If the issue is the TLS protocol version, running my script on both servers will fix it (remember to reboot them after).

If it's not the issue, the script will not cause any problems. It is a very low risk change. 

The script automatically applies the settings relevant to Workflow and Forms from the official Configuration Information for TLS 1.2 support documentation.

There is no point thinking about other possible issues until ruling out the TLS protocol version one by applying the script. I have seen this same error over a hundred times, and it has always been the same issue.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.