Skip to content
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

[Debug] Warning: Class __PHP_Incomplete_Class has no unserializer #20654

Closed
javiereguiluz opened this issue Nov 27, 2016 · 2 comments
Closed

Comments

@javiereguiluz
Copy link
Member

javiereguiluz commented Nov 27, 2016

I'm not sure if this is a Symfony issue or something on my side ... but when upgrading to/from 3.2-RC2 and 3.1, I'm getting a lot of these errors:

[...]

Writing lock file
Generating autoload files
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache

  [Symfony\Component\Debug\Exception\ContextErrorException]
  Warning: Class __PHP_Incomplete_Class has no unserializer

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling
the post-update-cmd event terminated with an exception

  [RuntimeException]
  An error occurred when executing the "'cache:clear --no-warmup'" command:

    [Symfony\Component\Debug\Exception\ContextErrorException]
    Warning: Class __PHP_Incomplete_Class has no unserializer
@wouterj
Copy link
Member

wouterj commented Nov 27, 2016

I think this happens quite often when upgrading versions. The cache files are not always backwards compatible.

The problem with cache:clear is that before clearing the cache, the cache is first used to boot the Symfony CLI. As cache is not BC, this will error. The only solution afaik is to clear the cache yourself using rm -rf var/cache/.

@fabpot
Copy link
Member

fabpot commented Nov 27, 2016

@wouterj is right, nothing we can do on our side.

@fabpot fabpot closed this as completed Nov 27, 2016
nicolas-grekas added a commit that referenced this issue Nov 29, 2016
…nserialize() fails (nicolas-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

[Config] ConfigCache::isFresh() should return false when unserialize() fails

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

Removes some `Warning: Class __PHP_Incomplete_Class has no unserializer` failures when clearing the cache.

Commits
-------

609245e [Config] ConfigCache::isFresh() should return false on __PHP_Incomplete_Class
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

3 participants