Composite C1 - Scheduled Publishing with LoadBalancing throws 'No data exist given the data key values'

67 views Asked by At

I use the Orckestra Composite C1 CMS with LoadBalancing and ran into a problem with Scheduled Publishing.

The given scenario

  • Two nodes / servers, load-balanced.
  • load-balanced access (for example "www.mysite.com")
  • Access to each node individually for testing purposes (for example "www01.mysite.com")

I created a C1 datatype with Scheduled Publishing ("Has publishing"-flag is true). By adding new data objects of this type and setting an Unpublish date, the record will be saved as expected. However, when the unpublish date and time is reached, the server sometimes (not always) throws the following exception:

System.InvalidOperationException: No data exist given the data key values
   at Composite.Verify.ThrowInvalidOperationException(String message)
   at Composite.Data.DataFacade.GetDataByUniqueKey(Type interfaceType, Object dataKeyValue)
   at Composite.C1Console.Scheduling.DataUnpublishSchedulerWorkflow.Execute()
   at Composite.C1Console.Scheduling.BaseSchedulerWorkflow.finalizeCodeActivity_ExecuteCode(Object sender, EventArgs e)
   at System.Workflow.ComponentModel.Activity.RaiseEvent(DependencyProperty dependencyEvent, Object sender, EventArgs e)
   at System.Workflow.Activities.CodeActivity.Execute(ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
   at System.Workflow.Runtime.Scheduler.Run()

If you dig in the source of Composite C1, you'll notice that C1 tries to do something with the scheduling task and fails to do so. Check this source file:

https://searchcode.com/file/116651989/CompositeC1/Composite.Workflows/C1Console/Scheduling/DataUnpublishSchedulerWorkflow.cs

As a result of this failing process, the C1 data that should be unpublished is invisible on one node and visible on the other, as if it wouldn't have been unpublished (correctly).

The same issue occurs with publishing records. I searched the open web and was not yet able to find an answer.

1

There are 1 answers

0
Matthias Thomann On

I am not sure if the exception above is actually caused by the synchronization issue. In fact, I get this exact exception if I try to save a C1 data with an invalid un/publish date (like a date in the past).

However, the problem can be solved by changing the following in settings.

Choose one Composite C1 web node to be your server. Content management should only be made on this server. Each other node will be a client to the server.

Now change this configuration key value from shared to server/client.

Node A

<system.net>
 [...]
  <appSettings>
    <add key="Composite.LoadBalancing.Mode" value="server" />
  </appSettings>
  <system.net>

Each other node

<system.net>
 [...]
  <appSettings>
    <add key="Composite.LoadBalancing.Mode" value="client" />
  </appSettings>
  <system.net>