Magento 2.2.1 Unable to serialize valueMagento 2.2.2 ERROR Unable to serialize valueError: Exception #0 (InvalidArgumentException): Unable to serialize value - Produced by custom ThemeMagento 2 : Item order details not showing after migration for old recordsdata: current version - none, required version - 2.0.0I created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?Unable to synchronized app import configuration failedTrying to uninstall moduleMagento 2 Front controller reached 100 router match iterations issueDeleted ShipperHQ module causing error in “All Customers” section of Magento 2Unable to Serialize Value Magento 2.2.6“Area code is not set” in var/logwhen click on place order then paypal showing error in Magento2magento error logs Error log record number: 1173359093956

Does the new finding on "reversing a quantum jump mid-flight" rule out any interpretations of QM?

Why am I Seeing A Weird "Notch" on the Data Line For Some Logical 1s?

How to trick the reader into thinking they're following a redshirt instead of the protagonist?

How to learn Linux system internals

Is using 'echo' to display attacker-controlled data on the terminal dangerous?

How can I make 12 tone and atonal melodies sound interesting?

Printing Pascal’s triangle for n number of rows in Python

Why did my credit score plummet after a balance transfer?

How to hide rifle during medieval town entrance inspection?

How to “listen” to existing circuit

Why am I getting a strange double quote (“) in Open Office instead of the ordinary one (")?

What aircraft was used as Air Force One for the flight between Southampton and Shannon?

What is the color of artificial intelligence?

Is there a set of positive integers of density 1 which contains no infinite arithmetic progression?

How can one's career as a reviewer be ended?

Origin of "boor"

Why does this query, missing a FROM clause, not error out?

Are polynomials with the same roots identical?

Non-aqueous eyes?

The Frozen Wastes

Why are MBA programs closing?

Can I utilise a baking stone to make crepes?

If there's something that implicates the president why is there then a national security issue? (John Dowd)

Why does ''cat "$1:-/dev/stdin | ... &>/dev/null'' work in bash but not dash?



Magento 2.2.1 Unable to serialize value


Magento 2.2.2 ERROR Unable to serialize valueError: Exception #0 (InvalidArgumentException): Unable to serialize value - Produced by custom ThemeMagento 2 : Item order details not showing after migration for old recordsdata: current version - none, required version - 2.0.0I created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?Unable to synchronized app import configuration failedTrying to uninstall moduleMagento 2 Front controller reached 100 router match iterations issueDeleted ShipperHQ module causing error in “All Customers” section of Magento 2Unable to Serialize Value Magento 2.2.6“Area code is not set” in var/logwhen click on place order then paypal showing error in Magento2magento error logs Error log record number: 1173359093956






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








10















I have upgraded website from 2.1.6 to 2.2.1 and facing Unable to serialize value error in frontend and backend.



"0":"Unable to serialize value.","1":"#0 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Translate.php(494): Magento\Framework\Serialize\Serializer\Json->serialize(Array)n
#1 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Translate.php(190): Magento\Framework\Translate->_saveCache()n
#2 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Area.php(244): Magento\Framework\Translate->loadData(NULL, false)n
#3 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Area.php(215): Magento\Framework\App\Area->_initTranslate()n
#4 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Area.php(142): Magento\Framework\App\Area->_loadPart('translate')n
#5 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/View/DesignLoader.php(55): Magento\Framework\App\Area->load('translate')n
#6 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Action/Plugin/Design.php(48): Magento\Framework\View\DesignLoader->load()n
#7 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(121): Magento\Framework\App\Action\Plugin\Design->beforeDispatch(Object(Magento\Cms\Controller\Index\Index\Interceptor), Object(Magento\Framework\App\Request\Http))n
#8 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Cms\Controller\Index\Index\Interceptor->Magento\Framework\Interception\closure(Object(Magento\Framework\App\Request\Http))n
#9 /var/www/vhosts/demo.com/eiselec/generated/code/Magento/Cms/Controller/Index/Index/Interceptor.php(39): Magento\Cms\Controller\Index\Index\Interceptor->___callPlugins('dispatch', Array, Array)n
#10 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/FrontController.php(55): Magento\Cms\Controller\Index\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))n
#11 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))n
#12 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)n
#13 /var/www/vhosts/demo.com/eiselec/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(94): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\closure(Object(Magento\Framework\App\Request\Http))n
#14 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))n
#15 /var/www/vhosts/demo.com/eiselec/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\closure(Object(Magento\Framework\App\Request\Http))n
#16 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))n
#17 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\closure(Object(Magento\Framework\App\Request\Http))n
#18 /var/www/vhosts/demo.com/eiselec/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, NULL)n
#19 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))n
#20 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()n
#21 /var/www/vhosts/demo.com/eiselec/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))n
#22 main","url":"/","script_name":"/index.php"


Let me know how can i resolve it.



Thanks










share|improve this question
























  • Hi, I am talking about serialize value not unseriaize value.

    – Meetanshi
    Nov 21 '17 at 6:19











  • Have you tried clearing the cache ? not only Magento cache, external caches too if any .

    – MGento
    Nov 21 '17 at 6:22











  • yes, i have tried.

    – Meetanshi
    Nov 21 '17 at 6:23











  • Can you try to find out, what data you are trying to serialize ? Try traversing through your third party modules and find out, from which module, this error is triggered. You may probably need to override the serialize function, in the file /vendor/magento/framework/Serialize/Serializer/Json.php

    – MGento
    Nov 21 '17 at 8:51











  • Is this error happening during the DB update or after you've updated the DB to 2.2.1?

    – drew7721
    Nov 24 '17 at 19:48

















10















I have upgraded website from 2.1.6 to 2.2.1 and facing Unable to serialize value error in frontend and backend.



"0":"Unable to serialize value.","1":"#0 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Translate.php(494): Magento\Framework\Serialize\Serializer\Json->serialize(Array)n
#1 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Translate.php(190): Magento\Framework\Translate->_saveCache()n
#2 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Area.php(244): Magento\Framework\Translate->loadData(NULL, false)n
#3 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Area.php(215): Magento\Framework\App\Area->_initTranslate()n
#4 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Area.php(142): Magento\Framework\App\Area->_loadPart('translate')n
#5 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/View/DesignLoader.php(55): Magento\Framework\App\Area->load('translate')n
#6 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Action/Plugin/Design.php(48): Magento\Framework\View\DesignLoader->load()n
#7 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(121): Magento\Framework\App\Action\Plugin\Design->beforeDispatch(Object(Magento\Cms\Controller\Index\Index\Interceptor), Object(Magento\Framework\App\Request\Http))n
#8 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Cms\Controller\Index\Index\Interceptor->Magento\Framework\Interception\closure(Object(Magento\Framework\App\Request\Http))n
#9 /var/www/vhosts/demo.com/eiselec/generated/code/Magento/Cms/Controller/Index/Index/Interceptor.php(39): Magento\Cms\Controller\Index\Index\Interceptor->___callPlugins('dispatch', Array, Array)n
#10 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/FrontController.php(55): Magento\Cms\Controller\Index\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))n
#11 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))n
#12 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)n
#13 /var/www/vhosts/demo.com/eiselec/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(94): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\closure(Object(Magento\Framework\App\Request\Http))n
#14 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))n
#15 /var/www/vhosts/demo.com/eiselec/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\closure(Object(Magento\Framework\App\Request\Http))n
#16 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))n
#17 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\closure(Object(Magento\Framework\App\Request\Http))n
#18 /var/www/vhosts/demo.com/eiselec/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, NULL)n
#19 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))n
#20 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()n
#21 /var/www/vhosts/demo.com/eiselec/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))n
#22 main","url":"/","script_name":"/index.php"


Let me know how can i resolve it.



Thanks










share|improve this question
























  • Hi, I am talking about serialize value not unseriaize value.

    – Meetanshi
    Nov 21 '17 at 6:19











  • Have you tried clearing the cache ? not only Magento cache, external caches too if any .

    – MGento
    Nov 21 '17 at 6:22











  • yes, i have tried.

    – Meetanshi
    Nov 21 '17 at 6:23











  • Can you try to find out, what data you are trying to serialize ? Try traversing through your third party modules and find out, from which module, this error is triggered. You may probably need to override the serialize function, in the file /vendor/magento/framework/Serialize/Serializer/Json.php

    – MGento
    Nov 21 '17 at 8:51











  • Is this error happening during the DB update or after you've updated the DB to 2.2.1?

    – drew7721
    Nov 24 '17 at 19:48













10












10








10


3






I have upgraded website from 2.1.6 to 2.2.1 and facing Unable to serialize value error in frontend and backend.



"0":"Unable to serialize value.","1":"#0 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Translate.php(494): Magento\Framework\Serialize\Serializer\Json->serialize(Array)n
#1 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Translate.php(190): Magento\Framework\Translate->_saveCache()n
#2 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Area.php(244): Magento\Framework\Translate->loadData(NULL, false)n
#3 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Area.php(215): Magento\Framework\App\Area->_initTranslate()n
#4 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Area.php(142): Magento\Framework\App\Area->_loadPart('translate')n
#5 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/View/DesignLoader.php(55): Magento\Framework\App\Area->load('translate')n
#6 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Action/Plugin/Design.php(48): Magento\Framework\View\DesignLoader->load()n
#7 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(121): Magento\Framework\App\Action\Plugin\Design->beforeDispatch(Object(Magento\Cms\Controller\Index\Index\Interceptor), Object(Magento\Framework\App\Request\Http))n
#8 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Cms\Controller\Index\Index\Interceptor->Magento\Framework\Interception\closure(Object(Magento\Framework\App\Request\Http))n
#9 /var/www/vhosts/demo.com/eiselec/generated/code/Magento/Cms/Controller/Index/Index/Interceptor.php(39): Magento\Cms\Controller\Index\Index\Interceptor->___callPlugins('dispatch', Array, Array)n
#10 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/FrontController.php(55): Magento\Cms\Controller\Index\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))n
#11 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))n
#12 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)n
#13 /var/www/vhosts/demo.com/eiselec/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(94): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\closure(Object(Magento\Framework\App\Request\Http))n
#14 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))n
#15 /var/www/vhosts/demo.com/eiselec/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\closure(Object(Magento\Framework\App\Request\Http))n
#16 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))n
#17 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\closure(Object(Magento\Framework\App\Request\Http))n
#18 /var/www/vhosts/demo.com/eiselec/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, NULL)n
#19 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))n
#20 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()n
#21 /var/www/vhosts/demo.com/eiselec/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))n
#22 main","url":"/","script_name":"/index.php"


Let me know how can i resolve it.



Thanks










share|improve this question
















I have upgraded website from 2.1.6 to 2.2.1 and facing Unable to serialize value error in frontend and backend.



"0":"Unable to serialize value.","1":"#0 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Translate.php(494): Magento\Framework\Serialize\Serializer\Json->serialize(Array)n
#1 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Translate.php(190): Magento\Framework\Translate->_saveCache()n
#2 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Area.php(244): Magento\Framework\Translate->loadData(NULL, false)n
#3 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Area.php(215): Magento\Framework\App\Area->_initTranslate()n
#4 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Area.php(142): Magento\Framework\App\Area->_loadPart('translate')n
#5 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/View/DesignLoader.php(55): Magento\Framework\App\Area->load('translate')n
#6 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Action/Plugin/Design.php(48): Magento\Framework\View\DesignLoader->load()n
#7 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(121): Magento\Framework\App\Action\Plugin\Design->beforeDispatch(Object(Magento\Cms\Controller\Index\Index\Interceptor), Object(Magento\Framework\App\Request\Http))n
#8 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Cms\Controller\Index\Index\Interceptor->Magento\Framework\Interception\closure(Object(Magento\Framework\App\Request\Http))n
#9 /var/www/vhosts/demo.com/eiselec/generated/code/Magento/Cms/Controller/Index/Index/Interceptor.php(39): Magento\Cms\Controller\Index\Index\Interceptor->___callPlugins('dispatch', Array, Array)n
#10 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/FrontController.php(55): Magento\Cms\Controller\Index\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))n
#11 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))n
#12 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)n
#13 /var/www/vhosts/demo.com/eiselec/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(94): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\closure(Object(Magento\Framework\App\Request\Http))n
#14 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))n
#15 /var/www/vhosts/demo.com/eiselec/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\closure(Object(Magento\Framework\App\Request\Http))n
#16 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))n
#17 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\closure(Object(Magento\Framework\App\Request\Http))n
#18 /var/www/vhosts/demo.com/eiselec/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, NULL)n
#19 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))n
#20 /var/www/vhosts/demo.com/eiselec/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()n
#21 /var/www/vhosts/demo.com/eiselec/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))n
#22 main","url":"/","script_name":"/index.php"


Let me know how can i resolve it.



Thanks







magento2 upgrade






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 24 '17 at 21:43









KAndy

16.4k23446




16.4k23446










asked Nov 21 '17 at 6:07









MeetanshiMeetanshi

7301321




7301321












  • Hi, I am talking about serialize value not unseriaize value.

    – Meetanshi
    Nov 21 '17 at 6:19











  • Have you tried clearing the cache ? not only Magento cache, external caches too if any .

    – MGento
    Nov 21 '17 at 6:22











  • yes, i have tried.

    – Meetanshi
    Nov 21 '17 at 6:23











  • Can you try to find out, what data you are trying to serialize ? Try traversing through your third party modules and find out, from which module, this error is triggered. You may probably need to override the serialize function, in the file /vendor/magento/framework/Serialize/Serializer/Json.php

    – MGento
    Nov 21 '17 at 8:51











  • Is this error happening during the DB update or after you've updated the DB to 2.2.1?

    – drew7721
    Nov 24 '17 at 19:48

















  • Hi, I am talking about serialize value not unseriaize value.

    – Meetanshi
    Nov 21 '17 at 6:19











  • Have you tried clearing the cache ? not only Magento cache, external caches too if any .

    – MGento
    Nov 21 '17 at 6:22











  • yes, i have tried.

    – Meetanshi
    Nov 21 '17 at 6:23











  • Can you try to find out, what data you are trying to serialize ? Try traversing through your third party modules and find out, from which module, this error is triggered. You may probably need to override the serialize function, in the file /vendor/magento/framework/Serialize/Serializer/Json.php

    – MGento
    Nov 21 '17 at 8:51











  • Is this error happening during the DB update or after you've updated the DB to 2.2.1?

    – drew7721
    Nov 24 '17 at 19:48
















Hi, I am talking about serialize value not unseriaize value.

– Meetanshi
Nov 21 '17 at 6:19





Hi, I am talking about serialize value not unseriaize value.

– Meetanshi
Nov 21 '17 at 6:19













Have you tried clearing the cache ? not only Magento cache, external caches too if any .

– MGento
Nov 21 '17 at 6:22





Have you tried clearing the cache ? not only Magento cache, external caches too if any .

– MGento
Nov 21 '17 at 6:22













yes, i have tried.

– Meetanshi
Nov 21 '17 at 6:23





yes, i have tried.

– Meetanshi
Nov 21 '17 at 6:23













Can you try to find out, what data you are trying to serialize ? Try traversing through your third party modules and find out, from which module, this error is triggered. You may probably need to override the serialize function, in the file /vendor/magento/framework/Serialize/Serializer/Json.php

– MGento
Nov 21 '17 at 8:51





Can you try to find out, what data you are trying to serialize ? Try traversing through your third party modules and find out, from which module, this error is triggered. You may probably need to override the serialize function, in the file /vendor/magento/framework/Serialize/Serializer/Json.php

– MGento
Nov 21 '17 at 8:51













Is this error happening during the DB update or after you've updated the DB to 2.2.1?

– drew7721
Nov 24 '17 at 19:48





Is this error happening during the DB update or after you've updated the DB to 2.2.1?

– drew7721
Nov 24 '17 at 19:48










7 Answers
7






active

oldest

votes


















3














i have the same behaviour with an template. I copied the code for the error to my serializer to get my problem.



As soon as i switch to de_DE and regenerate my static code via



sudo php bin/magento setup:static-content:deploy de_DE --jobs=0 -f


it throws "Malformed UTF-8 characters, possibly incorrectly encoded".



So i looked up the files i changed in the template folder (i.e. code/Mytheme/Bannerslider/i18n/de_DE.csv) and downloaded them via WinSCP. Notepad++ showed "Ansii Encoding" - hard it i used "magento i18n:collect-phrases" for the translation file to create.



magento2dev # encguess app/code/MyTheme/Bannerslider/i18n/de_DE.csv


app/code/MyTheme/Bannerslider/i18n/de_DE.csv US-ASCII



magento2dev # locale
LANG=de_DE.UTF-8
......


So i changed the files manually in Notepad++, uploaded them, deployed the static content and reset all permissions - en voila it works.



So, the bug could be in your i18n csv file.






share|improve this answer
































    10





    +25









    As I can see this error comes from the method:



    /**
    * Saving data cache
    *
    * @return $this
    */
    protected function _saveCache()

    $this->_cache->save($this->getSerializer()->serialize($this->getData()), $this->getCacheId(true), [], false);
    return $this;



    and serializer which is not found comes from the method:



    /**
    * Get serializer
    *
    * @return MagentoFrameworkSerializeSerializerInterface
    * @deprecated 100.2.0
    */
    private function getSerializer()

    if ($this->serializer === null)
    $this->serializer = MagentoFrameworkAppObjectManager::getInstance()
    ->get(SerializeSerializerInterface::class);

    return $this->serializer;



    The preference for the SerializerInterface was added since 2.2.x version of the Magento, and declared in the app/etc/di.xml:



    <preference for="MagentoFrameworkSerializeSerializerInterface" type="MagentoFrameworkSerializeSerializerJson" />


    So I think your cache is old or the preference for the SerializerInterface is not working. Try to debug this issue by calling the MagentoFrameworkSerializeSerializerInterface (using dependency injection) somwhere in code, and check which class returned by di:



    public function __construct(MagentoFrameworkSerializeSerializerInterface $serializer) 

    echo get_class($serializer);



    If it returns not an instance of the MagentoFrameworkSerializeSerializerJson class returned - try to search this overwritten preference in the project and remove it.



    If you are working on the remote server - firstly check the app/etc/di.xml file on the server directly.



    Another way you can temporarly modify the core Json serializer and check which error returned:



    Open the magento/framework/Serialize/Serializer/Json.php and change this method from:



    /**
    * @inheritDoc
    * @since 100.2.0
    */
    public function serialize($data)

    $result = json_encode($data);
    if (false === $result)
    throw new InvalidArgumentException('Unable to serialize value.');

    return $result;



    to:



    /**
    * @inheritDoc
    * @since 100.2.0
    */
    public function serialize($data)

    $result = json_encode($data);
    if (false === $result)
    switch (json_last_error())
    case JSON_ERROR_NONE:
    $error = ' - No errors';
    break;
    case JSON_ERROR_DEPTH:
    $error = ' - Maximum stack depth exceeded';
    break;
    case JSON_ERROR_STATE_MISMATCH:
    $error = ' - Underflow or the modes mismatch';
    break;
    case JSON_ERROR_CTRL_CHAR:
    $error = ' - Unexpected control character found';
    break;
    case JSON_ERROR_SYNTAX:
    $error = ' - Syntax error, malformed JSON';
    break;
    case JSON_ERROR_UTF8:
    $error = ' - Malformed UTF-8 characters, possibly incorrectly encoded';
    break;
    default:
    $error = ' - Unknown error';
    break;

    throw new InvalidArgumentException('Unable to serialize value. Error: ' . $error);


    return $result;



    Then you can see after the exception message a json error. May be your data is broken. keep in mind that all the old data should be unserialized and serialized using json in the setup upgrade scripts during magento update.



    PS: do not forget to revert back the core files after debugging complete! The better way is use xDebug for that purpose.






    share|improve this answer


















    • 1





      You should make that debugger-helper a core patch -- or suggest they use SAFE PHP github.com/thecodingmachine/safe

      – Alex
      Dec 11 '18 at 12:37


















    1














    I've ran in the same issue with the upgrade to 2.2.1. I found this articel to be very helpful
    http://devdocs.magento.com/guides/v2.2/ext-best-practices/tutorials/serialized-to-json-data-upgrade.html



    Data stored in the DB should not be serialized anymore, it should now be saved as a JSON object.



    Most modules make a data update that unserializes the data in the DB and stores it again under a JSON format. (BTW It took quite a while to run this...)



    Hence, if one of your modules saves data that is serialized in the DB that data might not be readable by Magento anymore, you will need to make a data upgrade Setup file. Also, it might be a 3rd party module that needs to be updated to a 2.2+ compatible version.



    If you do serialize on unserialize data anywhere in your code you might have to change that as well.



    I hope this gives you a better insight at what's causing this error.



    Cheers!






    share|improve this answer























    • Make sure to read the Release Notes for 2.2.1, lots has changed, including the path for the generation folder. ;)

      – drew7721
      Nov 24 '17 at 19:58


















    1














    I ended up to exactly to the same situation. After adding the code above I got "Malformed UTF-8 characters, possibly incorrectly encoded"



    I suppose that you are not using the default language. Try to change language to "default" en_US.



    Meetanshi - Which language you are using in front-end and is the static-content creation also failing?






    share|improve this answer























    • Hi @A.P, I am facing the same error and i am using de_DE language.

      – Meetanshi
      Dec 3 '17 at 10:28












    • Try change to en_US. Table core_config_data (general/locale/code) to en_US

      – A.P
      Dec 3 '17 at 10:45












    • same error after changing to en_US.

      – Meetanshi
      Dec 3 '17 at 10:54











    • I managed to get it up, but dead-end when trying get back to fi_FI. Did you cleared the cache?

      – A.P
      Dec 3 '17 at 11:02











    • yes, i cleared cache

      – Meetanshi
      Dec 3 '17 at 11:03


















    0














    In my case the cause to a UTF8 Encoding problem, was non-multibyte safe shortening of product names:



    $productName = strlen($productName) > 60 ? substr($productName,0,60)."..." : 
    $productName;


    So a



    012345678901234567890123456789012345678901234567890123456 Außengewinde 


    became



    012345678901234567890123456789012345678901234567890123456 Au�...





    share|improve this answer
































      0














      For me the solution was to replace all special characters like "ä" in the translation csv file with html versions of the same character like this:



      &auml;


      Then I cleared caches and reloaded frontend.






      share|improve this answer






























        0














        Be careful with substr function. It does not support UTF-8. And this can break the FPC. Use mb_substr






        share|improve this answer























          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f202448%2fmagento-2-2-1-unable-to-serialize-value%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          7 Answers
          7






          active

          oldest

          votes








          7 Answers
          7






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          i have the same behaviour with an template. I copied the code for the error to my serializer to get my problem.



          As soon as i switch to de_DE and regenerate my static code via



          sudo php bin/magento setup:static-content:deploy de_DE --jobs=0 -f


          it throws "Malformed UTF-8 characters, possibly incorrectly encoded".



          So i looked up the files i changed in the template folder (i.e. code/Mytheme/Bannerslider/i18n/de_DE.csv) and downloaded them via WinSCP. Notepad++ showed "Ansii Encoding" - hard it i used "magento i18n:collect-phrases" for the translation file to create.



          magento2dev # encguess app/code/MyTheme/Bannerslider/i18n/de_DE.csv


          app/code/MyTheme/Bannerslider/i18n/de_DE.csv US-ASCII



          magento2dev # locale
          LANG=de_DE.UTF-8
          ......


          So i changed the files manually in Notepad++, uploaded them, deployed the static content and reset all permissions - en voila it works.



          So, the bug could be in your i18n csv file.






          share|improve this answer





























            3














            i have the same behaviour with an template. I copied the code for the error to my serializer to get my problem.



            As soon as i switch to de_DE and regenerate my static code via



            sudo php bin/magento setup:static-content:deploy de_DE --jobs=0 -f


            it throws "Malformed UTF-8 characters, possibly incorrectly encoded".



            So i looked up the files i changed in the template folder (i.e. code/Mytheme/Bannerslider/i18n/de_DE.csv) and downloaded them via WinSCP. Notepad++ showed "Ansii Encoding" - hard it i used "magento i18n:collect-phrases" for the translation file to create.



            magento2dev # encguess app/code/MyTheme/Bannerslider/i18n/de_DE.csv


            app/code/MyTheme/Bannerslider/i18n/de_DE.csv US-ASCII



            magento2dev # locale
            LANG=de_DE.UTF-8
            ......


            So i changed the files manually in Notepad++, uploaded them, deployed the static content and reset all permissions - en voila it works.



            So, the bug could be in your i18n csv file.






            share|improve this answer



























              3












              3








              3







              i have the same behaviour with an template. I copied the code for the error to my serializer to get my problem.



              As soon as i switch to de_DE and regenerate my static code via



              sudo php bin/magento setup:static-content:deploy de_DE --jobs=0 -f


              it throws "Malformed UTF-8 characters, possibly incorrectly encoded".



              So i looked up the files i changed in the template folder (i.e. code/Mytheme/Bannerslider/i18n/de_DE.csv) and downloaded them via WinSCP. Notepad++ showed "Ansii Encoding" - hard it i used "magento i18n:collect-phrases" for the translation file to create.



              magento2dev # encguess app/code/MyTheme/Bannerslider/i18n/de_DE.csv


              app/code/MyTheme/Bannerslider/i18n/de_DE.csv US-ASCII



              magento2dev # locale
              LANG=de_DE.UTF-8
              ......


              So i changed the files manually in Notepad++, uploaded them, deployed the static content and reset all permissions - en voila it works.



              So, the bug could be in your i18n csv file.






              share|improve this answer















              i have the same behaviour with an template. I copied the code for the error to my serializer to get my problem.



              As soon as i switch to de_DE and regenerate my static code via



              sudo php bin/magento setup:static-content:deploy de_DE --jobs=0 -f


              it throws "Malformed UTF-8 characters, possibly incorrectly encoded".



              So i looked up the files i changed in the template folder (i.e. code/Mytheme/Bannerslider/i18n/de_DE.csv) and downloaded them via WinSCP. Notepad++ showed "Ansii Encoding" - hard it i used "magento i18n:collect-phrases" for the translation file to create.



              magento2dev # encguess app/code/MyTheme/Bannerslider/i18n/de_DE.csv


              app/code/MyTheme/Bannerslider/i18n/de_DE.csv US-ASCII



              magento2dev # locale
              LANG=de_DE.UTF-8
              ......


              So i changed the files manually in Notepad++, uploaded them, deployed the static content and reset all permissions - en voila it works.



              So, the bug could be in your i18n csv file.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Jul 2 '18 at 10:34









              Teja Bhagavan Kollepara

              2,92742051




              2,92742051










              answered Dec 7 '17 at 15:50









              Lord_PinheadLord_Pinhead

              461




              461























                  10





                  +25









                  As I can see this error comes from the method:



                  /**
                  * Saving data cache
                  *
                  * @return $this
                  */
                  protected function _saveCache()

                  $this->_cache->save($this->getSerializer()->serialize($this->getData()), $this->getCacheId(true), [], false);
                  return $this;



                  and serializer which is not found comes from the method:



                  /**
                  * Get serializer
                  *
                  * @return MagentoFrameworkSerializeSerializerInterface
                  * @deprecated 100.2.0
                  */
                  private function getSerializer()

                  if ($this->serializer === null)
                  $this->serializer = MagentoFrameworkAppObjectManager::getInstance()
                  ->get(SerializeSerializerInterface::class);

                  return $this->serializer;



                  The preference for the SerializerInterface was added since 2.2.x version of the Magento, and declared in the app/etc/di.xml:



                  <preference for="MagentoFrameworkSerializeSerializerInterface" type="MagentoFrameworkSerializeSerializerJson" />


                  So I think your cache is old or the preference for the SerializerInterface is not working. Try to debug this issue by calling the MagentoFrameworkSerializeSerializerInterface (using dependency injection) somwhere in code, and check which class returned by di:



                  public function __construct(MagentoFrameworkSerializeSerializerInterface $serializer) 

                  echo get_class($serializer);



                  If it returns not an instance of the MagentoFrameworkSerializeSerializerJson class returned - try to search this overwritten preference in the project and remove it.



                  If you are working on the remote server - firstly check the app/etc/di.xml file on the server directly.



                  Another way you can temporarly modify the core Json serializer and check which error returned:



                  Open the magento/framework/Serialize/Serializer/Json.php and change this method from:



                  /**
                  * @inheritDoc
                  * @since 100.2.0
                  */
                  public function serialize($data)

                  $result = json_encode($data);
                  if (false === $result)
                  throw new InvalidArgumentException('Unable to serialize value.');

                  return $result;



                  to:



                  /**
                  * @inheritDoc
                  * @since 100.2.0
                  */
                  public function serialize($data)

                  $result = json_encode($data);
                  if (false === $result)
                  switch (json_last_error())
                  case JSON_ERROR_NONE:
                  $error = ' - No errors';
                  break;
                  case JSON_ERROR_DEPTH:
                  $error = ' - Maximum stack depth exceeded';
                  break;
                  case JSON_ERROR_STATE_MISMATCH:
                  $error = ' - Underflow or the modes mismatch';
                  break;
                  case JSON_ERROR_CTRL_CHAR:
                  $error = ' - Unexpected control character found';
                  break;
                  case JSON_ERROR_SYNTAX:
                  $error = ' - Syntax error, malformed JSON';
                  break;
                  case JSON_ERROR_UTF8:
                  $error = ' - Malformed UTF-8 characters, possibly incorrectly encoded';
                  break;
                  default:
                  $error = ' - Unknown error';
                  break;

                  throw new InvalidArgumentException('Unable to serialize value. Error: ' . $error);


                  return $result;



                  Then you can see after the exception message a json error. May be your data is broken. keep in mind that all the old data should be unserialized and serialized using json in the setup upgrade scripts during magento update.



                  PS: do not forget to revert back the core files after debugging complete! The better way is use xDebug for that purpose.






                  share|improve this answer


















                  • 1





                    You should make that debugger-helper a core patch -- or suggest they use SAFE PHP github.com/thecodingmachine/safe

                    – Alex
                    Dec 11 '18 at 12:37















                  10





                  +25









                  As I can see this error comes from the method:



                  /**
                  * Saving data cache
                  *
                  * @return $this
                  */
                  protected function _saveCache()

                  $this->_cache->save($this->getSerializer()->serialize($this->getData()), $this->getCacheId(true), [], false);
                  return $this;



                  and serializer which is not found comes from the method:



                  /**
                  * Get serializer
                  *
                  * @return MagentoFrameworkSerializeSerializerInterface
                  * @deprecated 100.2.0
                  */
                  private function getSerializer()

                  if ($this->serializer === null)
                  $this->serializer = MagentoFrameworkAppObjectManager::getInstance()
                  ->get(SerializeSerializerInterface::class);

                  return $this->serializer;



                  The preference for the SerializerInterface was added since 2.2.x version of the Magento, and declared in the app/etc/di.xml:



                  <preference for="MagentoFrameworkSerializeSerializerInterface" type="MagentoFrameworkSerializeSerializerJson" />


                  So I think your cache is old or the preference for the SerializerInterface is not working. Try to debug this issue by calling the MagentoFrameworkSerializeSerializerInterface (using dependency injection) somwhere in code, and check which class returned by di:



                  public function __construct(MagentoFrameworkSerializeSerializerInterface $serializer) 

                  echo get_class($serializer);



                  If it returns not an instance of the MagentoFrameworkSerializeSerializerJson class returned - try to search this overwritten preference in the project and remove it.



                  If you are working on the remote server - firstly check the app/etc/di.xml file on the server directly.



                  Another way you can temporarly modify the core Json serializer and check which error returned:



                  Open the magento/framework/Serialize/Serializer/Json.php and change this method from:



                  /**
                  * @inheritDoc
                  * @since 100.2.0
                  */
                  public function serialize($data)

                  $result = json_encode($data);
                  if (false === $result)
                  throw new InvalidArgumentException('Unable to serialize value.');

                  return $result;



                  to:



                  /**
                  * @inheritDoc
                  * @since 100.2.0
                  */
                  public function serialize($data)

                  $result = json_encode($data);
                  if (false === $result)
                  switch (json_last_error())
                  case JSON_ERROR_NONE:
                  $error = ' - No errors';
                  break;
                  case JSON_ERROR_DEPTH:
                  $error = ' - Maximum stack depth exceeded';
                  break;
                  case JSON_ERROR_STATE_MISMATCH:
                  $error = ' - Underflow or the modes mismatch';
                  break;
                  case JSON_ERROR_CTRL_CHAR:
                  $error = ' - Unexpected control character found';
                  break;
                  case JSON_ERROR_SYNTAX:
                  $error = ' - Syntax error, malformed JSON';
                  break;
                  case JSON_ERROR_UTF8:
                  $error = ' - Malformed UTF-8 characters, possibly incorrectly encoded';
                  break;
                  default:
                  $error = ' - Unknown error';
                  break;

                  throw new InvalidArgumentException('Unable to serialize value. Error: ' . $error);


                  return $result;



                  Then you can see after the exception message a json error. May be your data is broken. keep in mind that all the old data should be unserialized and serialized using json in the setup upgrade scripts during magento update.



                  PS: do not forget to revert back the core files after debugging complete! The better way is use xDebug for that purpose.






                  share|improve this answer


















                  • 1





                    You should make that debugger-helper a core patch -- or suggest they use SAFE PHP github.com/thecodingmachine/safe

                    – Alex
                    Dec 11 '18 at 12:37













                  10





                  +25







                  10





                  +25



                  10




                  +25





                  As I can see this error comes from the method:



                  /**
                  * Saving data cache
                  *
                  * @return $this
                  */
                  protected function _saveCache()

                  $this->_cache->save($this->getSerializer()->serialize($this->getData()), $this->getCacheId(true), [], false);
                  return $this;



                  and serializer which is not found comes from the method:



                  /**
                  * Get serializer
                  *
                  * @return MagentoFrameworkSerializeSerializerInterface
                  * @deprecated 100.2.0
                  */
                  private function getSerializer()

                  if ($this->serializer === null)
                  $this->serializer = MagentoFrameworkAppObjectManager::getInstance()
                  ->get(SerializeSerializerInterface::class);

                  return $this->serializer;



                  The preference for the SerializerInterface was added since 2.2.x version of the Magento, and declared in the app/etc/di.xml:



                  <preference for="MagentoFrameworkSerializeSerializerInterface" type="MagentoFrameworkSerializeSerializerJson" />


                  So I think your cache is old or the preference for the SerializerInterface is not working. Try to debug this issue by calling the MagentoFrameworkSerializeSerializerInterface (using dependency injection) somwhere in code, and check which class returned by di:



                  public function __construct(MagentoFrameworkSerializeSerializerInterface $serializer) 

                  echo get_class($serializer);



                  If it returns not an instance of the MagentoFrameworkSerializeSerializerJson class returned - try to search this overwritten preference in the project and remove it.



                  If you are working on the remote server - firstly check the app/etc/di.xml file on the server directly.



                  Another way you can temporarly modify the core Json serializer and check which error returned:



                  Open the magento/framework/Serialize/Serializer/Json.php and change this method from:



                  /**
                  * @inheritDoc
                  * @since 100.2.0
                  */
                  public function serialize($data)

                  $result = json_encode($data);
                  if (false === $result)
                  throw new InvalidArgumentException('Unable to serialize value.');

                  return $result;



                  to:



                  /**
                  * @inheritDoc
                  * @since 100.2.0
                  */
                  public function serialize($data)

                  $result = json_encode($data);
                  if (false === $result)
                  switch (json_last_error())
                  case JSON_ERROR_NONE:
                  $error = ' - No errors';
                  break;
                  case JSON_ERROR_DEPTH:
                  $error = ' - Maximum stack depth exceeded';
                  break;
                  case JSON_ERROR_STATE_MISMATCH:
                  $error = ' - Underflow or the modes mismatch';
                  break;
                  case JSON_ERROR_CTRL_CHAR:
                  $error = ' - Unexpected control character found';
                  break;
                  case JSON_ERROR_SYNTAX:
                  $error = ' - Syntax error, malformed JSON';
                  break;
                  case JSON_ERROR_UTF8:
                  $error = ' - Malformed UTF-8 characters, possibly incorrectly encoded';
                  break;
                  default:
                  $error = ' - Unknown error';
                  break;

                  throw new InvalidArgumentException('Unable to serialize value. Error: ' . $error);


                  return $result;



                  Then you can see after the exception message a json error. May be your data is broken. keep in mind that all the old data should be unserialized and serialized using json in the setup upgrade scripts during magento update.



                  PS: do not forget to revert back the core files after debugging complete! The better way is use xDebug for that purpose.






                  share|improve this answer













                  As I can see this error comes from the method:



                  /**
                  * Saving data cache
                  *
                  * @return $this
                  */
                  protected function _saveCache()

                  $this->_cache->save($this->getSerializer()->serialize($this->getData()), $this->getCacheId(true), [], false);
                  return $this;



                  and serializer which is not found comes from the method:



                  /**
                  * Get serializer
                  *
                  * @return MagentoFrameworkSerializeSerializerInterface
                  * @deprecated 100.2.0
                  */
                  private function getSerializer()

                  if ($this->serializer === null)
                  $this->serializer = MagentoFrameworkAppObjectManager::getInstance()
                  ->get(SerializeSerializerInterface::class);

                  return $this->serializer;



                  The preference for the SerializerInterface was added since 2.2.x version of the Magento, and declared in the app/etc/di.xml:



                  <preference for="MagentoFrameworkSerializeSerializerInterface" type="MagentoFrameworkSerializeSerializerJson" />


                  So I think your cache is old or the preference for the SerializerInterface is not working. Try to debug this issue by calling the MagentoFrameworkSerializeSerializerInterface (using dependency injection) somwhere in code, and check which class returned by di:



                  public function __construct(MagentoFrameworkSerializeSerializerInterface $serializer) 

                  echo get_class($serializer);



                  If it returns not an instance of the MagentoFrameworkSerializeSerializerJson class returned - try to search this overwritten preference in the project and remove it.



                  If you are working on the remote server - firstly check the app/etc/di.xml file on the server directly.



                  Another way you can temporarly modify the core Json serializer and check which error returned:



                  Open the magento/framework/Serialize/Serializer/Json.php and change this method from:



                  /**
                  * @inheritDoc
                  * @since 100.2.0
                  */
                  public function serialize($data)

                  $result = json_encode($data);
                  if (false === $result)
                  throw new InvalidArgumentException('Unable to serialize value.');

                  return $result;



                  to:



                  /**
                  * @inheritDoc
                  * @since 100.2.0
                  */
                  public function serialize($data)

                  $result = json_encode($data);
                  if (false === $result)
                  switch (json_last_error())
                  case JSON_ERROR_NONE:
                  $error = ' - No errors';
                  break;
                  case JSON_ERROR_DEPTH:
                  $error = ' - Maximum stack depth exceeded';
                  break;
                  case JSON_ERROR_STATE_MISMATCH:
                  $error = ' - Underflow or the modes mismatch';
                  break;
                  case JSON_ERROR_CTRL_CHAR:
                  $error = ' - Unexpected control character found';
                  break;
                  case JSON_ERROR_SYNTAX:
                  $error = ' - Syntax error, malformed JSON';
                  break;
                  case JSON_ERROR_UTF8:
                  $error = ' - Malformed UTF-8 characters, possibly incorrectly encoded';
                  break;
                  default:
                  $error = ' - Unknown error';
                  break;

                  throw new InvalidArgumentException('Unable to serialize value. Error: ' . $error);


                  return $result;



                  Then you can see after the exception message a json error. May be your data is broken. keep in mind that all the old data should be unserialized and serialized using json in the setup upgrade scripts during magento update.



                  PS: do not forget to revert back the core files after debugging complete! The better way is use xDebug for that purpose.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 24 '17 at 10:00









                  Siarhey UchukhlebauSiarhey Uchukhlebau

                  10.3k93159




                  10.3k93159







                  • 1





                    You should make that debugger-helper a core patch -- or suggest they use SAFE PHP github.com/thecodingmachine/safe

                    – Alex
                    Dec 11 '18 at 12:37












                  • 1





                    You should make that debugger-helper a core patch -- or suggest they use SAFE PHP github.com/thecodingmachine/safe

                    – Alex
                    Dec 11 '18 at 12:37







                  1




                  1





                  You should make that debugger-helper a core patch -- or suggest they use SAFE PHP github.com/thecodingmachine/safe

                  – Alex
                  Dec 11 '18 at 12:37





                  You should make that debugger-helper a core patch -- or suggest they use SAFE PHP github.com/thecodingmachine/safe

                  – Alex
                  Dec 11 '18 at 12:37











                  1














                  I've ran in the same issue with the upgrade to 2.2.1. I found this articel to be very helpful
                  http://devdocs.magento.com/guides/v2.2/ext-best-practices/tutorials/serialized-to-json-data-upgrade.html



                  Data stored in the DB should not be serialized anymore, it should now be saved as a JSON object.



                  Most modules make a data update that unserializes the data in the DB and stores it again under a JSON format. (BTW It took quite a while to run this...)



                  Hence, if one of your modules saves data that is serialized in the DB that data might not be readable by Magento anymore, you will need to make a data upgrade Setup file. Also, it might be a 3rd party module that needs to be updated to a 2.2+ compatible version.



                  If you do serialize on unserialize data anywhere in your code you might have to change that as well.



                  I hope this gives you a better insight at what's causing this error.



                  Cheers!






                  share|improve this answer























                  • Make sure to read the Release Notes for 2.2.1, lots has changed, including the path for the generation folder. ;)

                    – drew7721
                    Nov 24 '17 at 19:58















                  1














                  I've ran in the same issue with the upgrade to 2.2.1. I found this articel to be very helpful
                  http://devdocs.magento.com/guides/v2.2/ext-best-practices/tutorials/serialized-to-json-data-upgrade.html



                  Data stored in the DB should not be serialized anymore, it should now be saved as a JSON object.



                  Most modules make a data update that unserializes the data in the DB and stores it again under a JSON format. (BTW It took quite a while to run this...)



                  Hence, if one of your modules saves data that is serialized in the DB that data might not be readable by Magento anymore, you will need to make a data upgrade Setup file. Also, it might be a 3rd party module that needs to be updated to a 2.2+ compatible version.



                  If you do serialize on unserialize data anywhere in your code you might have to change that as well.



                  I hope this gives you a better insight at what's causing this error.



                  Cheers!






                  share|improve this answer























                  • Make sure to read the Release Notes for 2.2.1, lots has changed, including the path for the generation folder. ;)

                    – drew7721
                    Nov 24 '17 at 19:58













                  1












                  1








                  1







                  I've ran in the same issue with the upgrade to 2.2.1. I found this articel to be very helpful
                  http://devdocs.magento.com/guides/v2.2/ext-best-practices/tutorials/serialized-to-json-data-upgrade.html



                  Data stored in the DB should not be serialized anymore, it should now be saved as a JSON object.



                  Most modules make a data update that unserializes the data in the DB and stores it again under a JSON format. (BTW It took quite a while to run this...)



                  Hence, if one of your modules saves data that is serialized in the DB that data might not be readable by Magento anymore, you will need to make a data upgrade Setup file. Also, it might be a 3rd party module that needs to be updated to a 2.2+ compatible version.



                  If you do serialize on unserialize data anywhere in your code you might have to change that as well.



                  I hope this gives you a better insight at what's causing this error.



                  Cheers!






                  share|improve this answer













                  I've ran in the same issue with the upgrade to 2.2.1. I found this articel to be very helpful
                  http://devdocs.magento.com/guides/v2.2/ext-best-practices/tutorials/serialized-to-json-data-upgrade.html



                  Data stored in the DB should not be serialized anymore, it should now be saved as a JSON object.



                  Most modules make a data update that unserializes the data in the DB and stores it again under a JSON format. (BTW It took quite a while to run this...)



                  Hence, if one of your modules saves data that is serialized in the DB that data might not be readable by Magento anymore, you will need to make a data upgrade Setup file. Also, it might be a 3rd party module that needs to be updated to a 2.2+ compatible version.



                  If you do serialize on unserialize data anywhere in your code you might have to change that as well.



                  I hope this gives you a better insight at what's causing this error.



                  Cheers!







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 24 '17 at 19:57









                  drew7721drew7721

                  468311




                  468311












                  • Make sure to read the Release Notes for 2.2.1, lots has changed, including the path for the generation folder. ;)

                    – drew7721
                    Nov 24 '17 at 19:58

















                  • Make sure to read the Release Notes for 2.2.1, lots has changed, including the path for the generation folder. ;)

                    – drew7721
                    Nov 24 '17 at 19:58
















                  Make sure to read the Release Notes for 2.2.1, lots has changed, including the path for the generation folder. ;)

                  – drew7721
                  Nov 24 '17 at 19:58





                  Make sure to read the Release Notes for 2.2.1, lots has changed, including the path for the generation folder. ;)

                  – drew7721
                  Nov 24 '17 at 19:58











                  1














                  I ended up to exactly to the same situation. After adding the code above I got "Malformed UTF-8 characters, possibly incorrectly encoded"



                  I suppose that you are not using the default language. Try to change language to "default" en_US.



                  Meetanshi - Which language you are using in front-end and is the static-content creation also failing?






                  share|improve this answer























                  • Hi @A.P, I am facing the same error and i am using de_DE language.

                    – Meetanshi
                    Dec 3 '17 at 10:28












                  • Try change to en_US. Table core_config_data (general/locale/code) to en_US

                    – A.P
                    Dec 3 '17 at 10:45












                  • same error after changing to en_US.

                    – Meetanshi
                    Dec 3 '17 at 10:54











                  • I managed to get it up, but dead-end when trying get back to fi_FI. Did you cleared the cache?

                    – A.P
                    Dec 3 '17 at 11:02











                  • yes, i cleared cache

                    – Meetanshi
                    Dec 3 '17 at 11:03















                  1














                  I ended up to exactly to the same situation. After adding the code above I got "Malformed UTF-8 characters, possibly incorrectly encoded"



                  I suppose that you are not using the default language. Try to change language to "default" en_US.



                  Meetanshi - Which language you are using in front-end and is the static-content creation also failing?






                  share|improve this answer























                  • Hi @A.P, I am facing the same error and i am using de_DE language.

                    – Meetanshi
                    Dec 3 '17 at 10:28












                  • Try change to en_US. Table core_config_data (general/locale/code) to en_US

                    – A.P
                    Dec 3 '17 at 10:45












                  • same error after changing to en_US.

                    – Meetanshi
                    Dec 3 '17 at 10:54











                  • I managed to get it up, but dead-end when trying get back to fi_FI. Did you cleared the cache?

                    – A.P
                    Dec 3 '17 at 11:02











                  • yes, i cleared cache

                    – Meetanshi
                    Dec 3 '17 at 11:03













                  1












                  1








                  1







                  I ended up to exactly to the same situation. After adding the code above I got "Malformed UTF-8 characters, possibly incorrectly encoded"



                  I suppose that you are not using the default language. Try to change language to "default" en_US.



                  Meetanshi - Which language you are using in front-end and is the static-content creation also failing?






                  share|improve this answer













                  I ended up to exactly to the same situation. After adding the code above I got "Malformed UTF-8 characters, possibly incorrectly encoded"



                  I suppose that you are not using the default language. Try to change language to "default" en_US.



                  Meetanshi - Which language you are using in front-end and is the static-content creation also failing?







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 2 '17 at 7:40









                  A.PA.P

                  265




                  265












                  • Hi @A.P, I am facing the same error and i am using de_DE language.

                    – Meetanshi
                    Dec 3 '17 at 10:28












                  • Try change to en_US. Table core_config_data (general/locale/code) to en_US

                    – A.P
                    Dec 3 '17 at 10:45












                  • same error after changing to en_US.

                    – Meetanshi
                    Dec 3 '17 at 10:54











                  • I managed to get it up, but dead-end when trying get back to fi_FI. Did you cleared the cache?

                    – A.P
                    Dec 3 '17 at 11:02











                  • yes, i cleared cache

                    – Meetanshi
                    Dec 3 '17 at 11:03

















                  • Hi @A.P, I am facing the same error and i am using de_DE language.

                    – Meetanshi
                    Dec 3 '17 at 10:28












                  • Try change to en_US. Table core_config_data (general/locale/code) to en_US

                    – A.P
                    Dec 3 '17 at 10:45












                  • same error after changing to en_US.

                    – Meetanshi
                    Dec 3 '17 at 10:54











                  • I managed to get it up, but dead-end when trying get back to fi_FI. Did you cleared the cache?

                    – A.P
                    Dec 3 '17 at 11:02











                  • yes, i cleared cache

                    – Meetanshi
                    Dec 3 '17 at 11:03
















                  Hi @A.P, I am facing the same error and i am using de_DE language.

                  – Meetanshi
                  Dec 3 '17 at 10:28






                  Hi @A.P, I am facing the same error and i am using de_DE language.

                  – Meetanshi
                  Dec 3 '17 at 10:28














                  Try change to en_US. Table core_config_data (general/locale/code) to en_US

                  – A.P
                  Dec 3 '17 at 10:45






                  Try change to en_US. Table core_config_data (general/locale/code) to en_US

                  – A.P
                  Dec 3 '17 at 10:45














                  same error after changing to en_US.

                  – Meetanshi
                  Dec 3 '17 at 10:54





                  same error after changing to en_US.

                  – Meetanshi
                  Dec 3 '17 at 10:54













                  I managed to get it up, but dead-end when trying get back to fi_FI. Did you cleared the cache?

                  – A.P
                  Dec 3 '17 at 11:02





                  I managed to get it up, but dead-end when trying get back to fi_FI. Did you cleared the cache?

                  – A.P
                  Dec 3 '17 at 11:02













                  yes, i cleared cache

                  – Meetanshi
                  Dec 3 '17 at 11:03





                  yes, i cleared cache

                  – Meetanshi
                  Dec 3 '17 at 11:03











                  0














                  In my case the cause to a UTF8 Encoding problem, was non-multibyte safe shortening of product names:



                  $productName = strlen($productName) > 60 ? substr($productName,0,60)."..." : 
                  $productName;


                  So a



                  012345678901234567890123456789012345678901234567890123456 Außengewinde 


                  became



                  012345678901234567890123456789012345678901234567890123456 Au�...





                  share|improve this answer





























                    0














                    In my case the cause to a UTF8 Encoding problem, was non-multibyte safe shortening of product names:



                    $productName = strlen($productName) > 60 ? substr($productName,0,60)."..." : 
                    $productName;


                    So a



                    012345678901234567890123456789012345678901234567890123456 Außengewinde 


                    became



                    012345678901234567890123456789012345678901234567890123456 Au�...





                    share|improve this answer



























                      0












                      0








                      0







                      In my case the cause to a UTF8 Encoding problem, was non-multibyte safe shortening of product names:



                      $productName = strlen($productName) > 60 ? substr($productName,0,60)."..." : 
                      $productName;


                      So a



                      012345678901234567890123456789012345678901234567890123456 Außengewinde 


                      became



                      012345678901234567890123456789012345678901234567890123456 Au�...





                      share|improve this answer















                      In my case the cause to a UTF8 Encoding problem, was non-multibyte safe shortening of product names:



                      $productName = strlen($productName) > 60 ? substr($productName,0,60)."..." : 
                      $productName;


                      So a



                      012345678901234567890123456789012345678901234567890123456 Außengewinde 


                      became



                      012345678901234567890123456789012345678901234567890123456 Au�...






                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Dec 11 '18 at 12:50

























                      answered Dec 11 '18 at 12:44









                      AlexAlex

                      9,4461755117




                      9,4461755117





















                          0














                          For me the solution was to replace all special characters like "ä" in the translation csv file with html versions of the same character like this:



                          &auml;


                          Then I cleared caches and reloaded frontend.






                          share|improve this answer



























                            0














                            For me the solution was to replace all special characters like "ä" in the translation csv file with html versions of the same character like this:



                            &auml;


                            Then I cleared caches and reloaded frontend.






                            share|improve this answer

























                              0












                              0








                              0







                              For me the solution was to replace all special characters like "ä" in the translation csv file with html versions of the same character like this:



                              &auml;


                              Then I cleared caches and reloaded frontend.






                              share|improve this answer













                              For me the solution was to replace all special characters like "ä" in the translation csv file with html versions of the same character like this:



                              &auml;


                              Then I cleared caches and reloaded frontend.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Jan 16 at 13:37









                              WebninjaWebninja

                              5911931




                              5911931





















                                  0














                                  Be careful with substr function. It does not support UTF-8. And this can break the FPC. Use mb_substr






                                  share|improve this answer



























                                    0














                                    Be careful with substr function. It does not support UTF-8. And this can break the FPC. Use mb_substr






                                    share|improve this answer

























                                      0












                                      0








                                      0







                                      Be careful with substr function. It does not support UTF-8. And this can break the FPC. Use mb_substr






                                      share|improve this answer













                                      Be careful with substr function. It does not support UTF-8. And this can break the FPC. Use mb_substr







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Jun 2 at 11:54









                                      ArniArni

                                      16114




                                      16114



























                                          draft saved

                                          draft discarded
















































                                          Thanks for contributing an answer to Magento Stack Exchange!


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid


                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.

                                          To learn more, see our tips on writing great answers.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function ()
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f202448%2fmagento-2-2-1-unable-to-serialize-value%23new-answer', 'question_page');

                                          );

                                          Post as a guest















                                          Required, but never shown





















































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown

































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown







                                          Popular posts from this blog

                                          Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

                                          Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

                                          Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림