OCSInventory-NG / OCSInventory-Server

Communication server of OCS Inventory
http://www.ocsinventory-ng.org/
GNU General Public License v2.0
344 stars 139 forks source link

Fix Api Conf Bug #365

Closed wiltonsr closed 1 year ago

wiltonsr commented 2 years ago

There is no OCS_DB_LOCAL env in Api DB connection. Changing Api DB connection to try multiples connections values like OCSInventory-NG/OCSInventory-Server

Important notes

Please, don't mistake OCSInventory-server with OCSInventory-ocsreports :

General informations :

Operating system :

Server informations :

Perl version : Mysql / Mariadb / Percona version :

Status :

READY/IN DEVELOPMENT/HOLD

Description :

A few sentences describing the overall goals of the pull request's commits.

wiltonsr commented 2 years ago

Hi,

After discussing with @gillesdubois on OCSInventory-NG/OCSInventory-Docker-Image#77 I confirmed that the problem dont ocurrs when OCSInventory-Server and OCSApi are installed together.

This ocurrs because the server conf file is setting the OCS_DB_LOCAL value.

But if we run only API, in this cenario, dont settings OCS_DB_LOCAL will cause a DBI Connection error.

On OCSInventory-Server both variables, OCS_DB_LOCAL and OCS_DB_NAME are tested to make connection. So the same should be made here or only changes the variable name like the PR does.

A complete refactoring to standardize the DB connection variable names in the 3 services and in Docker would also be a good option to prevent this kind of misunderstanding.

Lea9250 commented 1 year ago

Hi @wiltonsr,

Your modification has been reviewed and validated. Thank you for your contribution.

Best regards, Léa