During a troubleshoot session with Sitecore, I was asked to rebuild the xDB index and I thought “I should connect to Sitecore and be able to rebuild it, easy peasy”.

Sitecore support provided me with the link, and there are some steps there in how to Rebuild the core
You cannot trigger an index rebuild from a user interface or via the xConnect Client API. You must explicitly trigger the rebuild process in one of the following ways:
To invoke the rebuild request command:
- Go to the server where the xConnect Search Indexer is running and open command line.
- Navigate to the folder that contains the service – for example:
C:\inetpub\wwwroot\<xConnect Collection Search service root>\App_Data\jobs\continuous\IndexWorker
.- Run
XConnectSearchIndexer -rr
(alternativelyXConnectSearchIndexer -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.
As my environment is running on Azure, here is how I complete the above steps
1. Navigate to App Services, and clicked on xConnect Collection Search App

2. A new blade shows up, and I typed at the search field Advanced tools, clicked on it and then click Go

3. Advanced Tools (aka Kudu) opens in a new tab, then click Debug console, and Powershell


4. Now, you can navigate throught the files & folders structures, so go to the following path site\wwwroot\App_data\jobs\continuous\IndexWorker

5. In order to rebuild your index, type the following command and hit enter
XConnectSearchIndexer.exe -rr

THE ERROR
An error occurred while sending the request. —> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

As this rebuild process calls the SOLR, and for my surprise SOLR opened and without SSL errors, valid certificate at the address bar

Now, my challenge was to figure out where XConnectSearchIndexer is getting an invalid connection.
While navigating at the XConnect Collection Search via KUDU, I noticed a folder named App_Config at the App_Data\jobs\continuous\IndexWorker and decided to check what’s inside of it, and for my surprise there is a ConnectionStrings.config

Let’s look inside of it

As you can see, the entry solrCore is using HTTPS but it calls the domain eastus.cloudapp.azure.com which was the initial address Solr had in my configuration, and as I don’t have the proper certificate for it, when I try to access it from the browser

Fair enough, Solr is throwing an SSL error, so let’s change the ConnectionStrings.config at App_Data\jobs\continuous\IndexWorker to the working SOLR URL

Now, let’s execute the XConnectSearchIndexer.exe -rr again

Rebuild is complete!
I hope you liked it, and I’ll see you on my next post!
Credits
Photo by Sarah Kilian on Unsplash
Deixe um comentário