AJAX HTTP error occurred when adding search server

Created on 5 September 2023, about 1 year ago
Updated 7 September 2023, about 1 year ago

Problem/Motivation

When I select "Meilisearch" in the "Add a server" interface at /admin/config/search/search-api/add-server, the setting panel for Meilisearch does not expand. In the Javascript console, the following message shows up:

{
    "message": "\nAn AJAX HTTP error occurred.\nHTTP Result Code: 200\nDebugging information follows.\nPath: /admin/config/search/search-api/add-server?ajax_form=1\nStatusText: parsererror\nResponseText: AssertionError: The container was serialized. in assert() (line 16 of /var/www/html/web/core/lib/Drupal/Core/DependencyInjection/Container.php).",
    "name": "AjaxError"
}

If I go ahead an save the server settings (without adding any Meilisearch-specific information), the following serverside error shows up:

The website encountered an unexpected error. Please try again later.
AssertionError: The container was serialized. in assert() (line 16 of core/lib/Drupal/Core/DependencyInjection/Container.php).
assert(, 'The container was serialized.') (Line: 16)
Drupal\Core\DependencyInjection\Container->__sleep()
serialize(Array) (Line: 14)
Drupal\Component\Serialization\PhpSerialize::encode(Array) (Line: 111)
Drupal\Core\KeyValueStore\DatabaseStorageExpirable->doSetWithExpire('form-6QyMFecKyNnvfP06o1cfLim9s5_lbuQRi2YpdMc5Bsg', Array, 21600) (Line: 122)
Drupal\Core\KeyValueStore\DatabaseStorageExpirable->setWithExpire('form-6QyMFecKyNnvfP06o1cfLim9s5_lbuQRi2YpdMc5Bsg', Array, 21600) (Line: 197)
Drupal\Core\Form\FormCache->setCache('form-6QyMFecKyNnvfP06o1cfLim9s5_lbuQRi2YpdMc5Bsg', Array, Object) (Line: 463)
Drupal\Core\Form\FormBuilder->setCache('form-6QyMFecKyNnvfP06o1cfLim9s5_lbuQRi2YpdMc5Bsg', Array, Object) (Line: 441)
Drupal\Core\Form\FormBuilder->rebuildForm('search_api_server_form', Object, Array) (Line: 633)
Drupal\Core\Form\FormBuilder->processForm('search_api_server_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
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: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
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: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

1. Install and activate the module (v1.0.0 or 1.0.x-dev)
2. Activate the search_api_db module
3. Create new server (no backend plugin will be selected on the form)
4. Select backend "Database" and its configuration form is loaded
5. Select backend "Meilisearch" and the configuration form is not updated (the form stays from the Database plugin)
6. Save the form and the error is thrown

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇯🇵Japan hktang

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

Comments & Activities

Production build 0.71.5 2024