mikaelmattsson / elasticsearch-indexer

Index WordPress posts and post meta data using Elasticseach.
GNU General Public License v2.0
43 stars 5 forks source link

Fatal error when activating #1

Closed MarkGavalda closed 9 years ago

MarkGavalda commented 9 years ago

Thanks for your contribution! Unfortunately cannot activate it:

Plugin could not be activated because it triggered a fatal error.

Fatal error: Uncaught exception 'Guzzle\Http\Exception\ClientErrorResponseException' with message 'Client error response [status code] 404 [reason phrase] Not Found [url] http://127.0.0.1:9200/bifrostcom-1' in /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php:43 Stack trace: #0 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(145): Guzzle\Http\Exception\BadResponseException::factory(Object(Guzzle\Http\Message\Request), Object(Guzzle\Http\Message\Response)) #1 [internal function]: Guzzle\Http\Message\Request::onRequestError(Object(Guzzle\Common\Event), 'request.error', Object(Symfony\Component\EventDispatcher\EventDispatcher)) #2 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call_user_func(Array, Object(Guzzle\Common\Event), 're in /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php on line 43
mikaelmattsson commented 9 years ago

Sorry about that. Could you please try again now?

vinkla commented 9 years ago

@mikaelmattsson, you can return the body of the exception if you want to. Its good if you want to find out why the exception is thrown. Just return it from the exception $e->getResponse()->getBody();. If this is what you want to do of course.

mikaelmattsson commented 9 years ago

@vinkla Thanks for the tip, but then Client::indicesExists() would return a string which evaluates as true. The status tab in admin uses Client::getIndices() which returns the error and displays it.

vinkla commented 9 years ago

Cool, just wanted to share if you didn't know. Keep up the good work!

MarkGavalda commented 9 years ago

That got me through to the next fatal error :) when trying to index stuff:

Fatal error: Uncaught exception 'Guzzle\\Http\\Exception\\ClientErrorResponseException' with message 'Client error response
[status code] 400
[reason phrase] Bad Request
[url] http://127.0.0.1:9200/bifrostcom-1' in /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php:-1
Stack trace:
#0 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(-1): Guzzle\\Http\\Exception\\BadResponseException::factory()
#1 (): Guzzle\\Http\\Message\\Request::onRequestError()
#2 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(-1): call_user_func()
#3 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(-1): Symfony\\Component\\EventDispatcher\\EventDispatcher->doDispatch()
#4 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(-1): Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch()
#5 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(-1): Guzzle\\Http\\Message\\Request->processResponse()
#6 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/guzzle/guzzle/src/Guzzle/Http/Message/EntityEnclosingRequest.php(-1): Guzzle\\Http\\Message\\Request->setState()
#7 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(-1): Guzzle\\Http\\Message\\EntityEnclosingRequest->setState()
#8 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(-1): Guzzle\\Http\\Curl\\CurlMulti->processResponse()
#9 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(-1): Guzzle\\Http\\Curl\\CurlMulti->processMessages()
#10 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(-1): Guzzle\\Http\\Curl\\CurlMulti->executeHandles()
#11 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(-1): Guzzle\\Http\\Curl\\CurlMulti->perform()
#12 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMultiProxy.php(-1): Guzzle\\Http\\Curl\\CurlMulti->send()
#13 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/guzzle/guzzle/src/Guzzle/Http/Client.php(-1): Guzzle\\Http\\Curl\\CurlMultiProxy->send()
#14 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(-1): Guzzle\\Http\\Client->send()
#15 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/GuzzleConnection.php(-1): Guzzle\\Http\\Message\\Request->send()
#16 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/GuzzleConnection.php(-1): Elasticsearch\\Connections\\GuzzleConnection->sendRequest()
#17 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php(-1): Elasticsearch\\Connections\\GuzzleConnection->performRequest()
#18 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/AbstractEndpoint.php(-1): Elasticsearch\\Transport->performRequest()
#19 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Namespaces/IndicesNamespace.php(-1): Elasticsearch\\Endpoints\\AbstractEndpoint->performRequest()
#20 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/src/Model/Indexer.php(-1): Elasticsearch\
amespaces\\IndicesNamespace->create()
#21 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/src/Model/Indexer.php(-1): Wallmander\\ElasticsearchIndexer\\Model\\Indexer->flush()
#22 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/src/Model/Indexer.php(-1): Wallmander\\ElasticsearchIndexer\\Model\\Indexer->reindexBlog()
#23 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/src/Controller/Admin.php(-1): Wallmander\\ElasticsearchIndexer\\Model\\Indexer->reindex()
#24 /www/bifrost_671/public/wp-includes/plugin.php(496): Wallmander\\ElasticsearchIndexer\\Controller\\Admin::ajaxReindex()
#25 /www/bifrost_671/public/wp-admin/admin-ajax.php(86): do_action()
#26 {main}

