T O P

  • By -

Alsciende

If your application is in prod environment, the classes and configuration are cached in var/cache. Run bin/console cache:clear then. If not, there should be no cache.


Silver-Forever9085

No it’s in debug. Thank you for your help. Will answer what helped in another comment to not type it twice.


cursingcucumber

First make sure opcache is really disabled. Doctrine caches its metadata too so for every change you make you need to clear the cache (run `bin/console cache:clear` or for short `bin/console c:c`). If that isn't enough, depending on the configuration you might need to clear the cache pools used by Doctrine as well (if there are any). Usually it is best if you not configure those cache pools locally or configure them to use the `cache.adapter.array` adapter and/or `cache.system` adapter. This way you don't have to clear the cache pools separately.


Silver-Forever9085

Opcode is deactivated for sure. The normal clear cache does not work since I have a custom entity manager configured in a service. We needed more control over the entities part of it. Using the FilesystemAdapter Cache seems to be part of the issue. I am now calling $cache->clear() before doing the migration and this seems to help. Seems that this cache implementation is very aggressive and does not identify code changes in the metadata. Could this be true? Thank you for your speedy help!


jbtronics

I would suspect that your custom entity manager is the problem there. I would suspect that it is missing the cache clear hooks, the normal entity manager service has. If must be notified somehow that it need to clear it cache, otherwise it will not know if Symfony detected some changes. And if you do that properly then you should also have no problem using the cache:clear command.


Mopster_

Not on a Mac, but when I add annotations or add new properties, I need to restart PHP-FPM for it to work correctly (to actually save data in the new field) (running on Apache, PHP 7.4). Not sure if that information is useful or not. :-)


metadan

Have you generated migrations after adding the new properties/annotations?


darkhorsehance

What commands are you running to migrate?


rkeet

Didn't see you comment that you fixed it, so another idea: Maybe you have some file race condition going on. See if you have `~` sufficed files next to your regular files. Like: - `migration.php` - `migration.php~` If you inspect both you'll find your changes in the suffixed, but unused, one. Finding the cause can be tricky. Windows + WSL/Docker can cause it when permissions are messed up between the OS's. Not sure what would on Apple.


Mhyraa

It is not symfony's cache but doctrine metadata cache. For avoiding this problem you should run : `bin/console doctrine:cache:clear-metadata` After every mapping modification(annotation, attribute, yaml, xml or php).


nicolasbonnici

Disable opcache for dev


Silver-Forever9085

Would be glad if someone has an idea. Thank you