SolrCore Initialization Failures – xConnect Sitecore 9

Since Sitecore 9 was released a few weeks back, I’ve been digging into the new release and there are lots of new things to play with. One of the most interesting new features is xConnect, a framework of rich APIs and services that allows users to integrate customer interaction data collected by Sitecore with customer data from nearly any third-party system or channel.

xConnect brings with it a separately hosted IIS site, additional Solr cores and a couple of other applications more details are available in the Developer Center.

The release of Sitecore 9 also brought a new way to install Sitecore the Sitecore Installation Framework (SIF), you can read more about that in the installation guide.

After installing Sitecore 9 locally using SIF, I wanted to make changes to the connection strings used in the installation rather than using a sql user I wanted to use the App Pool user so I removed the user id and password and added Trusted_Connection=True;

This change ended up breaking my Solr core for xDB called {siteprefix}_xdb, the logs pointed to a Solr error and opening Solr showed the message :-

SolrCore Initialization Failures 
{siteprefix}_xdb: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Error opening new searcher 
Please check your logs for more information


So I checked my Solr logs – https://localhost:8983/solr/#/~logging and found some more details on the error.



The stack trace was

null:org.apache.solr.common.SolrException: Unable to create core [{SitePrefix}_xdb] at org.apache.solr.core.CoreContainer.createFromDescriptor(
at org.apache.solr.core.CoreContainer.getCore(
at org.apache.solr.servlet.HttpSolrCall.init(
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(


Caused by: java.nio.file.FileAlreadyExistsException: C:\solr\server\solr\{SitePrefix}_xdb\data\index\write.lock
at java.base/sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(Unknown Source)
at java.base/java.nio.file.Files.newByteChannel(Unknown Source)
at java.base/java.nio.file.Files.createFile(Unknown Source)


The stack trace was pretty explicit Caused by: java.nio.file.FileAlreadyExistsException: C:\solr\server\solr{SitePrefix}xdb\data\index\write.lock _although I was not sure why they write.lock file was present. So I deleted the file and restarted my Solr service and the write.lock came back and the xDB core failed to start again.



After some digging I found a config file I had missed out on updating for the Sitecore XConnect Search Indexer service, the config file was here for my install


Once I updated the collection connectionstring

<add name="collection" connectionString="data source=(local);Initial Catalog={siteprefix}Xdb.Collection.ShardMapManager;TrustedConnection=True;" />

  • Restart the xConnect site: {siteprefix}.xconnect
  • Restart the Sitecore XConnect Search Indexer windows service
  • Deleted the log write.lock file from the the {siteprefix}_xdb and {siteprefix}_xdb_rebuild cores data directories
  • Restarted my Solr service

After this everything was happy and my Solr cores came back online.

The last step is manaully triggering a rebuild of the xDB core via the service with the command XConnectSearchIndexer -rr documented here – and you should get a success message from the service.