Problem/Motivation
You cannot use this module through the UI, because you get fatal errors when running "Execute tasks now" after configuring a new index.
Steps to reproduce
Configure a new OpensSearch server
Configure a new index and attach it to the server
Enable and add the index
Export the config
Change the prefix
Reinstall the site
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /batch?id=7&op=do_nojs&op=do
StatusText: 500 Service unavailable (with message)
ResponseText: The website encountered an unexpected error. Please try again later.Drupal\search_api\SearchApiException: An error occurred creating the index commscontacts. in Drupal\search_api_opensearch\SearchAPI\BackendClient->addIndex() (line 248 of modules/contrib/search_api_opensearch/src/SearchAPI/BackendClient.php). OpenSearch\Connections\Connection->OpenSearch\Connections\{closure}(Array) (Line: 28)
React\Promise\FulfilledPromise->then(Object, NULL, NULL) (Line: 55)
GuzzleHttp\Ring\Future\CompletedFutureValue->then(Object, NULL, NULL) (Line: 341)
GuzzleHttp\Ring\Core::proxy(Object, Object) (Line: 340)
OpenSearch\Connections\Connection->OpenSearch\Connections\{closure}(Array, Object, Object, Array) (Line: 238)
OpenSearch\Connections\Connection->performRequest('PUT', '/commscontacts', Array, NULL, Array, Object) (Line: 113)
OpenSearch\Transport->performRequest('PUT', '/commscontacts', Array, NULL, Array) (Line: 66)
OpenSearch\Namespaces\AbstractNamespace->performRequest(Object) (Line: 172)
OpenSearch\Namespaces\IndicesNamespace->create(Array) (Line: 243)
Drupal\search_api_opensearch\SearchAPI\BackendClient->addIndex(Object) (Line: 392)
Drupal\search_api_opensearch\Plugin\search_api\backend\OpenSearchBackend->addIndex(Object) (Line: 145)
Drupal\search_api\Task\ServerTaskManager->executeTask(Object) (Line: 114)
Drupal\search_api\Task\ServerTaskManager->processEvent(Object, 'search_api.task.addIndex', Object)
call_user_func(Array, Object, 'search_api.task.addIndex', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, Object) (Line: 212)
Drupal\search_api\Task\TaskManager->executeSpecificTask(Object) (Line: 356)
Drupal\search_api\Task\TaskManager->processBatch(Array, Array, Array) (Line: 295)
_batch_process() (Line: 137)
_batch_do() (Line: 93)
_batch_page(Object) (Line: 55)
Drupal\system\Controller\BatchController->batchPage(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 3263986-9.patch | 517 bytes | acbramley |
Issue fork search_api_opensearch-3263986
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3263986-uncaught-exception-when
changes, plain diff MR !5
Comments
Comment #2
jessarexward commentedThe error occurs in this function:
When I add a try catch the following error messages are outputted:
Comment #3
jessarexward commentedComment #4
jessarexward commentedComment #5
jessarexward commentedIt seems like when the site is installed with a preexisting index config, we are trying to add the index twice.
Comment #6
kim.pepperThanks for your bug report and trying out the alpha release.
I've re-titled this as it appears to be due to an uncaught exception when trying to create an index that already exists. We should be able to check if the index exists first and report an a more helpful error back to the user instead.
Comment #7
kim.pepperComment #9
acbramley commentedPatch with the above changes.
Comment #11
kim.pepperCommitted and pushed to 1.x. Thanks!