Symfony migration from 3.1.8 to 3.2.x

80 views Asked by At

we have a very specific problem in Symfony, migrating from 3.1.8 to 3.2.1 -> everything goes ok in all environments instead of production (seriously, only in prod env, test and dev env are totally fine), there is a problem in var/prod/classes.php:

Fatal error: Cannot declare interface Doctrine\Common\Annotations\Reader, because 
the name is already in use in /usr/local/www/stis/releases/20170109163615_hotfix-release/var/cache/prod/classes.php on line 9052

In /cache/dev/classes.php there is no interface Reader at all. Did anyone get this error? Thanks a lot!

1

There are 1 answers

1
Wouter J On

Generated cache is not compatible between Symfony versions (at least, compatibility is not guaranteed).

This kind of errors is often caused when using an incompatible cache. As part of your upgrade process between versions, I recommend to also always remove the cache directories. Please note that the cache:clear command first needs to boot using the old cache, so the best way is to delete the directories by hand. E.g:

$ rm -rf var/cache/*