Two days after update to Magento 2.2 we encountered this error in the admin panel “Unable to unserialize value.”
Serialization error

After quick debugging it turns out that the error was coused by incorrect value stored in core_config_data table of our magento instalation :
error

so to solve it set the corresponding values to NULL (via update script or directly in DB) – after this proccess the page should render normally.

Sample install script:

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context){
        $setup->startSetup();

            $this->_configResource->saveConfig(
                'search/advanced/long_tail_expressions',
                null,
                \Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
                \Magento\Store\Model\Store::DEFAULT_STORE_ID
            );

        $this->_configResource->saveConfig(
            'search/advanced/not_words',
            null,
            \Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
            \Magento\Store\Model\Store::DEFAULT_STORE_ID
        );

        $this->_configResource->saveConfig(
            'search/advanced/replace_words',
            null,
            \Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
            \Magento\Store\Model\Store::DEFAULT_STORE_ID
        );

        $this->_configResource->saveConfig(
            'search/advanced/wildcard_exceptions',
            null,
            \Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
            \Magento\Store\Model\Store::DEFAULT_STORE_ID
        );

        $setup->endSetup();
    }

Unfortunately after that we have to setup our configuration all over again – so make sure you made a backup of the data.

Leave a Reply

Your email address will not be published. Required fields are marked *

Fork us on GitHub