Fatal Error when running "Execute tasks now"

Created on 3 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 the index
Visit the server page
Click "Execute tasks now"

The website encountered an unexpected error. Please try again later.
AssertionError: The container was serialized. in assert() (line 28 of core/lib/Drupal/Core/DependencyInjection/Container.php).
assert(, 'The container was serialized.') (Line: 28)
Drupal\Core\DependencyInjection\Container->__sleep()
serialize(Array) (Line: 158)
Drupal\Core\Batch\BatchStorage->doCreate(Array) (Line: 129)
Drupal\Core\Batch\BatchStorage->create(Array) (Line: 107)
Drupal\Core\ProxyClass\Batch\BatchStorage->create(Array) (Line: 933)
batch_process() (Line: 63)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 592)
Drupal\Core\Form\FormBuilder->processForm('search_api_server_status', Array, Object) (Line: 320)
Drupal\Core\Form\FormBuilder->buildForm('Drupal\search_api\Form\ServerStatusForm', Object) (Line: 219)
Drupal\Core\Form\FormBuilder->getForm('Drupal\search_api\Form\ServerStatusForm', Object) (Line: 81)
Drupal\search_api\Controller\ServerController->page(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)

This is because the client and other parts of the Opensearch backend are not serializable.

Proposed resolution

Use DependencySerializationTraits in the correct places.

Remaining tasks

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom rlmumford Manchester

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