0

None of the solutions works:

Magento 2.2: Unable to unserialize value?

Magento 2.2 error: Unable to unserialize value

Navigating to a page of the category, localhost/magento/en/shop?p=3 My error as below:

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

Exception #0 (InvalidArgumentException): Unable to serialize value.
<pre>#1 Magento\Framework\App\PageCache\Kernel->process(&Magento\Framework\App\Response\Http\Interceptor#000000006184d2b80000000038bb4237#) called at [vendor/magento/module-page-cache/Model/Controller/Result/BuiltinPlugin.php:96]
#2 Magento\PageCache\Model\Controller\Result\BuiltinPlugin->afterRenderResult(&Magento\Framework\View\Result\Page\Interceptor#000000006184d61c0000000038bb4237#, &Magento\Framework\View\Result\Page\Interceptor#000000006184d61c0000000038bb4237#, &Magento\Framework\App\Response\Http\Interceptor#000000006184d2b80000000038bb4237#) called at [vendor/magento/framework/Interception/Interceptor.php:146]
#3 Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Response\Http\Interceptor#000000006184d2b80000000038bb4237#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#4 Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', array(&Magento\Framework\App\Response\Http\Interceptor#000000006184d2b80000000038bb4237#), array(array('result-messages', 'result-builtin-c...', 'result-varnish-c...'), array('meigeeCompoResul...'))) called at [generated/code/Magento/Framework/View/Result/Page/Interceptor.php:130]
#5 Magento\Framework\View\Result\Page\Interceptor->renderResult(&Magento\Framework\App\Response\Http\Interceptor#000000006184d2b80000000038bb4237#) called at [vendor/magento/framework/App/Http.php:140]
#6 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24]
#7 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:258]
#8 Magento\Framework\App\Bootstrap->run(&Magento\Framework\App\Http\Interceptor#000000006184d2ba0000000038bb4237#) called at [index.php:39]
</pre>

This page works fine in my server, but duplicate it under local environment shows this error. Why?

Edit: Note, /shop?p=2 and /shop?p=4 work, but /shop?p=3 shows this error

6
  • any custom code or extensions you have used? Jul 2, 2019 at 4:31
  • @RizwanKhan Ya, I have many extensions and custom code.
    – wltprgm
    Jul 2, 2019 at 7:11
  • You need to find serialize function in you all extension. and use \Magento\Framework\Serialize\Serializer\Json for serialize and deserialize methods. Jul 2, 2019 at 7:40
  • Wait, what's the reason behind this error? Why it happens in my local pc but not in the server?
    – wltprgm
    Jul 2, 2019 at 8:32
  • you have identical Magento setup on your local as server or is Magento version is different Jul 2, 2019 at 10:11

1 Answer 1

0

Solved by using utf8_encode() on the data retrieved from database.

Your Answer

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

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