0

Please help, how to find error log and fix

Magento 2.3.2

This page isn’t working domainname.com is currently unable to handle this request. HTTP ERROR 500

  • Open app/bootstrap.php and uncomment #ini_set('display_errors', 1), it should be as ini_set('display_errors', 1) then reload the page, you may get the actual error on your screen. Also ensure if you are running Magento with developer mode. Command: php bin/magento deploy:mode:set developer – Himmat Paliwal Oct 7 at 16:58
  • @HimmatPaliwal Thank you. – Fha Fha Oct 7 at 17:08
  • @HimmatPaliwal Fatal error: Uncaught InvalidArgumentException: Unable to unserialize value. Error: Control character error, possibly incorrectly encoded in /home/sbaelect/domains/sbaelectric.com/public_html/vendor/magento/framework/Serialize/Serializer/Json.php:39 Stack trace: #0 – Fha Fha Oct 7 at 17:09
  • Which version of Magento you are using? – Himmat Paliwal Oct 7 at 17:16
  • @HimmatPaliwal Magento 2.3.2 – Fha Fha Oct 7 at 17:17
0

I was able to resolve this issue by Flushing my Redis Cache from the CLI

Solution1:

redis-cli flushall

Solution2 : check with this file and find function and update with below code :

/vendor/magento/framework/Serialize/Serializer/Json.php

public function unserialize($string)
{
    if($this->is_serialized($string))
    {
        $string = $this->serialize($string);
    }
    $result = json_decode($string, true);
    if (json_last_error() !== JSON_ERROR_NONE) {
         throw new \InvalidArgumentException('Unable to unserialize value.');

    }
    return $result;
}

and add function to check if string is serialized:

function is_serialized($value, &$result = null)
{
    // Bit of a give away this one
    if (!is_string($value))
    {
        return false;
    }
    // Serialized false, return true. unserialize() returns false on an
    // invalid string or it could return false if the string is serialized
    // false, eliminate that possibility.
    if ($value === 'b:0;')
    {
        $result = false;
        return true;
    }
    $length = strlen($value);
    $end    = '';
    switch ($value[0])
    {
        case 's':
            if ($value[$length - 2] !== '"')
            {
                return false;
            }
        case 'b':
        case 'i':
        case 'd':
            // This looks odd but it is quicker than isset()ing
            $end .= ';';
        case 'a':
        case 'O':
            $end .= '}';
            if ($value[1] !== ':')
            {
                return false;
            }
            switch ($value[2])
            {
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                case 7:
                case 8:
                case 9:
                    break;
                default:
                    return false;
            }
        case 'N':
            $end .= ';';
            if ($value[$length - 1] !== $end[0])
            {
                return false;
            }
            break;
        default:
            return false;
    }
    if (($result = @unserialize($value)) === false)
    {
        $result = null;
        return false;
    }
    return true;
}

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.