7

I removed $hearAboutIndustry from the entity and now getting error below only in production server, not on local and staging server! Any idea why or solution?

Property Tete\AdminBundle\Entity\Customer::$hearAboutIndustry does not exist
500 Internal Server Error - ReflectionException

config_prod.yml

doctrine:
    orm:
        metadata_cache_driver: apc
        result_cache_driver: apc
        query_cache_driver: apc

What I have do to solve it so far:

  • Removed getter and setters from the entity.
  • Deleted whole cache and logs folders and re-created back, inc 777.
  • Just in case run cache:clear --env=prod
  • Searched hearAboutIndustry in all directories/files of the project. No reference at all.
  • Run doctrine:schema:update. DB is updated.
  • Run doctrine:generate:entities. Entity is updated.
  • app/console doctrine:cache:clear-metadata
  • app/console doctrine:cache:clear-query
  • app/console doctrine:cache:clear-result
BentCoder
  • 12,257
  • 22
  • 93
  • 165

5 Answers5

7

As Adam suggested above in comment, we better restart apache if all the above solutions have been tried and getting no success. The solution is:

sudo apachectl graceful

BentCoder
  • 12,257
  • 22
  • 93
  • 165
  • Cool, I'm glad that worked for you ;) I had a similar problem with using APC for class loading, took me ages to figure it out – Adam Elsodaney Oct 27 '14 at 19:13
  • 2
    I wasted about 6 hours to sort this out :) Now I can sleep. Thank you again. – BentCoder Oct 27 '14 at 19:16
  • 1
    I had the issue where I removed a field off an entity and it kept throwing an error. I tried manually clearing the cache and all that. Restarting apache fixed the issue. Thanks for that. – Skylord123 Sep 10 '15 at 17:36
5
  • php app/console doctrine:cache:clear-query --env=prod

Clearing ALL Query cache entries

  • php app/console doctrine:cache:clear-result --env=prod

Clearing ALL Result cache entries

  • php app/console doctrine:cache:clear-metadata --env=prod

Clearing ALL Metadata cache entries

  • php app/console cache:clear --env=prod

Clearing the cache for the prod environment with debug false

And don't forget to put --env=prod to your commands

0

"Old but still happens" If none of the solutions mentioned above worked try to delete the Entity cache file manually : (e.g Entity costumer cache file path should be this one)

projectdirectory\projectname\var\cache{dev or prod}\jms_serializer\Tete-AdminBundle-Entity-Customer.cache.php

Ammar
  • 1
  • 1
0

I had similar problem, I just used doctrine:mapping:import and that was it.

Cheers

lsd
  • 504
  • 1
  • 4
  • 16
0

We had the same issue and in our case (Nginx), the restart of Nginx didn't help.

But restart of memcache was the right solution:

sudo service memcached restart
František Heča
  • 386
  • 3
  • 16