Error Creating Initial Database

17 replies [Last post]
User offline. Last seen 44 weeks 11 hours ago. Offline
Joined: 2009-10-16
Posts: 6

OpenFISMA,

I encountered the following failure when attempting to install your application.

Problem Description: Followed instructions provided in the "Tutorial: Quickstart" (openfisma.org/content/tutorial-quickstart). OpenFISMA installer fails at the "Initial Database" page. Status indicators: Database 's creation - Green; Creating tables and populating initial data - Red; and Creating config file - Red. Error message provided: "SQLSTATE[HY000] [2002] Invalid argument."

Host Configuration: OpenFISMA Release-2.4 (via SourceForge.net); Fedora 11 Linux; XAMPP Linux 1.7.2 (Apache 2.2.12, MySQL 5.1.37, and PHP 5.3.0)

Please assist, thanks.

User offline. Last seen 3 weeks 2 days ago. Offline
Joined: 2009-04-17
Posts: 36
Re: Error Creating Initial Database

I think we need to post a new version of OpenFISMA on source forge that fixes that issue. I will send you a note when it has been posted. But in the meantime, if you have a Subversion client, you might want to check out the latest release tag (2.4.7) from the sourceforge repository.

User offline. Last seen 44 weeks 11 hours ago. Offline
Joined: 2009-10-16
Posts: 6
Re: Error Creating Initial Database

mhase,

Thanks for your reply.

Per your recommendation, I acquired the latest release (2.4.7) from the sourceforge repository and followed the installation instructions provided in the "INSTALL" file. I was able to start the installation script from my browser. However, the following notice was displayed at the top of each web page: "Notice: Trying to get property of non-object in /opt/openfisma/library/Fisma.php on line 38." FYI, line 386 in Fisma.php is: "return (self::$_appConf->debug == 1);". I proceded with the installation script and received "Green" status for the dependancies and permissions checks. After the database general settings summary page, the installation script failed and displayed a page with just the previous mentioned "Notice" at the top.

I need to complete my evaluation of OpenFISMA ASAP. Please recommend a configuration that has been successfully tested (i.e, Linux OS type/version, XAMPP version, and OpenFISMA release). Thanks!

User offline. Last seen 1 week 11 hours ago. Offline
Joined: 2009-08-27
Posts: 12
Re: Error Creating Initial Database

al_evaluator wrote:

mhase,

Thanks for your reply.

Per your recommendation, I acquired the latest release (2.4.7) from the sourceforge repository and followed the installation instructions provided in the "INSTALL" file. I was able to start the installation script from my browser. However, the following notice was displayed at the top of each web page: "Notice: Trying to get property of non-object in /opt/openfisma/library/Fisma.php on line 38." FYI, line 386 in Fisma.php is: "return (self::$_appConf->debug == 1);". I proceded with the installation script and received "Green" status for the dependancies and permissions checks. After the database general settings summary page, the installation script failed and displayed a page with just the previous mentioned "Notice" at the top.

I need to complete my evaluation of OpenFISMA ASAP. Please recommend a configuration that has been successfully tested (i.e, Linux OS type/version, XAMPP version, and OpenFISMA release). Thanks!

You need to find out what the error that's occuring is.

In your app.conf file (/application/config/app.conf), set environment=development, and errors should show up in your browser window now. Or you can enable PHP error logging in your php.ini. Report back with what you've found and we'll see what we can do.

__________________

Josh Boyd
Endeavor Systems, Inc.
Software Engineer

User offline. Last seen 44 weeks 11 hours ago. Offline
Joined: 2009-10-16
Posts: 6
Re: Error Creating Initial Database

jboyd,

There was no app.conf file in the .../application/config folder. However, there was an app.conf.template file which I copied to create the app.conf file. I changed the environment variable to development, and restarted the installation script. The following error message was displayed:

