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
PHP Fatal error: Class 'FOS\UserBundle\Propel\om\BaseUser' not found #2224
Comments
Can you please leave a little more information... Which bundle versions are you using? |
dev-master, latest release of FOSUserBundle. |
Can you supply a PR which fixes https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Propel/User.php#L16 @dkorsak ? |
that's weird that this file has never been in this bundle (at least till last year). Is there another bundle that provides this file in the same namespace? |
The full Propel folder seems to be broken, the whole folder/namespace |
Ok, I think this seems to be an issue with the auto_mapping, this looks familiar: #1646. The classes in this namespace will be generated if I'm correct? |
Looks like a symfony problem to me, after I downgraded to symfony commit #1f9f87b177126fa67739ab109f8f59659f0dab9a (master, 3.2-dev) it's working again. Something broke/changed after this commit |
Event if I remove propel files from autoloader by adding "exclude-from-classmap" option into composer.json, symfony still is trying to autoload propel files. |
Hello, have exactly same issue as BowlingX has, after downgrade to #1f9f87b177126fa67739ab109f8f59659f0dab9a this error "'FOS\UserBundle\Propel\om\BaseUser' not found " not arise |
The question is what is trying to access these classes. If you don't use Propel, the bundle should never access these classes. And if you use Propel, the base classes will be generated by Propel. |
I do not use Propel, my FOSUserBundle config is:
|
friendsofsymfony/user-bundle dev-master 7abb0ff Symfony FOSUserBundle
|
Please provide the full stack trace, allowing to know what required the Propel user class |
this is full stack but I not found the source what use this class |
I just encountered the problem and I think the modifications on the composer autoload definition (specifically the Here's the comparison between the current the working and the failing commit: 662463f...FriendsOfSymfony:7abb0ff#diff-b5d0ee8c97c7abd7e3fa29b9a27d1780R54 |
what you gave me is an extract of your logs, not the stack trace. Run the cache warmup command in verbose mode to get a stack trace. Btw, autoload-dev of FOSUserBundle has strictly no impact in your own project (composer will NEVER read this setting for packages installed as a dependency) |
That's exactly my thought - still: rolling back just these changes fixes the error. |
@stof, Did you mean this ?:
|
I'm having the same problem. |
I've attached a stack-trace. Looks like the I am still convinced that it has something to do with the classmap-especially since the ValidatorBuilder uses it to build its metadata.
|
OK, I think I will move the propel integration into a separate bundle for v2 (and look for a maintainer for it, as I'm not using Propel myself), to avoid such issue. |
How about just gutting Propel? Version 2 will never be finished (it's been Alternatively, you could create the \Propel\om\BaseUser class and check it On Tue, Oct 11, 2016 at 11:36 AM, Christophe Coevoet <
|
This is not how propel should work |
As this class would extend from a Propel class, you would still have the same issue about the missing base class. It would just be the next one. |
Any update on this? This issue prevents me from updating to Symfony 3.2 right now. |
@stephanvierkant you can "pin" a healthy commit in the The last healthy commit is a24e799, so I use this right now and postpone the need to deal with the broken dependency for now:
|
this commit a24e799 does not resolve issue for me |
I just double checked it. Works fine for me, but I recall having trouble until i manually removed the cache dir. |
same issue here and downgrading to a24e799 won't help either! :( |
Friends don't let friends use Propel. How about dropping Propel support until Propel2 is at least in beta? For If you're upgrading to Symfony 3, you probably should be using an ORM On Wed, Nov 2, 2016 at 11:53 AM, Kevin Saliou notifications@github.com
|
👍 for dropping propel. We can (re)add support later, if someone needs this. |
I've done a little further digging into this, and have a temporary workaround, but not a solution.
comment out lines 97 > 183 Cache should now clear. The issue appears to have been triggered by the inclusion of the My theory goes that extracting the propel part of the
|
… non-existent class (Seldaek) This PR was submitted for the master branch but it was merged into the 3.2 branch instead (closes #20559). Discussion ---------- [FrameworkBundle] Avoid warming up the validator cache for non-existent class | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? |no | Tests pass? | yes | License | MIT This relates to FriendsOfSymfony/FOSUserBundle#2224 - where basically the cache warmer triggers autoloading of a class that is broken, and it then blows up. This doesn't fix the problem in itself, loading broken classes will still fail, but it allows us at least to work around it by doing: ``` "exclude-from-classmap": [ "vendor/friendsofsymfony/user-bundle/Propel/" ] ``` And then `composer dump-autoload -a` to get an authoritative classmap. That way the hasMetadataFor will return false because class_exist() won't try to load the class at all. Without the hasMetadataFor fix though, it calls getMetadataFor which throws an exception in the case the class doesn't exist. I am not sure if that's by design.. that the cache warmer would force you to have classes existing for all your validation definitions. Commits ------- cb12f22 [FrameworkBundle] Avoid warming up the validator cache for non-existent classes
Can you guys try the latest Symfony 3.2 branch? symfony/symfony@59f9949 |
I have same issue on symfony/symfony@a4edafbd |
@XWB - just checked #59f9949 of Symfony, and #4ea37a5 of FOSUserBundle, and the cache clears fine for me 👍 |
@ryzhov You need to use the 3.2 branch, Symfony master branch has not been updated yet. |
Does not work.
composer still creating autoload class map with Propel files (composer bug?) Composer\Autoload\ClassLoader->loadClass function if will not find class in the class map, will find ValidatorCacheWarmer class (XmlFileLoader) is trying to load Propel classes because in the file
there is
and Symfony parsing this file is trying to load class FOS\UserBundle\Propel\User. The solution is to split file
into Doctrine and Propel validation_{orm}.xml files and load files manually by compiler pass: see for example Exactly to fix it you can update file https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/DependencyInjection/Compiler/ValidationPass.php by add something like
and split /friendsofsymfony/user-bundle/Resources/config/validation.xml into orm.xml and propel.xml |
@dkorsak not a composer bug. As these files are in the FOSUserBundle package, the exclude rule would have to be added in the FOSUserBundle metadata |
Propel support has been removed. |
now cache:clear works as expected, thanks ! |
After symfony command cache:warmup there is error:
PHP Fatal error: Class 'FOS\UserBundle\Propel\om\BaseUser' not found in ..../vendor/friendsofsymfony/user-bundle/Propel/User.php on line 18
** [out :: 138.201.93.46] [2016-09-15 16:52:02] php.CRITICAL: Fatal Error: Class 'FOS\UserBundle\Propel\om\BaseUser' not found {"exception":"[object](Symfony\Component\Debug\Exception\FatalErrorException%28code: 0%29: Error: Class 'FOS\UserBundle\Propel\om\BaseUser' not found at .../vendor/friendsofsymfony/user-bundle/Propel/User.php:18)"}
Symfony version 3.2.x-dev.
The text was updated successfully, but these errors were encountered: