The database connection is not serializable.

Created on 25 March 2025, 13 days ago

Problem/Motivation

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /en/admin/structure/types/manage/article/add-field/node/field_type_of_content_ref?destinations%5B0%5D%5Broute_name%5D=entity.node.field_ui_fields&destinations%5B0%5D%5Broute_parameters%5D%5Bentity_type%5D=node&destinations%5B0%5D%5Broute_parameters%5D%5Bfield_name%5D=field_type_of_content_ref&destinations%5B0%5D%5Broute_parameters%5D%5Bnode_type%5D=article&destinations%5B1%5D=/en/admin/structure/types/manage/article/fields/add-field
StatusText: error
ResponseText: The website encountered an unexpected error. Try again later.LogicException: The database connection is not serializable. This probably means you are serializing an object that has an indirect reference to the database connection. Adjust your code so that is not necessary. Alternatively, look at DependencySerializationTrait as a temporary solution. in Drupal\Core\Database\Connection->__sleep() (line 1920 of core/lib/Drupal/Core/Database/Connection.php). serialize() (Line: 14)
Drupal\Component\Serialization\PhpSerialize::encode() (Line: 129)
Drupal\Core\KeyValueStore\DatabaseStorageExpirable->doSetWithExpire() (Line: 145)
Drupal\Core\KeyValueStore\DatabaseStorageExpirable->setWithExpire() (Line: 193)
Drupal\Core\Form\FormCache->setCache() (Line: 463)
Drupal\Core\Form\FormBuilder->setCache() (Line: 441)
Drupal\Core\Form\FormBuilder->rebuildForm() (Line: 633)
Drupal\Core\Form\FormBuilder->processForm() (Line: 326)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm() (Line: 62)
Drupal\field_ui\Controller\FieldConfigAddController->fieldConfigAddConfigureForm()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 54)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 206)
Drupal\cleantalk\EventSubscriber\BootSubscriber->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

Install the module and create a new entity reference field

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇧🇪Belgium yoerioptr

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

Comments & Activities

Production build 0.71.5 2024