- Issue created by @jura.khrapunov
- πΊπΈUnited States kevinquillen
This has never been tried under Site Studio, at least not by me.
- πΊπΈUnited States jura.khrapunov
We are getting the same result with the text editor outside of the Site Studio (body field)
- πΊπΈUnited States kevinquillen
You'll have to provide details, your AI provider, and your composer.json on how to replicate this, as I have not seen this error in Drupal 10.3 or 11.
- πΊπΈUnited States jura.khrapunov
Sure:
AI provider: OpenAI
Drupal: 10.3.5
Composer.json: https://dev.azure.com/undp-online-digital/Acquia/_git/Acquia?version=GBf...
Installed AI submodules modules (from core.extension):
ai
ai_api_explorer
ai_assistant_api
ai_chatbot
ai_ckeditor
ai_content
ai_logging
ai_translate - πΊπΈUnited States kevinquillen
There is a ton to unpack in that composer.json. Are you really using Site Studio, Panels, Page Manager, and Acquia Lightning altogether?
- πΊπΈUnited States kevinquillen
From what I could find on the form error with #ajax, it seems like it is similar to this. But its hard to know "what" other than something could be altering forms that we are unaware of.
π 'The container was serialized' error when specifying an #ajax callback for a form Active
- πΊπΈUnited States jura.khrapunov
@kevinquillen, yes we do use all those modules - it is a shared codebase for all sites my organization is managing through the Acquia Site Factory.
But what I can attest for is that the same WYSIWYG editor has other plugins utilizing ajax form submissions (Linkit, Media library, custom plugins) which are working just fine.
Any suggestions how I can debug the issue locally?
- πΊπΈUnited States jura.khrapunov
After some digging I disabled PHP's zend.assertions in local environment to uncloak the error and now getting:
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: 73) Drupal\Core\Controller\FormController->getContentResult() 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: 53) Drupal\Core\StackMiddleware\Session->handle() (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28) Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->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)
I just installed the AI module on an existing site, and I am also receiving this error. AI text formatting with CK editor does not work at all on that site. I am not receiving this error on other websites using the AI modules.
My error:
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 /var/www/html/web/core/lib/Drupal/Core/Database/Connection.php).
Severity Error
Operations
Backtrace
#0 [internal function]: Drupal\Core\Database\Connection->__sleep()
#1 /var/www/html/web/core/lib/Drupal/Component/Serialization/PhpSerialize.php(14): serialize()
#2 /var/www/html/web/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php(129): Drupal\Component\Serialization\PhpSerialize::encode()
#3 /var/www/html/web/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php(145): Drupal\Core\KeyValueStore\DatabaseStorageExpirable->doSetWithExpire()
#4 /var/www/html/web/core/lib/Drupal/Core/Form/FormCache.php(193): Drupal\Core\KeyValueStore\DatabaseStorageExpirable->setWithExpire()
#5 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(463): Drupal\Core\Form\FormCache->setCache()
#6 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(441): Drupal\Core\Form\FormBuilder->setCache()
#7 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(633): Drupal\Core\Form\FormBuilder->rebuildForm()
#8 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(326): Drupal\Core\Form\FormBuilder->processForm()
#9 /var/www/html/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#10 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
#11 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#12 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#13 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
#14 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#15 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#16 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#17 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#18 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#19 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#20 /var/www/html/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#21 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#22 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#23 /var/www/html/web/modules/contrib/advban/src/AdvbanMiddleware.php(57): Drupal\page_cache\StackMiddleware\PageCache->handle()
#24 /var/www/html/web/core/modules/ban/src/BanMiddleware.php(50): Drupal\advban\AdvbanMiddleware->handle()
#25 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle()
#26 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#27 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#28 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#29 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#30 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#31 {main}- π¬π§United Kingdom MrDaleSmith
Can this error be recreated on the dev version of the AI module?
- πΊπΈUnited States jura.khrapunov
Yes, this is consistently replicable for the Dev version as well:
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: 73) Drupal\Core\Controller\FormController->getContentResult() 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: 53) Drupal\Core\StackMiddleware\Session->handle() (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28) Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->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)
- π¬π§United Kingdom MrDaleSmith
Can't recreate this issue on a clean install of Drupal with the ai_ckeditor module installed and configured: generation, summary, tone and translation all work without generating error.
I am using an external amazon RDS database, in case that information helps. But I have a similar configuration on a site where this is working so I am not sure what the difference is.
- πΊπΈUnited States jura.khrapunov
I assume it is an interference with some other module installed.
@jbuttler can you share the list of installed/enabled modules (core.extension.yml in config export), or at least your composer.json? Yes, sorry for the delay, Its quite a large list of modules so I agree there is likely a conflict somewhere. Many of these modules are not enabled I am experiencing this issue on at least 2 websites which have a heavy module load. I am not experiencing this on test sites with only AI modules installed.
_core: default_config_hash: R4IF-ClDHXxblLcG0L7MgsLvfBIMAvi_skumNFQwkDc module: new_relic_rpm: -20 address: 0 admin_toolbar: 0 admin_toolbar_search: 0 admin_toolbar_tools: 0 advban: 0 ai: 0 ai_api_explorer: 0 ai_assistant_api: 0 ai_automators: 0 ai_chatbot: 0 ai_ckeditor: 0 ai_content_suggestions: 0 ai_eca: 0 ai_external_moderation: 0 ai_image_alt_text: 0 ai_image_bulk_alt_text: 0 ai_logging: 0 ai_provider_aws_bedrock: 0 ai_provider_groq: 0 ai_provider_huggingface: 0 ai_provider_openai: 0 ai_search: 0 ai_seo: 0 aitxt: 0 allowed_formats: 0 autoban: 0 autoban_advban: 0 autoban_ban: 0 automated_cron: 0 autotitle: 0 aws: 0 back_to_top: 0 ban: 0 better_exposed_filters: 0 big_pipe: 0 block: 0 block_content: 0 breakpoint: 0 calendar_view: 0 calendar_view_demo: 0 calendar_view_multiday: 0 captcha: 0 cdn: 0 cdn_ui: 0 certificate: 0 ckeditor5: 0 comment: 0 commerce: 0 commerce_authnet: 0 commerce_cart: 0 commerce_checkout: 0 commerce_log: 0 commerce_number_pattern: 0 commerce_order: 0 commerce_payment: 0 commerce_payment_example: 0 commerce_price: 0 commerce_product: 0 commerce_product_limits: 0 commerce_promotion: 0 commerce_store: 0 composer_deploy: 0 config: 0 config_entity_reference_selection: 0 contact: 0 content_moderation: 0 contextual: 0 credited_hours_formatter: 0 csv_serialization: 0 date_filter: 0 datetime: 0 datetime_range: 0 dblog: 0 domain: 0 domain_access: 0 duration_field: 0 dynamic_page_cache: 0 eca: 0 editor: 0 embed: 0 entity: 0 entity_browser: 0 entity_browser_entity_form: 0 entity_embed: 0 entity_print: 0 entity_print_views: 0 entity_reference_revisions: 0 entityreference_filter: 0 exclude_node_title: 0 field: 0 field_group: 0 field_layout: 0 field_permissions: 0 field_ui: 0 file: 0 file_mdm: 0 file_mdm_exif: 0 file_mdm_font: 0 filefield_paths: 0 filter: 0 fireworksai: 0 flag: 0 flag_bookmark: 0 flag_count: 0 flippy: 0 flood_control: 0 formatter_suite: 0 iframe: 0 image: 0 image_effects: 0 imagemagick: 0 inline_entity_form: 0 job_scheduler: 0 jquery_ui: 0 jquery_ui_accordion: 0 jquery_ui_checkboxradio: 0 jquery_ui_datepicker: 0 jquery_ui_draggable: 0 jquery_ui_droppable: 0 jquery_ui_effects: 0 jquery_ui_resizable: 0 jquery_ui_slider: 0 jquery_ui_tabs: 0 jquery_ui_touch_punch: 0 jsonapi: 0 key: 0 language: 0 layout_builder: 0 layout_discovery: 0 link: 0 mailgun: 0 mailsystem: 0 masquerade: 0 media: 0 media_directories: 0 media_directories_editor: 0 media_directories_ui: 0 media_library: 0 menu_link_content: 0 menu_trail_by_path: 0 menu_ui: 0 messageclose: 0 mimemail: 0 mimemail_example: 0 multiple_registration: 0 mysql: 0 node: 0 options: 0 page_cache: 0 path: 0 path_alias: 0 pdf_api: 0 phpass: 0 printable: 0 printable_pdf: 0 profile: 0 quicktabs: 0 quicktabs_accordion: 0 quicktabs_jqueryui: 0 quiz: 0 quiz_directions: 0 quiz_long_answer: 0 quiz_matching: 0 quiz_multichoice: 0 quiz_page: 0 quiz_short_answer: 0 quiz_truefalse: 0 range: 0 recaptcha: 0 responsive_image: 0 rest: 0 rules: 0 s3fs: 0 scheduler: 0 search: 0 search_api: 0 serialization: 0 settings_tray: 0 shortcut: 0 sophron: 0 state_machine: 0 super_login: 0 superfish: 0 syslog: 0 system: 0 tabtamer: 0 tamper: 0 taxonomy: 0 telephone: 0 text: 0 text_field_formatter: 0 time_field: 0 token: 0 token_filter: 0 toolbar: 0 twig_tweak: 0 type_style: 0 type_style_example: 0 type_style_moderation: 0 typed_data: 0 ultimate_cron: 0 update: 0 user: 0 viewfield: 0 views_aggregator: 0 views_bulk_edit: 0 views_bulk_operations: 0 views_conditional: 0 views_data_export: 0 views_field_view: 0 views_infinite_scroll: 0 views_merge_rows: 0 views_pdf: 0 views_slideshow: 0 views_slideshow_cycle: 0 views_ui: 0 viewsreference: 0 webform: 0 webform_access: 0 webform_attachment: 0 webform_demo_region_contact: 0 webform_entity_view: 0 webform_example_composite: 0 webform_example_remote_post: 0 webform_example_variant: 0 webform_examples: 0 webform_image_select: 0 webform_node: 0 webform_options_custom: 0 webform_options_limit: 0 webform_scheduled_email: 0 webform_schema: 0 webform_share: 0 webform_submission_log: 0 webform_templates: 0 webform_ui: 0 webform_views: 0 workflows: 0 pathauto: 1 views: 10 paragraphs: 11 minimal: 1000 theme: claro: 0 stable: 0 classy: 0 colosseum: 0 profile: minimal
- πΊπΈUnited States jura.khrapunov
We identified conflicting module, after upgrading codebase to D11 and respective updates to contributed modules the issue is gone. Closing as out of scope.
- πΊπΈUnited States jura.khrapunov
@kevinquillen - in our case it was Acquia DAM β , pinned it down by switching off modules one by one until we found working configuration.
- π¬π§United Kingdom yautja_cetanu
Just for our info.
Did upgrading Acquia DAM and upgrading it to Drupal 11 fix it? OR did you remove Acquia DAM to fix it?
I traced down the issue to a database error on my site. I had previously installed the Domain module β , which caused many website issues. When it was uninstalled, it left behind many artifacts in the database causing a variety of website errors. I was able to clean up the database and correct these errors left by the domain module, and now I no longer experience this error.