8

I had some trouble with xConnect at the beginning after I have installed Sitecore 9 Update 2. I had trouble with Sitecore xConnect Search Indexer Windows service particularly. It was a configuration issue at the end which caused the service not to run for a couple of days. Meanwhile, xConnect was saving data in the Contacts/Interactions table in SQL Server shard DBs.

When I fixed the issues with Search Indexer Windows Service, I am getting these exceptions and it's flooding my AppDomain log located under $path_to_your_xconnect_site$\App_data\jobs\continuous\IndexWorker\App_data\Logs.

Exception:

2018-08-09 10:13:07.158 +02:00 [Error] *** [GetContactsChanges], Line
27. Errno 50000: Sync token is no longer valid for [Contacts] table. System.Data.SqlClient.SqlException (0x80131904): *** [GetContactsChanges], Line 27. Errno 50000: Sync token is no longer valid for [Contacts] table.    at System.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__174_0(Task`1 result)    at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Sitecore.Xdb.Sql.Common.Extensions.DbCommandExtensions.<>c__DisplayClass1_0.<<ExecuteReaderWithRetryAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Sitecore.Xdb.Sql.Common.Extensions.DbCommandExtensions.<ExecuteReaderWithRetryAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Sitecore.Xdb.Sql.Common.Extensions.SqlCommandExtensions.<ExecuteReaderWithRetryAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Sitecore.Xdb.Sql.Common.Extensions.SqlCommandExtensions.<ExecuteReaderWithRetryAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Sitecore.Xdb.Collection.Data.SqlServer.Managers.SqlDataRecordsManager`2.<>c__DisplayClass75_0.<<ReadChanges>b__0>d.MoveNext() ClientConnectionId:0970f150-17f0-4f1a-b752-8974c0683f83 Error Number:50000,State:1,Class:16

Same exception but for [InteractionFacets], [ContactFacets] and [Interactions] is following this one with pretty much the same stack trace.

Has somebody encountered similar problems? What was the resolution?

5
  • did you manage to solve the problem? if yes would you please advise me about it?
    – AME
    Commented Nov 29, 2018 at 10:37
  • I created new instance of Sitecore at the end cause rebuilding of collection database was not helping Commented Nov 29, 2018 at 10:51
  • would you tell me how did you rebuild collection database? is it different than reloading the core db and rebuilding the xconnect search indexer service?
    – AME
    Commented Nov 29, 2018 at 10:57
  • I have followed this article doc.sitecore.com/developers/90/sitecore-experience-platform/en/… @AmiraElEwady Commented Nov 29, 2018 at 10:58
  • 1
    yes i also followed this article but still have same issue. However thanks alot for your help and quick response.
    – AME
    Commented Nov 29, 2018 at 13:20

3 Answers 3

12

The indexer can no longer figure out all the changes saved to xConnect while it was down. This is why rebuilding the index is the only option at this point.

———

Full context: if you are using SQL server for your collection database, the indexer uses SQL Server’s change tracking feature to keep up to date with any incoming changes.

SQL Server only keeps changes for a limited amount of time (configurable, I think default deployments have it at 5 days) called the retention period

Since your indexer was down longer than the retention period, then SQL Server will no longer returns all changes.

2
  • i have the same issue, i tried reloading the core db and rebuilding the xconnect search indexer however i got the following: [Error] The attempt to recover from previous failure has not been successful. along with the same error again. Is there anything that i missed?
    – AME
    Commented Nov 29, 2018 at 10:30
  • 1
    @AmiraElEwady one thing to have in mind when doing a rebuild is that it can take a while to finish. Since live indexing continues its retries, then you would still see the errors until the rebuild finished. That said, that attempt to recover message sounds like a Solr side thing. You might want to check all is looking good on the Solr side.
    – eglasius
    Commented Nov 29, 2018 at 17:44
11

I ran into this a while ago but could not figure out how to fix it without a full reinstall.

However, recently @ezlateva and @jflarente figured out that you can fix this issue with an index rebuild of the xDB core. Note that this requires two cores: old and new. The steps required are specific to the search engine, but documentation has steps for Solr:

https://doc.sitecore.com/xp/en/developers/latest/sitecore-experience-platform/rebuild-the-xdb-index-in-solr.html

To invoke the rebuild request command:

  1. Go to the server where the xConnect Search Indexer is running and open a command line.

  2. Go to the xConnect Collection Search IndexWorker folder.

  3. Run Sitecore.XConnectSearchIndexer.exe -rr (alternatively Sitecore.XConnectSearchIndexer.exe -requestrebuild). The command registers a small document in the live core signaling that the rebuild should be started. The xConnect Search Indexer will notice the document and start the rebuild process.

There are many more details in the docs, can't clone it all over, but hopefully this helps.

2
  • above link seems to have expired, this is working (04/19/23): doc.sitecore.com/xp/en/developers/93/…
    – Kash
    Commented Apr 19, 2023 at 15:40
  • Thank you @Kash ! I updated the link and added a bit of the docs in a quote to help Commented Apr 19, 2023 at 21:51
0

I got this error recently. We are hosting our Sitecore 9.2 instance on Azure PaaS and using Azure Cognitive Search.

When this exception comes, this usually indicates the sync token is no longer valid for the "Contacts" table. This means that the token used by xConnect to keep track of changes to the "Contacts" table has become invalid, and as a result, xConnect is unable to retrieve any changes to the table. This can be solved by rebuilding the xDB index in Solr as described here:

But for us, even index rebuilding is not able to finish. Then, we checked the Azure Search service and found out storage has reached out to the 99%. After we increase the scaled-up the Azure search service, this issue got resolved.

enter image description here

It's important to keep an eye on storage limits when using cloud services like Azure to avoid running into issues like this. Regularly monitoring and adjusting storage limits can help prevent unexpected errors and downtime.

Your Answer

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

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