Uncaught exception when trying to create an index that already exists

Created on 12 February 2022, over 2 years ago
Updated 27 April 2023, about 1 year ago

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)
πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024