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?

0

You can solve it by running these commands:

composer update -vvv
redis-cli flushall
bin/magento cache:clean
| improve this answer | |
  • I am using centos7 - nginx how to solve this issue? – zus Jun 20 at 10:44
  • 1
    You can do the same @zus – Rafael Corrêa Gomes Jun 22 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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