XConnect IndexWorker error “Tokens are incompatible, they have different set of shards.”
Recently, I had restored a “production” backup of the master and core databases from a Sitecore 9.0 Update-1 instance to my local SQL server installation. After that, the Sitecore log started filling up with the exception:
Sitecore.XConnect.XdbSearchUnavailableException Message: The HTTP response was not successful: InternalServerError.
Examining the log for IndexWorker located at \wwwroot[prefix].xconnect\App_data\Logs, the following error was showing up:
Tokens are incompatible, they have different set of shards.
I came across this Stack Exchange thread here. However, even though I followed what was suggested, this error persisted.
After some digging, I find out that the List Manager application also stores synchronization tokens in each item located at /sitecore/system/List Manager/ListOperations. To my surprised, I had several items in my Sitecore instance with the sync token pointing to production server and shard databases.
The solution was to update the sync token in each item with the sync token from my Solr installation. To find out what sync token is corresponding to your instance, in Solr, query the [prefix]_xdb index for id:xdb-index-token.
After, fixing the sync token, the items from /sitecore/system/List Manager/ListOperations were deleted as the List Manager application processed each one.