YetiForceCompany / YetiForceCRM

Our team created for you one of the most innovative CRM systems that supports mainly business processes and allows for customization according to your needs. Be ahead of your competition and implement YetiForce!
https://yetiforce.com
Other
1.72k stars 742 forks source link

"Connection::dsn cannot be empty." error when installing on LAMP server [Question] #12185

Closed mattwadey closed 4 years ago

mattwadey commented 4 years ago

Description

Current steps:

Checked logs and showed the following:

[Tue Dec 03 08:36:42.776305 2019] [php7:error] [pid 8947] [client 81.140.233.217:1034] PHP Fatal error: Uncaught yii\\base\\InvalidConfigException: Connection::dsn cannot be empty. in /var/www/html/some-custom-domain.com/public_html/yeti-crm/vendor/yetiforce/yii2/db/Connection.php:602\nStack trace:\n#0 /var/www/html/some-custom-domain.com/public_html/yeti-crm/vendor/yetiforce/yii2/db/Connection.php(996): yii\\db\\Connection->open()\n#1 /var/www/html/some-custom-domain.com/public_html/yeti-crm/vendor/yetiforce/yii2/db/Connection.php(983): yii\\db\\Connection->getMasterPdo()\n#2 /var/www/html/some-custom-domain.com/public_html/yeti-crm/vendor/yetiforce/yii2/db/Connection.php(945): yii\\db\\Connection->getSlavePdo()\n#3 /var/www/html/some-custom-domain.com/public_html/yeti-crm/vendor/yetiforce/yii2/db/Connection.php(819): yii\\db\\Connection->getDriverName()\n#4 /var/www/html/some-custom-domain.com/public_html/yeti-crm/vendor/yetiforce/yii2/db/Connection.php(836): yii\\db\\Connection->getSchema()\n#5 /var/www/html/some-custom-domain.com/public_html/yeti-crm/app/Db/Query.php(27): yii\\db\\Connection->getQuer in /var/www/html/some-custom-domain.com/public_html/yeti-crm/vendor/yetiforce/yii2/db/Connection.php on line 602

So it looks like Yii is trying to connect to a database but I havent set one up yet. According to the Yetiforce docs this step occurs during installation, but Yii attempts a connection BEFORE the app takes over to run the install process so I cant set the config. Have I missed a step?

mariuszkrzaczkowski commented 4 years ago

Attach full logs

rskrzypczak commented 4 years ago

Have you config/Db.php file before run the install process?

mattwadey commented 4 years ago

Attach full logs

That's the full entry in the log @mariuszkrzaczkowski

Have you config/Db.php file before run the install process?

I haven't and I thought I must be missing something like this but I couldnt find any documentation that told me to create any config/settings files. I assumed it must be part of the install process itself?

mattwadey commented 4 years ago

So I think this is because I've missed some step somewhere. I following installation steps but it seems to think I've already installed even though I havent. So it's searching for databases and configs that dont exist yet.

I tried deleting all the files and starting from scratch but same issue.

I've manually created config/Db.php @rskrzypczak but it's now erroring on the next step which is trying to use a database table:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'yeticrm.a_yf_bruteforce' doesn't exist Failed to prepare SQL: SELECT * FROM `a_yf_bruteforce` LIMIT 1

I feel like all of this shouldve been provisioned when I initially hit the install script but it has never got that far.

rskrzypczak commented 4 years ago

config/Db.php cannot exist before installation. Remove it. What version of system are you trying to install?

mattwadey commented 4 years ago

config/Db.php cannot exist before installation. Remove it. What version of system are you trying to install?

I added it manually due to the error at the top of this issue. So not sure what to try next?

mariuszkrzaczkowski commented 4 years ago

What error message did you have during installation?

mattwadey commented 4 years ago

What error message did you have during installation?

See this issue, I followed those steps to install the app on the server. Went to the URL expecting to see the first stage to the install process (i.e. put in DB details etc.) instead I got the error:

Connection::dsn cannot be empty.

I downloaded the version from the main GitHub repo, I think this may default to developer branch which may be the issue!

vovpff commented 4 years ago

Where you downloaded installation package? You need to download latest package from releases page or from sourceforge.

mariuszkrzaczkowski commented 4 years ago

here you can download, https://github.com/YetiForceCompany/YetiForceCRM/releases

enable logs before installation

mariuszkrzaczkowski commented 4 years ago

Fixed https://github.com/YetiForceCompany/YetiForceCRM/commit/c35b8d291961916e724663ddc766b3918e225c0c