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

Skip to content

WARNING [cache] Failed to save key "xxx" #29118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
devgogo opened this issue Nov 7, 2018 · 3 comments
Closed

WARNING [cache] Failed to save key "xxx" #29118

devgogo opened this issue Nov 7, 2018 · 3 comments

Comments

@devgogo
Copy link

devgogo commented Nov 7, 2018

Symfony version(s) affected: 4.2.0-beta1

PHP Version: 7.2

Description

17:56:47 WARNING   [cache] Failed to save key "%5BApp%5CEntity%5CComment%24CLASSMETADATA%5D%5B1%5D" (Doctrine\ORM\Mapping\ClassMetadata) ["key" => "%5BApp%5CEntity%5CComment%24CLASSMETADATA%5D%5B1%5D","type" => "Doctrine\ORM\Mapping\ClassMetadata","exception" => Symfony\Component\Cache\Exception\InvalidArgumentException { …}]
17:56:47 WARNING   [cache] Failed to save key "%5BApp%5CEntity%5CUser%24CLASSMETADATA%5D%5B1%5D" (Doctrine\ORM\Mapping\ClassMetadata) ["key" => "%5BApp%5CEntity%5CUser%24CLASSMETADATA%5D%5B1%5D","type" => "Doctrine\ORM\Mapping\ClassMetadata","exception" => Symfony\Component\Cache\Exception\InvalidArgumentException { …}]
17:56:47 WARNING   [cache] Failed to save key "%5BApp%5CEntity%5CArticle%24CLASSMETADATA%5D%5B1%5D" (Doctrine\ORM\Mapping\ClassMetadata) ["key" => "%5BApp%5CEntity%5CArticle%24CLASSMETADATA%5D%5B1%5D","type" => "Doctrine\ORM\Mapping\ClassMetadata","exception" => Symfony\Component\Cache\Exception\InvalidArgumentException { …}]
17:56:47 WARNING   [cache] Failed to save key "%5BApp%5CEntity%5CTag%24CLASSMETADATA%5D%5B1%5D" (Doctrine\ORM\Mapping\ClassMetadata) ["key" => "%5BApp%5CEntity%5CTag%24CLASSMETADATA%5D%5B1%5D","type" => "Doctrine\ORM\Mapping\ClassMetadata","exception" => Symfony\Component\Cache\Exception\InvalidArgumentException { …}]
17:56:47 WARNING   [cache] Failed to save key "%5BApp%5CEntity%5CCategory%24CLASSMETADATA%5D%5B1%5D" (Doctrine\ORM\Mapping\ClassMetadata) ["key" => "%5BApp%5CEntity%5CCategory%24CLASSMETADATA%5D%5B1%5D","type" => "Doctrine\ORM\Mapping\ClassMetadata","exception" => Symfony\Component\Cache\Exception\InvalidArgumentException { …}]
17:56:47 WARNING   [cache] Failed to save key "%5BApp%5CEntity%5CTopic%24CLASSMETADATA%5D%5B1%5D" (Doctrine\ORM\Mapping\ClassMetadata) ["key" => "%5BApp%5CEntity%5CTopic%24CLASSMETADATA%5D%5B1%5D","type" => "Doctrine\ORM\Mapping\ClassMetadata","exception" => Symfony\Component\Cache\Exception\InvalidArgumentException { …}]
17:56:47 WARNING   [cache] Failed to save key "%5BApp%5CEntity%5CGroup%24CLASSMETADATA%5D%5B1%5D" (Doctrine\ORM\Mapping\ClassMetadata) ["key" => "%5BApp%5CEntity%5CGroup%24CLASSMETADATA%5D%5B1%5D","type" => "Doctrine\ORM\Mapping\ClassMetadata","exception" => Symfony\Component\Cache\Exception\InvalidArgumentException { …}]

How to reproduce

php bin/console  doctrine:schema:validate

screen shot 2018-11-07 at 5 58 50 pm

@nicolas-grekas
Copy link
Member

Can you provide a reproducer please? Can you maybe debug that InvalidArgumentException?
The easiest way to do so might be to use dump() in the CacheItem::log() method.

@devgogo
Copy link
Author

devgogo commented Nov 12, 2018

@nicolas-grekas
Thank you for your help.
See the output below:

    /**
     * Internal logging helper.
     *
     * @internal
     */
    public static function log(LoggerInterface $logger = null, $message, $context = array())
    {
dump($context); // debug
        if ($logger) {
            $logger->warning($message, $context);
        } else {
            $replace = array();
            foreach ($context as $k => $v) {
                if (is_scalar($v)) {
                    $replace['{'.$k.'}'] = $v;
                }

wx20181112-092942 2x

The env info:

# php bin/console about
 ----------------------- ---------------------------------------------------------------------------------
  Symfony
 ----------------------- ---------------------------------------------------------------------------------
  Version                 4.2.0-DEV
  End of maintenance      07/2019
  End of life             01/2020
 ----------------------- ---------------------------------------------------------------------------------
  Kernel
 ----------------------- ---------------------------------------------------------------------------------
  Type                    App\Kernel
  Environment             prod
  Debug                   false
  Charset                 UTF-8
  Cache directory         ./var/cache/prod (3.7 MiB)
  Log directory           ./var/log (19 KiB)
 ----------------------- ---------------------------------------------------------------------------------
  PHP
 ----------------------- ---------------------------------------------------------------------------------
  Version                 7.2.1
  Architecture            64 bits
  Intl locale             en_US
  Timezone                PRC (2018-11-12T09:39:32+08:00)
  OPcache                 false
  APCu                    false
  Xdebug                  false
 ----------------------- ---------------------------------------------------------------------------------

@nicolas-grekas
Copy link
Member

Fixed in #29209
Thanks for the report and the insights!

nicolas-grekas added a commit that referenced this issue Nov 14, 2018
This PR was merged into the 4.2-dev branch.

Discussion
----------

[VarExporter] fix handling of __sleep()

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #29118
| License       | MIT
| Doc PR        | -

Commits
-------

46e2ecd [VarExporter] fix handling of __sleep()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants