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

Question

Question

Workflow Laserfiche.RepositoryAccess.MalformedDataException Received bad response from the server.

asked on January 23, 2024 Show version history

I have a workflow with and SDK script. 

 FolderInfo fiCreated = Folder.GetFolderInfo(BoundEntryInfo.Id, RASession);
 fiCreated.Lock(LockType.Exclusive);
 fiCreated.Unlock();

It never gets to line 3 as the lock fails. 

A few bits of troubleshooting

  1. The workflow is just this. It's been stripped down to avoid side effects
  2. Error happens if triggered by a rule or started manually
  3. It only happens on my test server
  4. If I copy the flow to my production workflow server it will run even against the test laserfiche server
  5. If I run from the test workflow server against production laserfiche server it will fail.
  6. Both servers have workflow service running as local system
  7. Switching to network service does not help
  8. Switching to a domain account resolves the issue but I'm still concerned about it running as a privileged account as production does not need to.
  9. The full script updates the entity fields and changes it's template with no problem it's just this lock.
  10. We think it worked in the past but I can't be sure as it's a lightly used test system.

 

The error we get is "Received bad response from the server."

"C:\Program Files\Laserfiche\Workflow\Logs\Errors\activity errors.log"

 

----------------------------------------
Timestamp: 2024-01-24 01:27:06.609

Local Time: 2024-01-23 5:27:06 PM

Category: Activity

Machine: LF-WF-T

Severity: Error

Application Domain: Laserfiche.Workflow.Service.exe

Process Id: 8796

Process Name: C:\Program Files\Laserfiche\Workflow\Laserfiche.Workflow.Service.exe

Win32 Thread Id: 2180 - Task Work Thread [CustomTasks]

Thread Name: Task Work Thread [CustomTasks]

Message: <Exception handlingInstanceId="32fe51ac-e4cb-47da-81e6-f14794398e81">
  <Description>An exception of type 'Laserfiche.WrappedException' occurred and was caught.</Description>
  <DateTime>2024-01-23 17:27:06Z</DateTime>
  <ExceptionType>Laserfiche.WrappedException, Laserfiche.Base, Version=9.0.0.0, Culture=neutral, PublicKeyToken=607dd73ee2bd1c00</ExceptionType>
  <Message>Received bad response from the server.</Message>
  <Source />
  <HelpLink />
  <Property name="WrappedExceptionType">Laserfiche.RepositoryAccess.MalformedDataException, Laserfiche.RepositoryAccess, Version=10.2.0.0, Culture=neutral, PublicKeyToken=3f98b3eaee6c16a6</Property>
  <Property name="ActivityName">SDKScript</Property>
  <Property name="TargetSite">&lt;undefined value&gt;</Property>
  <Property name="HResult">-2146233088</Property>
  <StackTrace>   at Laserfiche.RepositoryAccess.EntryLock.ParseLockResponse(HttpResponse response)
   at Laserfiche.RepositoryAccess.EntryLock.LockInternal(HttpUrl url, LockType type, Dictionary`2 additionalHeaders, String etag)
   at Laserfiche.RepositoryAccess.EntryLock.Lock(LockType type)
   at Laserfiche.RepositoryAccess.EntryInfo.Lock(LockType type)
   at WorkflowActivity.Scripting.SDKScript.Script1.Execute()
   at WorkflowActivity.Scripting.ScriptBase.ExecuteScript(ScriptExecutionContext context)</StackTrace>
  <additionalInfo>
    <info name="MachineName" value="LF-WF-T" />
    <info name="TimeStamp" value="2024-01-24 1:27:06 AM" />
    <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>
</Exception>
----------------------------------------

 

0 0

Replies

replied on January 24, 2024

I would suspect some kind of firewall or proxy of messing with the network traffic. If you aren't using TLS, I would suggest looking at a Wireshark capture, and comparing a working environment with a non-working one.

0 0
replied on January 24, 2024

We are using TLS but I did try a few network tools.

  • Wireshark - To much traffic to know for sure what server is even returning the error. Most of it seems to be encrypted.
  • Procmon - Most of the communications seem to be to the sql server and Laserfiche server but a failed run and working run look very similar. No noted failures 
  • Fiddler - This tool lets me decrypt https. In theory you have to run the workflow service as the current user to get it to recognize the http/https proxy. This is why I switched users. Never got it to work.
0 0
replied on January 24, 2024

Is there a reason why you're using RA 10.2? If the WF server is 10.2, I would upgrade it first. If it's newer but the script is using RA10.2, I would change it to a newer version to match the version of the WF Server.

0 0
replied on January 24, 2024

My workflow designer version is 11.0.2209.835. When I look into it's loaded Assemblies it's loading Laserfiche.RepositoryAcceess 11.0.0.0 / 11.0.2101.203

C:\Program Files\Laserfiche\Workflow on both server and the only differences are a few keys in config files and the log files.

I compared the CAG and the only differences are the following files exist on test but not on production.

  • GAC_MSIL\ClientAutomation\v4.0_10.4.0.0__607dd73ee2bd1c00\ClientAutomation.dll
  • GAC_MSIL\Laserfiche.ImageEnable\v4.0_10.4.0.0__607dd73ee2bd1c00\Laserfiche.ImageEnable.dl
0 0
replied on January 24, 2024

Your stack trace says 10.2:

<Property name="WrappedExceptionType">Laserfiche.RepositoryAccess.MalformedDataException, Laserfiche.RepositoryAccess, Version=10.2.0.0, Culture=neutral, PublicKeyToken=3f98b3eaee6c16a6</Property>

Check the script and make sure it says "public class <ScriptName> : RAScriptClass110" at the top and references Laserfiche.RepositoryAccess 11. I'm guessing your script says "RAScriptClass102" and most likely the issue is that you are using TLS. RepositoryAccess version 10.2 cannot use TLS 1.2. And likely you copied the code into a new SDK script on the working server where it uses RA 11.

 

0 0
replied on January 24, 2024

Thank you for the pointers. The script was written by our vendor so I don't know much about the SDK.

 

I tried swapping out the parent class and got the following errors

  • This script uses base class RAScriptClass110 which does not match the reference 'Laserfiche.RepositoryAccess, Version=10.2.0.0, Culture=neutral, PublicKeyToken=3f98b3eaee6c16a6'. Please match the base class to the reference by changing it to RAScriptClass102 or updating the reference.
  • Assembly 'Laserfiche.Workflow.Activities.83, Version=8.3.0.0, Culture=neutral, PublicKeyToken=d8428ff9263e6cda' uses 'Laserfiche.RepositoryAccess, Version=11.0.0.0, Culture=neutral, PublicKeyToken=3f98b3eaee6c16a6' which has a higher version than referenced assembly 'Laserfiche.RepositoryAccess, Version=10.2.0.0, Culture=neutral, PublicKeyToken=3f98b3eaee6c16a6'

 

I see when I create a new workflow it use 110 but sdk activities in this old workflow use 102. Is there a way to upgrade a workflow?

It looks like the new workflow works. TLS 1.1 and older are disabled on the production server also but maybe it didn't take and needs another reboot to break. Enabling all tls 1.0 and tls 1.1 on the test workflow server didn't fix the issue either but I have not enabled tls 1.=1 on every server again. 

0 0
replied on January 24, 2024

Easiest way to upgrade the script would be to copy the code out (from right update the RAScriptClass102 line) and paste it into a new SDK activity. Assuming it does not have custom references. If it does, you'd have to re-add and match those too.

WF does not modify script references on its own during upgrades because there could be significant functionality changes.

0 0
replied on January 24, 2024

I tried that and it doesn't work because Designer > SequentialWorkflowActivityProxy > Projects  includes all the dll references and they seem to be linked with the workflow when it's created. I did a test by :

  1. Create a new workflow and export it, you might need to add an SDK item to it.
  2. Export the workflow in question
  3. Replace the Projects section with the section from the new workflow you created using some text editor.
  4. Replace the workflow with this new version. I had to go into the script and add a space and save it to force a recompile.

 

Still no idea why this broke only on test but at least I have a fix. Thank you for the help.

0 0
replied on January 24, 2024

My workflow designer version is 11.0.2209.835. When I look into it's loaded Assemblies it's loading Laserfiche.RepositoryAcceess 11.0.0.0 / 11.0.2101.203

C:\Program Files\Laserfiche\Workflow on both server and the only differences are a few keys in config files and the log files.

I compared the CAG and the only differences are the following files exist on test but not on production.

  • GAC_MSIL\ClientAutomation\v4.0_10.4.0.0__607dd73ee2bd1c00\ClientAutomation.dll
  • GAC_MSIL\Laserfiche.ImageEnable\v4.0_10.4.0.0__607dd73ee2bd1c00\Laserfiche.ImageEnable.dll
You are not allowed to follow up in this post.

Sign in to reply to this post.