After upgrading Magento version from 2.2.7 to 2.3.5 everything was working fine. But suddenly checkout page is showing an error:

1 exception(s): Exception #0 (InvalidArgumentException): Unable to serialize value.

Exception #0 (InvalidArgumentException): Unable to serialize value.
<pre>#1 Magento\Checkout\Block\Onepage->getSerializedCheckoutConfig() called at [vendor/magento/module-checkout/view/frontend/templates/onepage.phtml:26]
#2 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:59]
#3 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#4 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#5 Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#6 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php:26]
#7 Magento\Framework\View\TemplateEngine\Php\Interceptor->render() called at [vendor/magento/framework/View/Element/Template.php:271]
#8 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:301]
#9 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1100]
#10 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1104]
#11 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:674]
#12 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Layout.php:566]
#13 Magento\Framework\View\Layout->_renderBlock() called at [vendor/magento/framework/View/Layout.php:542]
#14 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#15 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:497]

How can I fix the issue?

3 Answers 3


i facing same error on magento2.3.X .Read this blog. https://dolphinwebsolution.com/magento-2-3-xx-unable-to-serialize-value

  • I have tried this but not working Mar 31, 2021 at 13:57
  • 1
    thanks, This is working after running compilation. Apr 1, 2021 at 12:06
  • Thank you @vinod Kumar Apr 1, 2021 at 12:17

The error is simple to understand.

Magento 2.2.x uses serialized data, such as a:1:{s:1:"a"}. Magento 2.3.x uses json, such as {a: "a"}

So in your database, you are using the old format -> when upgrading, this data cannot be used in the new function.

Because calling json_decode(a:1:{s:1:"a"}) will give you the error you posted.

So the solution is to re-format your data. Then save it into database again.

  1. You need to find out what data should be saved (step 3)
  2. Open the config for that data -> press the save button again so that it will be saved into the database with the new format.

Or you can search for that data in your database, replace it with new format.

  1. To find out what data should be saved, you just echo/print out the data, which clearly indicated here <pre>#1 Magento\Checkout\Block\Onepage->getSerializedCheckoutConfig() called at [vendor/magento/module-checkout/view/frontend/templates/onepage.phtml:26] . You see, the php file, template file are all there. You just need to add your debug statement in there.

If you are not a developer, I suggest you hire someone to help you fix this error. It's not something that can be done within a script/module.

If you want more "properly" method, you can follow Magento official help here https://devdocs.magento.com/guides/v2.4/ext-best-practices/tutorials/serialized-to-json-data-upgrade.html


You need to have something that is a secured value stored in the magento checkout window.checkoutConfig, for example payment information, that is encrypted, but you have the wrong crypt key

For example, change your crypt key to something different and then try the onepage checkout with a payment prodvider configured (eg: authorize.net or something) and see what happens

Reference: https://github.com/magento/magento2/issues/17934

Also check your PHP version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.