OCSInventory-Server icon indicating copy to clipboard operation
OCSInventory-Server copied to clipboard

Fix Api Conf Bug

Open wiltonsr opened this issue 3 years ago • 1 comments

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 :

  • OCSInventory-server : Communication server that manage the inventory
  • OCSInventory-ocsreports : Web interface of OCS Inventory

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 avatar Dec 10 '21 14:12 wiltonsr

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.

wiltonsr avatar Dec 15 '21 15:12 wiltonsr

Hi @wiltonsr,

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

Best regards, Léa

Lea9250 avatar Jan 26 '23 09:01 Lea9250