1

We are getting below error in sitecore 9.0.2 version on cd environment for getting interactions from xdb using xconnect

In connectionstring for CD below entry was there

 <add name="xconnect.collection" connectionString="https://qa.collection" /> -

After comment we replaced with entry from cm connection string which is as below

<add name="xconnect.collection" connectionString="https://qa.collectionsearch" />

After replace error is not coming, Can someone tell should CD have only xconnect collection and not search connection string?

Error Log:

The HTTP response was not successful: InternalServerError at Sitecore.Xdb.Common.Web.Synchronous.SynchronousExtensions.SuspendContextLock[TResult](Func 1 taskFactory) at Sitecore.XConnect.Client.XConnectSynchronousExtensions.SuspendContextLock[TResult](Func 1 taskFactory) at Sitecore.XConnect.Client.XConnectSynchronousExtensions.GetBatchEnumeratorSync[TEntity](IAsyncQueryable`1 asyncQueryable, Int32 defaultBatchSize) at isango.Foundation.Analytics_JF2.Services.AnalyticsTrackingService.GetFilterInteractionsByMerchandisingAsync(Guid pageEvent, Int32 days, String destinationIdentifier, String categoryIdentifier, String attractionIdentifier, String country, Int32 count)

Code snippet where error is coming:

 using (XConnectClient client = Sitecore.XConnect.Client.Configuration.SitecoreXConnectClientConfiguration.GetClient())
{
       IAsyncQueryable<Interaction> queryable = client.Interactions
                        .Where(x => x.EndDateTime >= DateTime.UtcNow.AddDays(days) && x.Events.Any(y=>y.DefinitionId == pageEventId && y.Data == categoryto_filter && y.DataKey == country));

       var enumerable = queryable.GetBatchEnumeratorSync();

       if (enumerable.TotalCount <= 0)
       {
             queryable = client.Interactions
                         .Where(x => x.EndDateTime >= DateTime.UtcNow.AddDays(days) && x.Events.Any(y => y.DefinitionId == pageEventId && y.Data == categoryto_filter));
                        enumerable = queryable.GetBatchEnumeratorSync();
       }
}

enter image description here

1
  • Is there any error in the xConnect logs?
    – Chris Auer
    Jan 29, 2020 at 15:56

2 Answers 2

1

Did you try to add an additional param for the XConnect.Client.Configuration for the cd node?

<param desc="searchConnectionStringName">xconnect.collection</param>

I had to add this in my 9.1.1 instance for the cd system.

Before (CD):

     <clientconfig type="Sitecore.XConnect.Client.Configuration.SitecoreXConnectClientConfiguration,Sitecore.XConnect.Client.Configuration"
                    singleInstance="true"
                    role:require="ContentDelivery or Processing or Reporting and !ContentManagement and !Standalone">
        <param desc="clientModel" ref="xconnect/runtime" />
        <param desc="collectionConnectionStringName">xconnect.collection</param>
        <param desc="configurationConnectionStringName">xconnect.collection</param>
      </clientconfig>

Patch:

  <xconnect>
      <clientconfig type="Sitecore.XConnect.Client.Configuration.SitecoreXConnectClientConfiguration,Sitecore.XConnect.Client.Configuration"
                    singleInstance="true"
                    role:require="ContentDelivery or Processing or Reporting and !ContentManagement and !Standalone">                    
            <param desc="searchConnectionStringName" patch:after="param[@desc='clientModel']">xconnect.collection</param>
      </clientconfig>
    </xconnect>

After (CD):

 <clientconfig type="Sitecore.XConnect.Client.Configuration.SitecoreXConnectClientConfiguration,Sitecore.XConnect.Client.Configuration"
                singleInstance="true"
                role:require="ContentDelivery or Processing or Reporting and !ContentManagement and !Standalone">
    <param desc="clientModel" ref="xconnect/runtime" />
<param desc="searchConnectionStringName">xconnect.collection</param>
    <param desc="collectionConnectionStringName">xconnect.collection</param>
    <param desc="configurationConnectionStringName">xconnect.collection</param>
  </clientconfig>
2
  • Hi, I have added this patch after then the above error started came, before that some other error was coming. Jan 17, 2020 at 10:47
  • I got this working by adding a entry for search collection in CD instances connection string file and calling the specific entry from code. Jan 29, 2020 at 6:09
0

I got this working by adding a entry for search collection in CD instances connection string file and calling the specific entry from code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.