Problem/Motivation

After a fresh install of latest Drupal Commerce modules whenever I try to edit the default checkout flow, I get the following errors

[error] 1072#1072: *1 FastCGI sent in stderr: "PHP message: Uncaught PHP Exception LogicException: "Settings can not be serialized. This probably means you are serializing an object that has an indirect reference to the Settings object. Adjust your code so that is not necessary." at /xxx/xxx/xxx/core/lib/Drupal/Core/Site/Settings.php line 68" while reading response header from upstream, client: 127.0.0.1, server: xxx.xxx, request: "POST /admin/commerce/config/checkout-flows/manage/default?ajax_form=1&_wrapper_format=drupal_ajax HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm-one.sock:", host: "xxx.xxx", referrer: "https://xxx.xxx/admin/commerce/config/checkout-flows/manage/default"

In console, I keep getting these JS errors

Failed to load resource: the server responded with a status of 500 (500 Service unavailable (with message))

Uncaught 
Drupal.AjaxError
message: "↵An AJAX HTTP error occurred.↵HTTP Result Code: 500↵Debugging information follows.↵Path: /admin/commerce/config/checkout-flows/manage/default?destination=/admin/commerce/config/checkout-flows&ajax_form=1↵StatusText: 500 Service unavailable (with message)↵ResponseText: The website encountered an unexpected error. Please try again later.LogicException: Settings can not be serialized. This probably means you are serializing an object that has an indirect reference to the Settings object. Adjust your code so that is not necessary. in Drupal\Core\Site\Settings->__sleep() (line 68 of core/lib/Drupal/Core/Site/Settings.php). serialize(Array) (Line: 14)↵Drupal\Component\Serialization\PhpSerialize::encode(Array) (Line: 80)↵Drupal\Core\KeyValueStore\DatabaseStorageExpirable->setWithExpire('form-N54MTRLssndXf26RMLAQGrjGs2yHnPM0R-ZfF0Xq7SU', Array, 21600) (Line: 197)↵Drupal\Core\Form\FormCache->setCache('form-N54MTRLssndXf26RMLAQGrjGs2yHnPM0R-ZfF0Xq7SU', Array, Object) (Line: 459)↵Drupal\Core\Form\FormBuilder->setCache('form-N54MTRLssndXf26RMLAQGrjGs2yHnPM0R-ZfF0Xq7SU', Array, Object) (Line: 437)↵Drupal\Core\Form\FormBuilder->rebuildForm('commerce_checkout_flow_edit_form', Object, Array) (Line: 629)↵Drupal\Core\Form\FormBuilder->processForm('commerce_checkout_flow_edit_form', Array, Object) (Line: 321)↵Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 91)↵Drupal\Core\Controller\FormController->getContentResult(Object, Object)↵call_user_func_array(Array, Array) (Line: 123)↵Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)↵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: 151)↵Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)↵Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)↵Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)↵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: 47)↵Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)↵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)↵"
name: "AjaxError"
__proto__: Error at /assets/files/js/js_TdiMRR3BXgOgIRoGh26DZjaqiPeXu2B4dXeyhxcJsws.js:1697:32 at /assets/files/js/js_TdiMRR3BXgOgIRoGh26DZjaqiPeXu2B4dXeyhxcJsws.js:2240:3

Steps to reproduce

Install Drupal commence 2.20 on a fresh install of Drupal core and then edit or create a new commerce checkout flow.

I do have commerce installations on the same server, which do not suffer from the same issue. I tried to upgrade to Dev version or downgrade to 2.19, however, the error is persistent.

Comments

authintmedia created an issue. See original summary.

authintmedia’s picture

Issue summary: View changes
AmeDSL’s picture

Same problem here...

mglaman’s picture

Status: Active » Postponed (maintainer needs more info)

What contrib do you have installed that are used in the checkout form?

kristofferrom’s picture

Same problem here.
Contrib Commerce modules installed:

  • commerce_reports
  • commerce_shipping
  • commerce_stock_notifications
  • commerce_variation_cart_form
  • commerce_stock
  • commerce_stock_enforcement
  • commerce_stock_field
  • commerce_stock_local
  • commerce_stock_ui
kristofferrom’s picture

Some searching around led me to this mail_login issue: https://www.drupal.org/project/mail_login/issues/3161437
Disabling mail_login made the issue go away for me,

rszrama’s picture

Category: Bug report » Support request
Status: Postponed (maintainer needs more info) » Closed (works as designed)