This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

No connection params set for propel

Discussion around this tutorial for symfony 1.0.x

No connection params set for propel

by xqzmemiss » Tue Oct 07, 2008 3:48 pm

Code: Select all
stack trace

    * at ()
      in SF_SYMFONY_LIB_DIR\vendor\propel\Propel.php line 476 ...
             473.
             474.             $dsn = isset(self::$configuration['datasources'][$name]['connection']) ? self::$configuration['datasources'][$name]['connection'] : null;
             475.             if ($dsn === null) {
             476.                 throw new PropelException("No connection params set for " . $name);
             477.             }
             478.
             479.             include_once 'creole/Creole.php';


I've read most of the other post but i noticed that most people edit their database.yml file(taking out the #)
I tried takin mine out and i ended up wif a lot more errors :(~ :-(~ :sad:
but wif-out takin the (#) out it runs well, i edited my propel.ini file only.
Code: Select all
propel.targetPackage       = lib.model
propel.packageObjectModel  = true
propel.project             = rosas
propel.database            = mysql
propel.database.createUrl  = mysql://root@localhost/
propel.database.url        = mysql://root@localhost/rosas

propel.addGenericAccessors = true
propel.addGenericMutators  = true
propel.addTimeStamp        = false

propel.schema.validate     = false

; directories
propel.home                    = .
propel.output.dir              = C:\xampp\php osas
propel.schema.dir              = ${propel.output.dir}/config
propel.conf.dir                = ${propel.output.dir}/config
propel.phpconf.dir             = ${propel.output.dir}/config
propel.sql.dir                 = ${propel.output.dir}/data/sql
propel.runtime.conf.file       = runtime-conf.xml
propel.php.dir                 = ${propel.output.dir}
propel.default.schema.basename = schema
propel.datadump.mapper.from    = *schema.xml
propel.datadump.mapper.to      = *data.xml

; builder settings
propel.builder.peer.class              = addon.propel.builder.SfPeerBuilder
propel.builder.object.class            = addon.propel.builder.SfObjectBuilder

propel.builder.objectstub.class        = addon.propel.builder.SfExtensionObjectBuilder
propel.builder.peerstub.class          = addon.propel.builder.SfExtensionPeerBuilder
propel.builder.objectmultiextend.class = addon.propel.builder.SfMultiExtendObjectBuilder
propel.builder.mapbuilder.class        = addon.propel.builder.SfMapBuilderBuilder
propel.builder.interface.class         = propel.engine.builder.om.php5.PHP5InterfaceBuilder
propel.builder.node.class              = propel.engine.builder.om.php5.PHP5NodeBuilder
propel.builder.nodepeer.class          = propel.engine.builder.om.php5.PHP5NodePeerBuilder
propel.builder.nodestub.class          = propel.engine.builder.om.php5.PHP5ExtensionNodeBuilder
propel.builder.nodepeerstub.class      = propel.engine.builder.om.php5.PHP5ExtensionNodePeerBuilder

propel.builder.addIncludes = false
propel.builder.addComments = false

propel.builder.addBehaviors = false


propel.database.url = mysql://root:@localhost/rosas

propel.mysql.tableType = InnoDB


last 2line were the added codes

my database.yml:
Code: Select all
#all:
   #propel:
   #class:          sfPropelDatabase
   #param:
   #dsn:          mysql://root@localhost/rosas

any help is much welcome.... :D~ :-D~ :grin:
xqzmemiss
Junior Member
 
Posts: 13
Joined: Sat Sep 27, 2008 7:07 pm

Re: No connection params set for propel

by whalexis » Tue Oct 07, 2008 4:19 pm

Hi,

It looks like you've commented the database configuration.
You have to uncomment your database.yml file and to watch out for the indentation (no tabs are allowed according to yaml specifications)

So you should have something like this
Code: Select all
all:
  propel:
    class:          sfPropelDatabase
    param:
      dsn:          mysql://root@localhost/rosas


Take care of the number of space before each line

Alexis
whalexis
Faithful Member
 
Posts: 207
Joined: Wed Jul 16, 2008 7:14 pm

Re: No connection params set for propel

by xqzmemiss » Tue Oct 07, 2008 8:34 pm

As stated when i uncomment those line i get an error:
Code: Select all
Fatal error: Uncaught exception 'sfParseException' with
message 'Configuration file "C:\xampp\php osas/config
/databases.yml" specifies category "rosas" with missing class key'
 in C:\xampp\php\PEAR\symfony\config
\sfDatabaseConfigHandler.class.php:70 Stack trace: #0 C:\xampp
\php\PEAR\symfony\config\sfConfigCache.class.php(103):
 sfDatabaseConfigHandler->execute(Array) #1 C:\xampp\php\PEAR
\symfony\config\sfConfigCache.class.php(190):
sfConfigCache->callHandler('config/database...', Array, 'C:\xampp
\php o...') #2 C:\xampp\php\PEAR\symfony\database
\sfDatabaseManager.class.php(61):
sfConfigCache->checkConfig('config/database...') #3 C:\xampp
\php\PEAR\symfony\util\sfContext.class.php(63):
sfDatabaseManager->initialize() #4 C:\xampp\php\PEAR\symfony
\util\sfContext.class.php(87): sfContext->initialize() #5 C:\xampp
\php osas\web\frontend_dev.php(10): sfContext::getInstance() #6
{main} thrown in C:\xampp\php\PEAR\symfony\config
\sfDatabaseConfigHandler.class.php on line 70


I have checked my spacing and its ok. I notice if i comment those lines the programs runs fine. Cant figure it out.... :?~ :-?~ :???:
xqzmemiss
Junior Member
 
Posts: 13
Joined: Sat Sep 27, 2008 7:07 pm

Re: No connection params set for propel

by whalexis » Tue Oct 07, 2008 8:37 pm

Could you post the content off your database.yml file?
The one which raise an exception.
whalexis
Faithful Member
 
Posts: 207
Joined: Wed Jul 16, 2008 7:14 pm

Re: No connection params set for propel

by xqzmemiss » Wed Oct 08, 2008 11:26 am

I reinstalled everything..... i think i figured out why i had that problem, and that is my new problem i cant execute the line
Code: Select all
mysqladmin -u root -p create rosas

I thought i wouldn't have a problem since i could build-sql. i get an error msg
Code: Select all
mysqladmin is not recognized as an internal or external command.....batch file

any ideas????
xqzmemiss
Junior Member
 
Posts: 13
Joined: Sat Sep 27, 2008 7:07 pm

Re: No connection params set for propel

by whalexis » Wed Oct 08, 2008 2:56 pm

Are you running Linux or Windows?
whalexis
Faithful Member
 
Posts: 207
Joined: Wed Jul 16, 2008 7:14 pm

Re: No connection params set for propel

by xqzmemiss » Wed Oct 08, 2008 9:09 pm

windows XP..... some1 said i dont have to worry about the line since i am a windows user
Code: Select all
mysqladmin -u root -p create rosas
xqzmemiss
Junior Member
 
Posts: 13
Joined: Sat Sep 27, 2008 7:07 pm

Re: No connection params set for propel

by whalexis » Wed Oct 08, 2008 9:16 pm

I know, I read that... I think he was kidding.

I think there is only to options.
One, your re-installation doesn't work and you don't have mysqladmin one your computer.
Two, mysqladmin is not in the path.
whalexis
Faithful Member
 
Posts: 207
Joined: Wed Jul 16, 2008 7:14 pm

Re: No connection params set for propel

by xqzmemiss » Wed Oct 08, 2008 9:43 pm

thanks for that... i included the path on my env. variable and it works.
But i have a new problem; when i run the line
Code: Select all
symfony propel-generate-crud frontend rosas Branch
Branch is a table in rosas and so is Purchase order... i tried to drop the table (PO) and clearing cache but i still get the error msg
Code: Select all
Fatal error: Class 'Purchase orderMapBuilder' not found in C:\xampp\php\PEAR\sym
fony\plugins\sfPropelPlugin\lib\propel\generator\sfPropelCrudGenerator.class.php
 on line 73
xqzmemiss
Junior Member
 
Posts: 13
Joined: Sat Sep 27, 2008 7:07 pm

Re: No connection params set for propel

by whalexis » Wed Oct 08, 2008 9:47 pm

You can't have a space in your class so I think you should rename your class to PurchaseOrder.

Have a look in your schema.yml file and check if the table name and the table php name are corrects (without spaces)
whalexis
Faithful Member
 
Posts: 207
Joined: Wed Jul 16, 2008 7:14 pm

Re: No connection params set for propel

by xqzmemiss » Thu Oct 09, 2008 1:15 pm

i think i'l downgrade my symfony to 1.0 cause i'm facing to much problems with this 1.1. thanks for the help again
cheers :D~ :-D~ :grin:
xqzmemiss
Junior Member
 
Posts: 13
Joined: Sat Sep 27, 2008 7:07 pm

Re: No connection params set for propel

by DigitalMechanic » Sun Oct 26, 2008 10:06 pm

I'm having a similar problem using PostgreSQL... I was going through the Admin-Generator video - running right along side Fabien: I did the following steps (in order)...
<ol type="1">
<li>symfony generate:project MyProject
<li>symfony generate:app MyAppName
<li>edit config/propel.ini, added propel.disableIndentifierQuoting=true
<li>modified propel.database = pgsql
<li>modified propel.database.createUrl = pgsql://user:pass@hostname/
<li>modified propel.database.url = pgsql://user:pass@hostname/dbname
<li>created my config/schema.yml (just one simple table)
<li>created a data/fixtures.yml to add a row of data
<li>created the database in pgsql (granted the user access to db and schema)
<li>did symfony propel:build-model (no errors)
<li>did symfony propel:build-sql (no errors)
<li>did symfony propel:insert-sql (no errors)
<li>did symfony propel:data-load appname (no errors)
<li>went to view the page and got the No connection params set for dbname (where dbname is the name used in all the connection params for the previous steps)...
<li>checked that the table was created (it was)
<li>checked perms (user has all privs)
<li>checked my pants to see if I remembered to put them on today (I did)
</ol>

I have no idea why propel doesn't think it has params for the function in Base[appname]Peer.php line 186...

Anyone have any good migrane meds?

Please advise...

Thanks,

-DM

DigitalMechanic
DigitalMechanic
Member
 
Posts: 43
Joined: Mon Feb 25, 2008 9:47 pm
Location: USA

Re: No connection params set for propel

by halfer » Mon Oct 27, 2008 11:02 am

DigitalMechanic, can you dump your databases.yml here, and also the first few lines of your schema.?ml - in particular the bit that specifies the datasource name. It needs to match up with the one in databases.yml.

If you could add stuff in [code] tags that will make it readable, thanks.
halfer
Faithful Member
 
Posts: 10148
Joined: Mon Jan 30, 2006 1:16 pm
Location: West Midlands, UK