An exception occurred while bootstrapping the application.
Doctrine_Manager_Exception
Could not parse dsn
Stack Trace:
#0 /opt/openfisma/library/Doctrine/Manager.php(364): Doctrine_Manager->_buildDsnPartsArray('##DB_ADAPTER##:...')
#1 /opt/openfisma/library/Doctrine/Manager.php(228): Doctrine_Manager->parseDsn('##DB_ADAPTER##:...')
#2 /opt/openfisma/library/Doctrine/Manager.php(190): Doctrine_Manager->openConnection('##DB_ADAPTER##:...', NULL)
#3 /opt/openfisma/library/Fisma.php(262): Doctrine_Manager::connection('##DB_ADAPTER##:...')
#4 /opt/openfisma/public/index.php(29): Fisma::connectDb()
#5 {main}

No PHP errors were logged.

Please advise, thanks!

User offline. Last seen 1 week 11 hours ago. Offline
Joined: 2009-08-27
Posts: 12
Re: Error Creating Initial Database

al_evaluator wrote:

jboyd,

There was no app.conf file in the .../application/config folder. However, there was an app.conf.template file which I copied to create the app.conf file. I changed the environment variable to development, and restarted the installation script. The following error message was displayed:

An exception occurred while bootstrapping the application.
Doctrine_Manager_Exception
Could not parse dsn
Stack Trace:
#0 /opt/openfisma/library/Doctrine/Manager.php(364): Doctrine_Manager->_buildDsnPartsArray('##DB_ADAPTER##:...')
#1 /opt/openfisma/library/Doctrine/Manager.php(228): Doctrine_Manager->parseDsn('##DB_ADAPTER##:...')
#2 /opt/openfisma/library/Doctrine/Manager.php(190): Doctrine_Manager->openConnection('##DB_ADAPTER##:...', NULL)
#3 /opt/openfisma/library/Fisma.php(262): Doctrine_Manager::connection('##DB_ADAPTER##:...')
#4 /opt/openfisma/public/index.php(29): Fisma::connectDb()
#5 {main}

No PHP errors were logged.

Please advise, thanks!

You're getting this error because you don't have the database connection defined in app.conf, since you just copied the template over.

It sounds like the install failed previously, if app.conf wasn't present.

Enable display of errors in your php.ini, and remove app.conf. Wipe out your database, and try installing again. There must be some sort of fatal error popping up here.


display_errors = On
error_reporting = E_ALL & ~E_NOTICE | E_STRICT

You can't run the installation script while having app.conf exist.

We're releasing a new patch release tomorrow that will be up on sourceforge, which may fix your install problems.

__________________

Josh Boyd
Endeavor Systems, Inc.
Software Engineer

User offline. Last seen 44 weeks 11 hours ago. Offline
Joined: 2009-10-16
Posts: 6
Re: Error Creating Initial Database

Josh,

Per your instructions, I changed the "error_reporting" variable in the php.ini file (display_errors was already on), and re-ran the installer. After the database general settings summary page, the installer failed. A blank page was displayed. The PHP error log file had no entries. The OpenFISMA error log file (.../openfisma-error.log) contained the following:

