ezsystems / launchpad

CLI tool to bootstrap an eZ Platform project Docker stack | #justcode
https://ezsystems.github.io/launchpad
MIT License
22 stars 26 forks source link

Init Solr Core not created #62

Closed raupie closed 4 years ago

raupie commented 5 years ago
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? yes
Version x.y.z
Environment Linux

A fresh install of ezlaunchpad and a new init of ezplatform results in a solr collection error.

I've noticed that this happens off and on. See #61 .travis failure for example.

I believe this may have something to do with permissions. Ref #55

Solr is running

Creating new core 'collection1' using command:
http://localhost:8983/solr/admin/cores?action=CREATE&name=collection1&instanceDir=collection1

ERROR: Error CREATEing SolrCore 'collection1': Could not create a new core in /ezsolr/server/ez/collection1as another core is already defined there

Core collection1 created.
Solr is running
Re-indexing started for search engine: eZ Platform Solr Search Engine

Purging index...
Re-Creating index for 13 items across 1 iteration(s), using single (current) process:
 0/1 [>---------------------------]   0%08:07:10 ERROR     [console] Error thrown while running command "--env=prod ezplatform:reindex". Message: "Wrong HTTP status received from Solr: 404 on http://solr:8983/solr/collection1\nEzSystems\EzPlatformSolrSearchEngine\Gateway\Endpoint::__set_state(array(\n   'scheme' => 'http',\n   'user' => NULL,\n   'pass' => NULL,\n   'host' => 'solr',\n   'port' => 8983,\n   'path' => '/solr',\n   'core' => 'collection1',\n))\nEzSystems\EzPlatformSolrSearchEngine\Gateway\Message::__set_state(array(\n   'headers' => \n  array (\n    'version' => '1.1',\n    'status' => 404,\n    'Cache-Control' => 'must-revalidate,no-cache,no-store',\n
...
..
.
jlchassaing commented 5 years ago

Hello, I fixed this issue by adding : sed -i -e 's/<\/config>/<schemaFactory class="ClassicIndexSchemaFactory"\/><\/config>/g' /ezsolr/server/ez/template/solrconfig.xml on line 19 of the solr entyoint.bash file

didn't still figure out if this issue should be fixed in the ezplatform solr bundle instead of fixing it in the docker conf entrypoint file

xserna commented 4 years ago

@Plopix I've just reproduced this bug, it seems that the solr core creation done in the solr entrypoint is causing a collision with the core creation in the recipes for Init and Create. Disabling core creation on the recipes and maintaining only the solr reindex seems to work well. I've checked this all with eZP 2.5.9 and Solr 6.6.2, not checked with v3 and Solr 7.

Plopix commented 4 years ago

Yes, I don't remember the use case. But I remember we needed both actually because we cannot know for sure if the core has been created before that's why we have it both.

I guess the answer is around here: https://github.com/ezsystems/launchpad/blob/master/src/Command/Docker/Initialize.php#L230 https://github.com/ezsystems/launchpad/blob/master/src/Command/Docker/Create.php#L56

Is that possible we run $executor->indexSolr(); if the core is not created yet... which is this case will be in the EntryPoint and The Recipe. (when init/create)

I don't reproduce the bug actually, and right now I definitely agree with what you are saying.

Me when I test I have just an error saying that the Core exist but I don't have index error.

So that's why I closed the issue. but if there is really an index issue then we need to fix I will re-open.

xserna commented 4 years ago

@Plopix check attached PR #82 it solves the issue here.

xserna commented 4 years ago

@raupie @Plopix believe this can be closed now?