Symfony cryptic error: Error importing plugins/sfPropelPlugin/lib/propel/builder/SfPeerBuilder.php
By Stephane Carrez on Sunday, February 8 2009, 18:47 - php - Permalink
Symfony is a nice PHP framework, when it works. Sometimes when you run symfony you get a cryptic error and you have no clue on how to fix the problem. The article shows one of them and how to solve it.
After the migration to Symfony 1.2, when I wanted to use the command symfony propel:build-model, I was getting the following cryptic error:
>> propel Running "om" phing task phingcall Error importing plugins/sfPropelPlugin/lib/propel/builder/SfPeerBuilder.php Execution of target "om" failed for the following reason: /usr/share/php/symfony/plugins/sfPropelPlugin/lib/vendor/propel-generator/build- propel.xml:465:22: Execution of the target buildfile failed. Aborting. phing /usr/share/php/symfony/plugins/sfPropelPlugin/lib/vendor/propel-generator/build-propel.xml:465:22: Execution of the target buildfile failed. Aborting. Some problems occurred when executing the task: build-propel.xml:465:22: Execution of the target buildfile failed. Aborting. Read the logs to fix them
After searching for some time, I've found that this error comes from a bad definition in my 'config/propel.ini' file.
The propel.ini file contained definitions like:
propel.builder.peer.class = \ plugins.sfPropelPlugin.lib.propel.builder.SfPeerBuilder propel.builder.object.class = \ plugins.sfPropelPlugin.lib.propel.builder.SfObjectBuilder
And they should be defined as follows:
propel.builder.peer.class = \ plugins.sfPropelPlugin.lib.builder.SfPeerBuilder propel.builder.object.class = \ plugins.sfPropelPlugin.lib.builder.SfObjectBuilder
Once the propel configuration was fixed, the symfony command was working again.
If you have this kind of problem, I suggest the following:
- Create an empty blank application with Symfony (
symfony init-app test) - Make a diff of the '
config' directory between your application and the blank application - Report any suspicious change to fix your configuration
Comments
This error can be cryptic, but symfony documentation is very verbose on what to do to avoid this problem:
http://www.symfony-project.org/inst...
You just need to run:
$ php symfony project:upgrade1.2
That's all, it'll changes You described, as well as some others.
Thanks for the comment! I did run the symfony upgrade command but for some reason I had one file that was not migrated or was reverted. Don't miss understand me, I really like Symfony and I wish to have clever error message to help people understand their problem
Hi, thx for the Tipp. I had the same problem and now i can solve it.