Search code examples
workflow-foundation-4appfabric

Multiple instances of Windows Server AppFabric Configuration


I have both a dev and prod environment set up on two different virtual directories on the same virtual machine and following Configuring Multiple WMS Instances to try and get them both set up properly. They appear to be working fine as I can see workflow instances being persisted in for the appropriate environments based on the client that is connecting to them. The problem comes in trying to view the persisted instances within IIS Manager. I get the following errors:

IIS Error Displayed when trying to look at persisted instances

Error message presented when clicking on "Error(s) encountered" link

(* I appologize, I don't know how to upload images directly into this post *)

The relevant configuration files I have are as follows:

Default Web.Config

<microsoft.applicationServer>
    <monitoring lockElements="bulkCopyProviders, collectors">
        <bulkCopyProviders>
            <bulkCopyProvider providerName="System.Data.SqlClient" type="Microsoft.ApplicationServer.Monitoring.EventCollector.SqlServerBulkCopy, Microsoft.ApplicationServer.Monitoring, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        </bulkCopyProviders>
        <collectors>
            <collector name="" session="0">
                <settings retryCount="5" eventBufferSize="10000" retryWait="00:00:15" samplingInterval="00:00:05" aggregationEnabled="true" />
            </collector>
        </collectors>
        <default enabled="true" connectionStringName="ProductionApplicationServerMonitoringConnectionString" monitoringLevel="HealthMonitoring" />
    </monitoring>
    <persistence>
        <instanceStoreProviders lockItem="true">
            <add name="SqlPersistenceStoreProvider" storeProvider="Microsoft.ApplicationServer.StoreProvider.Sql.SqlWorkflowInstanceStoreProvider, Microsoft.ApplicationServer.StoreProvider, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" storeControlProvider="Microsoft.ApplicationServer.StoreManagement.Sql.Control.SqlInstanceControlProvider, Microsoft.ApplicationServer.StoreManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" storeQueryProvider="Microsoft.ApplicationServer.StoreManagement.Sql.Query.SqlInstanceQueryProvider, Microsoft.ApplicationServer.StoreManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        </instanceStoreProviders>
        <workflowManagement>
             <workflowManagementServiceInstances lockItem="true">
                 <workflowManagementServiceInstance name="">
                     <instanceStores>
                         <instanceStore name="productionSqlPersistenceStore" location="Workflows.Prod" />
                     </instanceStores>
                 </workflowManagementServiceInstance>
                 <workflowManagementServiceInstance name="Dev">
                     <instanceStores>
                         <instanceStore name="devSqlPersistenceStore" location="Workflows.Dev" />
                     </instanceStores>
                 </workflowManagementServiceInstance>
             </workflowManagementServiceInstances>
         </workflowManagement>
         <instanceStores>
             <add name="devSqlPersistenceStore" provider="SqlPersistenceStoreProvider" connectionStringName="ApplicationServerWorkflowInstanceStoreConnectionString" />
             <add name="productionSqlPersistenceStore" provider="SqlPersistenceStoreProvider" connectionStringName="ProductionApplicationServerWorkflowInstanceStoreConnectionString" />
         </instanceStores>
     </persistence>
     <hosting>
         <serviceManagement endpointConfiguration="ServiceManagementNetPipeEndpoint" enabled="true" authorizedWindowsGroup="AS_Administrators" />
     </hosting>
 </microsoft.applicationServer>
 <connectionStrings>
     <add connectionString="BigSecret" name="ApplicationServerMonitoringConnectionString" />
     <add connectionString="BigSecret" name="ApplicationServerWorkflowInstanceStoreConnectionString" />
     <add connectionString="BigSecret" name="ProductionApplicationServerMonitoringConnectionString" />
     <add connectionString="BigSecret" name="ProductionApplicationServerWorkflowInstanceStoreConnectionString" />
</connectionStrings>

Production Web.Config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.web>
        <compilation debug="true" targetFramework="4.0" />
    </system.web>
    <system.serviceModel>
        <protocolMapping>
            <remove scheme="net.pipe" />
        </protocolMapping>
        <behaviors>
            <serviceBehaviors>
                <behavior>
                    <serviceMetadata httpGetEnabled="false" />
                    <serviceDebug includeExceptionDetailInFaults="false" />
                    <sqlWorkflowInstanceStore instanceCompletionAction="DeleteAll" instanceEncodingOption="None" instanceLockedExceptionAction="NoRetry" connectionStringName="ProductionApplicationServerWorkflowInstanceStoreConnectionString" hostLockRenewalPeriod="00:00:30" runnableInstancesDetectionPeriod="00:00:05" />
                    <workflowInstanceManagement authorizedWindowsGroup="AS_Administrators" />
                    <workflowUnhandledException action="AbandonAndSuspend" />
                    <workflowIdle timeToPersist="00:00:00" timeToUnload="00:01:00" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    </system.serviceModel>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true" />
    </system.webServer>
    <microsoft.applicationServer>
        <monitoring lockElements="bulkCopyProviders, collectors">
            <default enabled="true" connectionStringName="workflowStoreConnectionString" monitoringLevel="HealthMonitoring" />
        </monitoring>
        <persistence>
            <instanceStores>
                <remove name="defaultSqlPersistenceStore" />
                <add name="defaultSqlPersistenceStore" provider="SqlPersistenceStoreProvider" connectionStringName="workflowStoreConnectionString" />
            </instanceStores>
        </persistence>
        <hosting>
            <serviceManagement endpointConfiguration="ServiceManagementNetPipeEndpoint" enabled="false" />
        </hosting>
    </microsoft.applicationServer>
    <connectionStrings>
        <add connectionString="BigSecret" name="workflowStoreConnectionString" />
    </connectionStrings>
</configuration>

Dev Web.Config - Same as Production but with different connection string

Any help in resolving the error messages and being able to view the persisted instances is appreciated. TIA. JH


Solution

  • Turns out the issue was the result of the msi installer not properly running the sql scripts, failing silently and thus missing some of the tables. Re-running the scripts manually (Create_Persistence_Schema.sql, Create_Persistence_Logic.sql, Create_Monitoring_Schema.sql and Create_Monitoring_Logic.sql located in C:\windows\System32\AppFabric\Schema) corrected the issue.