Next exception 'Elasticsearch\\Common\\Exceptions\\BadRequest400Exception' with message '{"error":"ActionRequestValidationException[Validation Failed: 1: index must have 1 or more primary shards;]","status":400}' in /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/GuzzleConnection.php:-1
Stack trace:
#0 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/GuzzleConnection.php(-1): Elasticsearch\\Connections\\GuzzleConnection->process4xxError()
#1 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/GuzzleConnection.php(-1): Elasticsearch\\Connections\\GuzzleConnection->sendRequest()
#2 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php(-1): Elasticsearch\\Connections\\GuzzleConnection->performRequest()
#3 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/AbstractEndpoint.php(-1): Elasticsearch\\Transport->performRequest()
#4 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Namespaces/IndicesNamespace.php(-1): Elasticsearch\\Endpoints\\AbstractEndpoint->performRequest()
#5 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/src/Model/Indexer.php(-1): Elasticsearch\
amespaces\\IndicesNamespace->create()
#6 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/src/Model/Indexer.php(-1): Wallmander\\ElasticsearchIndexer\\Model\\Indexer->flush()
#7 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/src/Model/Indexer.php(-1): Wallmander\\ElasticsearchIndexer\\Model\\Indexer->reindexBlog()
#8 /www/bifrost_671/public/wp-content/plugins/elasticsearch-indexer-master/src/Controller/Admin.php(-1): Wallmander\\ElasticsearchIndexer\\Model\\Indexer->reindex()
#9 /www/bifrost_671/public/wp-includes/plugin.php(496): Wallmander\\ElasticsearchIndexer\\Controller\\Admin::ajaxReindex()
#10 /www/bifrost_671/public/wp-admin/admin-ajax.php(86): do_action()
#11 {main}
mikaelmattsson commented 9 years ago

Go to ES Indexer » Settings, save once. Then try again.

mikaelmattsson commented 9 years ago

Fixed here: https://github.com/wallmanderco/elasticsearch-indexer/commit/970c5c1c75f5f6b52b7f76c36380aa96a9c193ba

MarkGavalda commented 9 years ago

Thanks, worked! Not sure if this is something on our end (ES settings), haven't looked into it yet:

Indexed  500/1482 posts…
Indexed  1000/1482 posts…
Errors: 
Could not index: 61
IllegalArgumentException[Document contains at least one immense term in field="post_meta.panels_data.raw" (whose UTF8 encoding is longer than the max length 32766), all of which were skipped.  Please correct the analyzer to not produce such terms.  The prefix of the first immense term is: '[97, 58, 51, 58, 123, 115, 58, 55, 58, 34, 119, 105, 100, 103, 101, 116, 115, 34, 59, 97, 58, 56, 55, 58, 123, 105, 58, 48, 59, 97]...', original message: bytes can be at most 32766 in length; got 43980]; nested: MaxBytesLengthExceededException[bytes can be at most 32766 in length; got 43980]; 
Finished indexing 1482/1482 posts…
mikaelmattsson commented 9 years ago

Try this: http://answers.splunk.com/answers/136664/changing-max-length-of-field.html