######
[Wed Oct 21 10:38:11 2009] [error] [client ::1] PHP Warning: PDO::__construct() [pdo.--construct]: [2002] Invalid argument (trying to connect via unix://) in /opt/openfisma/library/Doctrine/Connection.php on line 1530, referer: http://localhost/install/dbreview
######

Is there an issue with Fedora 11 and/or XAMPP Linux 1.7.2? Additionally, when will the new patch be available on sourceforge?

Please advise, thanks!

User offline. Last seen 1 week 11 hours ago. Offline
Joined: 2009-08-27
Posts: 12
Re: Error Creating Initial Database

al_evaluator wrote:

Josh,

Per your instructions, I changed the "error_reporting" variable in the php.ini file (display_errors was already on), and re-ran the installer. After the database general settings summary page, the installer failed. A blank page was displayed. The PHP error log file had no entries. The OpenFISMA error log file (.../openfisma-error.log) contained the following:

######
[Wed Oct 21 10:38:11 2009] [error] [client ::1] PHP Warning: PDO::__construct() [pdo.--construct]: [2002] Invalid argument (trying to connect via unix://) in /opt/openfisma/library/Doctrine/Connection.php on line 1530, referer: http://localhost/install/dbreview
######

Is there an issue with Fedora 11 and/or XAMPP Linux 1.7.2? Additionally, when will the new patch be available on sourceforge?

Please advise, thanks!

What settings are you giving to the installer?

Specifically, what database connection settings? Since Doctrine_Connection is throwing an error containing "unix://" it makes me think that it's trying to use the localhost mySQL listener ... perhaps try specifying 127.0.0.1 instead of localhost?

I haven't used Fedora 11 or XAMPP with OpenFISMA before, I generally use Debian/Ubuntu with straight PHP/mySQL installed from packages.

I seem to remember in the back of my head having problems with previous projects with XAMPP creating the mySQL socket listener in the wrong place.

__________________

Josh Boyd
Endeavor Systems, Inc.
Software Engineer

User offline. Last seen 44 weeks 11 hours ago. Offline
Joined: 2009-10-16
Posts: 6
Re: Error Creating Initial Database -- Login Credentials Invalid

Josh,

Almost finished!...using 127.0.0.1 allowed the installer to complete. However, at the login screen, I'm receiving an "Incorrect username or password" error message with the default login credentials (root / 0p3nfism@).

Please advise, thanks.

User offline. Last seen 1 week 11 hours ago. Offline
Joined: 2009-08-27
Posts: 12
Re: Error Creating Initial Database -- Login Credentials Invalid

al_evaluator wrote:

Josh,

Almost finished!...using 127.0.0.1 allowed the installer to complete. However, at the login screen, I'm receiving an "Incorrect username or password" error message with the default login credentials (root / 0p3nfism@).

Please advise, thanks.

That message at the end about the password is incorrect.

You should've set the password during the install process. The username will be root, the password will be whatever you set it to.

__________________

Josh Boyd
Endeavor Systems, Inc.
Software Engineer

Joined: 2010-08-13
Posts: 6
Re: Error Creating Initial Database

I am running into this same issue. I have tried everything suggested in this thread but haven't been able to get it to work. I'm evaluating OpenFISMA for a client, and I'm up against a deadline. Any chance you can help me out?

Specifically, I am seeing these issues...
1) Doctrine_Manager_Exception "Could not parse dsn" error when running the Doctrine-cli.php script.
2) Internal Server Error (500) when trying to navigate to app (at /opt/openfisma/public, per the Debian install steps). Apache log says something about "Invalid command 'ExpiresActive'".
3) Nothing will run from the "public" dir. I have gotten a simple PHP script to run successfully from /opt/openfisma, but not /opt/openfisma/public.

I'm running Ubuntu 8 and following the Debian install procedure from the web site. Thanks for whatever info you can provide.

User offline. Last seen 6 days 17 hours ago. Offline
Joined: 2009-04-24
Posts: 6
Re: Error Creating Initial Database

Andy,

Please provide the version of OpenFISMA you are trying to install as well as the linux distribution and php version number you are using such as the following:

OpenFISMA version 2.8.1
Debian version 5.0.5
PHP version 5.2.6

This will help us start the process.

Based on your post I would start with the first error received which is "could not parse dsn", this looks like the information included in the application.ini file is incorrect or in an unreadable format that doctrine cannot use to create a connection with the database, the proper format should look something like the following:

db.adapter = mysql
db.host = localhost
db.port = 3306
db.username = openfisma
db.password = supersecretpassword
db.schema = openfisma

The application.ini file is located in the following directory:
/openfisma/application/config

User offline. Last seen 1 week 11 hours ago. Offline
Joined: 2009-08-27
Posts: 12
Re: Error Creating Initial Database

andy.clark@cta.com wrote:

I am running into this same issue. I have tried everything suggested in this thread but haven't been able to get it to work. I'm evaluating OpenFISMA for a client, and I'm up against a deadline. Any chance you can help me out?

Specifically, I am seeing these issues...
1) Doctrine_Manager_Exception "Could not parse dsn" error when running the Doctrine-cli.php script.
2) Internal Server Error (500) when trying to navigate to app (at /opt/openfisma/public, per the Debian install steps). Apache log says something about "Invalid command 'ExpiresActive'".
3) Nothing will run from the "public" dir. I have gotten a simple PHP script to run successfully from /opt/openfisma, but not /opt/openfisma/public.

I'm running Ubuntu 8 and following the Debian install procedure from the web site. Thanks for whatever info you can provide.

