sap-commerce-tools / ccv2-project-template

Opinionated starter template for any CCv2 project
48 stars 28 forks source link

Solr fails to create cores and collections #19

Closed bechte closed 3 years ago

bechte commented 3 years ago

Hybris Version: 2105.0 Solr Version: 8.9.0

Running system initialization runs into an error, as the solr collection for the cores cannot be created. Commerce server return the following error:

INFO  [hybrisHTTP30] [AbstractSystemSetup] Activating solr index for [powertools]
INFO  [hybrisHTTP30] [DefaultSetupSolrIndexerService] Starting solr FULL index operation for [powertoolsIndex] ...
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:zookeeper.version=3.5.9-83df9301aa5c2a5d284a9940177808c01bc35cef, built on 01/06/2021 20:03 GMT
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:host.name=ari-c02ft0bfml86.fritz.box
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:java.version=11.0.11
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:java.vendor=SAP SE
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:java.home=/Library/Java/JavaVirtualMachines/sapmachine-11.jdk/Contents/Home
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:java.class.path=../lib/wrapper.jar:../bin/bootstrap.jar:../bin/tomcat-juli.jar
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:java.library.path=../lib
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:java.io.tmpdir=/Users/stefanbechtold/Projects/Netzsch/myn-platform/core-customize/hybris/temp/hybris
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:java.compiler=<NA>
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:os.name=Mac OS X
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:os.arch=x86_64
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:os.version=11.4
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:user.name=stefanbechtold
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:user.home=/Users/stefanbechtold
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:user.dir=/Users/stefanbechtold/Projects/Netzsch/myn-platform/core-customize/hybris/bin/platform/tomcat/bin
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:os.memory.free=1582MB
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:os.memory.max=4096MB
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Client environment:os.memory.total=4096MB
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ZooKeeper] Initiating client connection, connectString=localhost:9983 sessionTimeout=45000 watcher=org.apache.solr.common.cloud.SolrZkClient$ProcessWatchWithExecutor@26dbba7d
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [X509Util] Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ClientCnxnSocket] jute.maxbuffer value is 4194304 Bytes
INFO  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [ClientCnxn] zookeeper.request.timeout value is 0. feature enabled=
INFO  [hybrisHTTP30-SendThread(localhost:9983)] [ClientCnxn] Opening socket connection to server localhost/0:0:0:0:0:0:0:1:9983. Will not attempt to authenticate using SASL (unknown error)
INFO  [hybrisHTTP30-SendThread(localhost:9983)] [ClientCnxn] Socket connection established, initiating session, client: /0:0:0:0:0:0:0:1:62559, server: localhost/0:0:0:0:0:0:0:1:9983
INFO  [hybrisHTTP30-SendThread(localhost:9983)] [ClientCnxn] Session establishment complete on server localhost/0:0:0:0:0:0:0:1:9983, sessionid = 0x100443f24600001, negotiated timeout = 40000

ERROR [hybrisHTTP30] (full-powertoolsIndex-cronJob) [SolrCloudSearchProvider] org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at https://localhost:8983/solr: Underlying core creation failed while creating collection: master_powertools_Product_default
ERROR [hybrisHTTP30] (full-powertoolsIndex-cronJob) [SolrCloudSearchProvider] Create index failed, retry: name=master_powertools_Product_default, retry=1

ERROR [hybrisHTTP30] (full-powertoolsIndex-cronJob) [SolrCloudSearchProvider] org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at https://localhost:8983/solr: Underlying core creation failed while creating collection: master_powertools_Product_default
ERROR [hybrisHTTP30] (full-powertoolsIndex-cronJob) [SolrCloudSearchProvider] Create index failed, retry: name=master_powertools_Product_default, retry=2

ERROR [hybrisHTTP30] (full-powertoolsIndex-cronJob) [SolrCloudSearchProvider] org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at https://localhost:8983/solr: Underlying core creation failed while creating collection: master_powertools_Product_default
ERROR [hybrisHTTP30] (full-powertoolsIndex-cronJob) [SolrCloudSearchProvider] Create index failed, retry: name=master_powertools_Product_default, retry=3

ERROR [hybrisHTTP30] (full-powertoolsIndex-cronJob) [SolrCloudSearchProvider] org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at https://localhost:8983/solr: Underlying core creation failed while creating collection: master_powertools_Product_default
WARN  [hybrisHTTP30] (full-powertoolsIndex-cronJob) [SolrIndexerJob] Error during indexer call: powertoolsIndex
 de.hybris.platform.solrfacetsearch.indexer.exceptions.IndexerException: de.hybris.platform.solrfacetsearch.solr.exceptions.SolrServiceException: Could not create index: name=master_powertools_Product_default
    at de.hybris.platform.solrfacetsearch.indexer.listeners.IndexerOperationListener.afterPrepareContext(IndexerOperationListener.java:90) ~[solrfacetsearchserver.jar:?]
    at de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexerContextFactory.executeAfterPrepareListeners(DefaultIndexerContextFactory.java:161) ~[solrfacetsearchserver.jar:?]
    at de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexerContextFactory.prepareContext(DefaultIndexerContextFactory.java:90) ~[solrfacetsearchserver.jar:?]
    at de.hybris.platform.solrfacetsearch.indexer.strategies.impl.AbstractIndexerStrategy.doExecute(AbstractIndexerStrategy.java:149) ~[solrfacetsearchserver.jar:?]
        [...]
