From a recent post, you may need to restore your local RAD DB2 database, and it may or may not be a backup from another toolkit. When the database is restored, all the data you need is there, but Solr is still not returning the expected products.

So you open a command prompt, and cd into c:\IBM\WCDE80\bin.

Run the preprocessor for your master catalog or your catalog asset store, which we will pretend is 12345:

di-preprocess.bat C:\IBM\WCDE80\search\pre-processConfig\MC_12345\DB2

Everything works fine, and then you go to di-buildindex since that’s mainly what you wanted:

di-buildindex.bat -masterCatalogId 12345

And you end up with a terrible stack trace like so:

SEVERE: error: IOException occured when talking to server at: http://the-wrong-server:3737/solr
org.apache.solr.client.solrj.SolrServerException: IOException occured when talking to server at: http://the-wrong-server:3737/solr
	at org.apache.solr.client.solrj.impl.HttpSolrServer.executeMethod(HttpSolrServer.java:566)
	at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:210)
	at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:206)
	at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:124)
	at com.ibm.commerce.foundation.dataimport.process.util.SolrUtil.makeDataImportNoCleanCommand(SolrUtil.java:560)
	at com.ibm.commerce.foundation.dataimport.process.DataImportProcessorMain.fullDataImport(DataImportProcessorMain.java:1941)
	at com.ibm.commerce.foundation.dataimport.process.DataImportProcessorMain.executeDIH(DataImportProcessorMain.java:1045)
	at com.ibm.commerce.foundation.dataimport.process.DataImportProcessorMain.main(DataImportProcessorMain.java:463)
Caused by: org.apache.http.conn.ConnectTimeoutException: Connect to aws-dv-esss01.matw.matthewsintl.com:9080 timed out
	at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
	at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:178)
	at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304)
	at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
	at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
	at org.apache.solr.client.solrj.impl.HttpSolrServer.executeMethod(HttpSolrServer.java:448)
	... 7 more

Locally, you are can probably figure out the server shouldn’t be the-wrong-server:3737 but localhost:80.

To fix the server URL, you need to check the database:

select * from SRCHCONF;
select * from SRCHCONFEXT;

Both tables contain a config column. SRCHCONFEXT overrides SRCHCONF. However, if you restored a database backup from a dev or QA server, it could be pointing to the wrong Solr server for everything.

Update SRCHCONF to use the right SearchServerPort (80), SearchServerName (localhost), and PreProcessConfigDirectory (same path you use for the di-preprocess utility, in our example, C:\IBM\WCDE80\search\pre-processConfig\MC_12345\DB2)

If any other config is set, you will likely want to leave it. It will likely just be IndexScopeTag.

For SRCHCONFEXT, update config for the the catalog IDs (probably all of them) you want to run Solr for locally to:
SearchServerPort=80,SearchServerName=localhost

Re-running the di-buildindex utility should now complete without throwing that exception.

This also applies for QA servers or any testing environment that is getting the IOException. The URL is likely wrong. Other possibilities are:

  • Solr is not accessible from the machine you are running di-buildindex on, either a network issue or a firewall.
  • Solr isn’t running. di-buildindex requires Solr to be started in order to work.