0

After the update process using the Composer has finished I am getting an Unable to unserialize value. Error: Syntax error error with any CLI command I try running (like upgrade or cache flush).


I followed the guide on Magento 2.2: Unable to unserialize value? and modified already. The error is still there, so I output the string that is serialized into a text file and the result is https://pastebin.com/PaqxNAfA.

This is my unserialize function in Json.php:

public function unserialize($string)
{

    if($this->is_serialized($string))
    {
        var_dump($string); 
        $string = $this->serialize($string);
    }
    $result = json_decode($string, true);
    if (json_last_error() !== JSON_ERROR_NONE) {
        throw new \InvalidArgumentException("Unable to unserialize value. Error: " . json_last_error_msg());
    }
    return $result;
}

function is_serialized($value, &$result = null) {...}

I ran this CLI command to get the string:

php bin/magento cache:clean > output.txt    

Any idea how to solve that?

1 Answer 1

2

You can solve it by running these commands:

composer update -vvv
redis-cli flushall
bin/magento cache:clean
2
  • I am using centos7 - nginx how to solve this issue?
    – zus
    Jun 20, 2020 at 10:44
  • 1
    You can do the same @zus Jun 22, 2020 at 19:17

Your Answer

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

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