Caused by: de.hybris.platform.solrfacetsearch.solr.exceptions.SolrServiceException: Could not create index: name=master_powertools_Product_default
    at de.hybris.platform.solrfacetsearch.solr.impl.SolrCloudSearchProvider.createIndex(SolrCloudSearchProvider.java:130) ~[solrfacetsearchserver.jar:?]
    at de.hybris.platform.solrfacetsearch.indexer.listeners.IndexerOperationListener.afterPrepareContext(IndexerOperationListener.java:79) ~[solrfacetsearchserver.jar:?]
    ... 171 more
Caused by: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at https://localhost:8983/solr: Underlying core creation failed while creating collection: master_powertools_Product_default
    at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:681) ~[solr-solrj-8.9.0.jar:8.9.0 05c8a6f0163fe4c330e93775e8e91f3ab66a3f80 - mayyasharipova - 2021-06-10 17:54:42]
    at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:266) ~[solr-solrj-8.9.0.jar:8.9.0 05c8a6f0163fe4c330e93775e8e91f3ab66a3f80 - mayyasharipova - 2021-06-10 17:54:42]
    at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:248) ~[solr-solrj-8.9.0.jar:8.9.0 05c8a6f0163fe4c330e93775e8e91f3ab66a3f80 - mayyasharipova - 2021-06-10 17:54:42]
    at org.apache.solr.client.solrj.impl.LBSolrClient.doRequest(LBSolrClient.java:369) ~[solr-solrj-8.9.0.jar:8.9.0 05c8a6f0163fe4c330e93775e8e91f3ab66a3f80 - mayyasharipova - 2021-06-10 17:54:42]
    at org.apache.solr.client.solrj.impl.LBSolrClient.request(LBSolrClient.java:297) ~[solr-solrj-8.9.0.jar:8.9.0 05c8a6f0163fe4c330e93775e8e91f3ab66a3f80 - mayyasharipova - 2021-06-10 17:54:42]
    at org.apache.solr.client.solrj.impl.BaseCloudSolrClient.sendRequest(BaseCloudSolrClient.java:1171) ~[solr-solrj-8.9.0.jar:8.9.0 05c8a6f0163fe4c330e93775e8e91f3ab66a3f80 - mayyasharipova - 2021-06-10 17:54:42]
    at org.apache.solr.client.solrj.impl.BaseCloudSolrClient.requestWithRetryOnStaleState(BaseCloudSolrClient.java:934) ~[solr-solrj-8.9.0.jar:8.9.0 05c8a6f0163fe4c330e93775e8e91f3ab66a3f80 - mayyasharipova - 2021-06-10 17:54:42]
    at org.apache.solr.client.solrj.impl.BaseCloudSolrClient.request(BaseCloudSolrClient.java:866) ~[solr-solrj-8.9.0.jar:8.9.0 05c8a6f0163fe4c330e93775e8e91f3ab66a3f80 - mayyasharipova - 2021-06-10 17:54:42]
    at de.hybris.platform.solrfacetsearch.solr.impl.CachedSolrClient.request(CachedSolrClient.java:64) ~[solrfacetsearchserver.jar:?]
    at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:214) ~[solr-solrj-8.9.0.jar:8.9.0 05c8a6f0163fe4c330e93775e8e91f3ab66a3f80 - mayyasharipova - 2021-06-10 17:54:42]
    at de.hybris.platform.solrfacetsearch.solr.impl.SolrCloudSearchProvider.cloudRequest(SolrCloudSearchProvider.java:258) ~[solrfacetsearchserver.jar:?]
    at de.hybris.platform.solrfacetsearch.solr.impl.SolrCloudSearchProvider.doCreateIndex(SolrCloudSearchProvider.java:236) ~[solrfacetsearchserver.jar:?]
    at de.hybris.platform.solrfacetsearch.solr.impl.SolrCloudSearchProvider.createIndex(SolrCloudSearchProvider.java:122) ~[solrfacetsearchserver.jar:?]
    at de.hybris.platform.solrfacetsearch.indexer.listeners.IndexerOperationListener.afterPrepareContext(IndexerOperationListener.java:79) ~[solrfacetsearchserver.jar:?]
    ... 171 more
INFO  [hybrisHTTP30] [DefaultSetupSolrIndexerService] Completed solr FULL index operation for [powertoolsIndex]

On the solr side, neither a core nor a collection for the data is created. The error log from solr states:

Error CREATEing SolrCore 'master_powertools_Product_default_shard1_replica_n1': Unable to create core [master_powertools_Product_default_shard1_replica_n1] Caused by: Failed to detect collection
bechte commented 3 years ago

Solr configuration needs to be updated within the project template to be used with 2105. I will provide a patch file for two minor changes within the configuration.

mpern commented 3 years ago

IIRC I dont bundle any solr comfig for exactly this reason

Or at least not intentionally

mpern commented 3 years ago

FYI, I haven't added 2105 support to the template yet

bechte commented 3 years ago

IIRC I dont bundle any solr comfig for exactly this reason

Absolute, makes sense, and my fault. We've create the 2011 solr config which does not fit into the 2105 version.

Recreating the solr config worked, so I'll close this issue. Thanks for your feedback.

pshukla09 commented 1 year ago

I am facing the same issue. Any solution so far ?

bechte commented 1 year ago

I am facing the same issue. Any solution so far ?

Did you see my comment?

Recreating the solr config worked, so I'll close this issue.

pshukla09 commented 1 year ago

@bechte This approach didnot workout for me. My whole team is using same config and not getting issue.