Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[HttpCache] Invalid Store::getMetadata() return type #42031

Closed
@EmmanuelVella

Description

@EmmanuelVella

Symfony version(s) affected: 4.4.24

Description
I frequently get the following error in my prod server logs : Return value of Symfony\\Component\\HttpKernel\\HttpCache\\Store::getMetadata() must be of the type array, bool returned

How to reproduce
I don't know in which cases the error occurs, and I wasn't able to reproduce it.

Possible Solution
I think we should handle non-array return types of the unserialize method.

Additional context

Method : https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/HttpKernel/HttpCache/Store.php#L295

{
    "class": "Symfony\\Component\\Debug\\Exception\\FatalThrowableError",
    "message": "Return value of Symfony\\Component\\HttpKernel\\HttpCache\\Store::getMetadata() must be of the type array, bool returned",
    "code": 0,
    "file": "vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/Store.php:301",
    "trace": [
        "vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/Store.php:134",
        "vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php:330",
        "vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php:222",
        "vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/AbstractSurrogate.php:96",
        "vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(637) : eval()'d code:360",
        "vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php:637",
        "vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php:225",
        "public/index.php:31"
    ]
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions