Magento 2.2: Unable to unserialize value?

  • Running into issues on a site running Magento 2.2.0-rc3.0/PHP 7.0.23

    The following issue occurs with all 3rd party extensions either enabled or disabled.

    When adding an item to comparison from category or product page or submitting a review from product page we get the following error in the browser:

    1 exception(s):
    Exception #0 (InvalidArgumentException): Unable to unserialize value.
    
    Exception #0 (InvalidArgumentException): Unable to unserialize value.
    #0 /home/___/public_html/app/code/Magento/Theme/Controller/Result/MessagePlugin.php(157): Magento\Framework\Serialize\Serializer\Json->unserialize('[{\\"type\\":\\"su...')
    #1 /home/___/public_html/app/code/Magento/Theme/Controller/Result/MessagePlugin.php(135): Magento\Theme\Controller\Result\MessagePlugin->getCookiesMessages()
    #2 /home/___/public_html/app/code/Magento/Theme/Controller/Result/MessagePlugin.php(84): Magento\Theme\Controller\Result\MessagePlugin->getMessages()
    #3 /home/___/public_html/lib/internal/Magento/Framework/Interception/Interceptor.php(146): Magento\Theme\Controller\Result\MessagePlugin->afterRenderResult(Object(Magento\Framework\View\Result\Page\Interceptor), Object(Magento\Framework\View\Result\Page\Interceptor), Object(Magento\Framework\App\Response\Http\Interceptor))
    #4 /home/___/public_html/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
    #5 /home/___/public_html/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(26): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)
    #6 /home/___/public_html/lib/internal/Magento/Framework/App/Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
    #7 /home/___/public_html/lib/internal/Magento/Framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()
    #8 /home/___/public_html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
    #9 {main}
    

    The error does not go away unless you clear cookies, in particular, the mage-messages cookie. enter image description here

    Any assistance in troubleshooting these errors is appreciated.

    Isn't that a core bug? is there a GitHub issue for this?

  • Chuck

    Chuck Correct answer

    4 years ago

    It turned out to be a permissions issue, where magento was setting permissions for generated files that were restricted on this server.

    Solved by creating magento_umask file in the root directory with the appropriate umask for the server.

    See http://devdocs.magento.com/guides/v2.2/install-gde/install/post-install-umask.html for additional details.

    Hello, I am facing the related issue like this. Can you please look in to this .

    @chunk all my dir are 755,and files are 644, what is the appropriate umask to set? tia

License under CC-BY-SA with attribution


Content dated before 7/24/2021 11:53 AM