Magento – I got the error ‘Unable to serialize value’ after upgrading the magento version to the 2.2.1

category-listingerrorfull-page-cachemagento-2.2.1

I have upgraded website 2.2.1 and facing Unable to serialize value error in particular product categories.

When I disabled the page cache (FPC) from the admin cache management then it works fine but when I enabled the page cache then I got the error.

But I need to enable page cache for optimization. Can you guys please help me!!!!

{"0":"Unable to serialize value.","1":"#0 /home/infiniar/public_html/vendor/magento/framework/App/PageCache/
Kernel.php(153): Magento\Framework\Serialize\Serializer\Json->serialize(Array)\n#1 /home/infiniar/public_html/vendor/
magento/module-page-cache/Model/Controller/Result/BuiltinPlugin.php(96): Magento\Framework\App\PageCache\Kernel->process
(Object(Magento\Framework\App\Response\Http\Interceptor))\n#2 /home/infiniar/public_html/vendor/magento/framework/
Interception/Interceptor.php(146): Magento\PageCache\Model\Controller\Result\BuiltinPlugin->afterRenderResult(Object(
Magento\Framework\View\Result\Page\Interceptor), Object(Magento\Framework\View\Result\Page\Interceptor), Object(
Magento\Framework\App\Response\Http\Interceptor))\n#3 /home/infiniar/public_html/vendor/magento/framework/
Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->
Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))\n#4 /home/infiniar/
public_html/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(26):
Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)\n#5 /home/infiniar/
public_html/vendor/magento/framework/App/Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(
Object(Magento\Framework\App\Response\Http\Interceptor))\n#6 /home/infiniar/public_html/vendor/magento/framework/App\
/Bootstrap.php(256): Magento\Framework\App\Http->launch()\n#7 /home/infiniar/public_html/index.php(39):
Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))\n#8 {main}","url":"/products/
computer-cases.html","script_name":"/index.php"}

Best Answer

From magento 2.2, Magento replaces usages of unserialize with json_decode.

http://devdocs.magento.com/guides/v2.2/release-notes/backward-incompatible-changes.html

If you using magento default cache system and your system is properly upgrade to 2.2 then if you will flush your cache storage database/Redis/memcache ,your issue will be resolve.

Either you have using any extensions which using serialize/Unserialize then you need data upgrade to new json format/

http://devdocs.magento.com/guides/v2.2/ext-best-practices/tutorials/serialized-to-json-data-upgrade.html

http://devdocs.magento.com/guides/v2.2/extension-dev-guide/framework/serializer.html

Related Topic