Open emgiezet opened 11 years ago
Are you using the compiled class file? If so, can you try whether you get the error when you disable it?
Did this error occur on Symfony 2.1?
@schmittjoh FYI, sonata removed their controllers from the compiled class file in their 2.1 branch recently but it has not yet been merged into master for 2.2. But DIExtraBundle should not break when it is used IMO.
This happens when I'm using clean symfony generated controllers o FOSUserBundle login/register actions. It's not connected with sonata.
@emgiezet, you'll need to give some more precise debugging details like the exact versions, whether or not you use the compiled class cache, whether or not this happened on Symfony 2.1 (if you upgraded).
@stof, I'm all for not breaking things if this is possible. In order to assess this, we first need to find the cause though, and by cause I do not mean the class in which it happens, but why it happens now and has not happened before.
the reason is that the cache warmer is requiring all controllers, which break if one of them was defined in the bootstrap file
I'm aware that compiled controllers are not supported by this bundle, and if @emgiezet can confirm that this is indeed causing the issue for him, then we would need to see when this class was added to the compiled files, and remove it again.
This is not only necessary for the cache warmer to work, but also required to keep annotation parsing at an acceptable performance level. Then, we could also look into providing a better error message for these cases, but at this point, I do not know what we could except parsing all files before including them, or removing the cache warmer.
@schmittjoh how about checking if the controller class exists already before requiring the file? I'm not sure why the bundle requires them instead of relying on autoloading anyway? Obviously this would break if people don't follow PSR-0, but I don't know if that's really an issue in sf2 projects.
Hi!
I got this 500 randomly once or twice per 10 requests.
Here is the trace:
Project is basic configured sf 2.2 with sonata & fosuserbundle with APC and Memcached. It happens on dev env.