Nothing will run from the public directory because your Apache instance is not configured properly.

At a minimum, you're missing mod_expires as indicated by the Apache logs.

The parse DSN error means exactly that. The DSN is not correct. If your mysql password has special characters, you may need to surround it in quotes in the application.ini.

I'd suggest that you try going through the Debian instructions again, while referencing the general installation instructions as well. The Debian instructions have specific instructions that enable mod_expires, which suggests that you've missed a step or two in the installation instructions.

Debian Installation Guide
Installation Guide

__________________

Josh Boyd
Endeavor Systems, Inc.
Software Engineer

Joined: 2010-08-13
Posts: 6
Re: Error Creating Initial Database

Thanks for the quick response.

First, we are running...
OpenFISMA version 2.8.2, downloaded fresh last night
Debian 5.0.5 (also tried on Ubuntu8-based VM and got same result)
PHP version 5.2.6

Second, my config file is identical to your sample (except for the password, of course). However, you mention the file name as "application.ini", but mine is named "app.conf" per the Debian install procedure on your web site. Checking that as the culprit now... Hmmm, new error when running the doctrine-cli.php script to load the db: "The application is not installed correctly. If you have not run the installer, you should do that now.". I don't remember an "installer" script in the procedure - did I miss a step?

User offline. Last seen 1 week 11 hours ago. Offline
Joined: 2009-08-27
Posts: 12
Re: Error Creating Initial Database

andy.clark@cta.com wrote:

Thanks for the quick response.

First, we are running...
OpenFISMA version 2.8.2, downloaded fresh last night
Debian 5.0.5 (also tried on Ubuntu8-based VM and got same result)
PHP version 5.2.6

Second, my config file is identical to your sample (except for the password, of course). However, you mention the file name as "application.ini", but mine is named "app.conf" per the Debian install procedure on your web site. Checking that as the culprit now... Hmmm, new error when running the doctrine-cli.php script to load the db: "The application is not installed correctly. If you have not run the installer, you should do that now.". I don't remember an "installer" script in the procedure - did I miss a step?

The installer was recently removed, and the error message was not updated.

The Debian installation guide is apparently out dated now. Once you get to "Configuring OpenFISMA", refer to the general Installation Guide.

__________________

Josh Boyd
Endeavor Systems, Inc.
Software Engineer

Joined: 2010-08-13
Posts: 6
Re: Error Creating Initial Database

Thanks Josh.

jboyd wrote:

At a minimum, you're missing mod_expires as indicated by the Apache logs.

"a2enmod expires" returns "Module expires already enabled". Is there something else I need to do on that?

jboyd wrote:

... If your mysql password has special characters, you may need to surround it in quotes in the application.ini.

That seems to have done the trick for the doctrine script. Got a different return in green that look like it might be success. Thanks!

Joined: 2010-08-13
Posts: 6
Re: Error Creating Initial Database

Hey guys, thanks a bunch for the help. Per Josh's suggestion above, I re-ran the db build using the regular install procedure (and the reload option) and that worked great. I can actually see the site now, and things seem to be working ok.

As Josh mentioned, the Debian procedure does seem to be out of date in these areas...
1) Configuring OpenFISMA
a) application.ini vs. app.conf
b) Quotes around passwords with special characters
2) I had to install php5-cli to get the "doctrine" script to run - that may have just been me

Thanks!

User offline. Last seen 1 week 11 hours ago. Offline
Joined: 2009-08-27
Posts: 12
Re: Error Creating Initial Database

andy.clark@cta.com wrote:

Hey guys, thanks a bunch for the help. Per Josh's suggestion above, I re-ran the db build using the regular install procedure (and the reload option) and that worked great. I can actually see the site now, and things seem to be working ok.

As Josh mentioned, the Debian procedure does seem to be out of date in these areas...
1) Configuring OpenFISMA
a) application.ini vs. app.conf
b) Quotes around passwords with special characters
2) I had to install php5-cli to get the "doctrine" script to run - that may have just been me

Thanks!

Glad to see you got it running. I've updated the Debian install documentation accordingly.

__________________

Josh Boyd
Endeavor Systems, Inc.
Software Engineer