Plugin failed to access the database

Open
#352 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
php
Domain
backend, databases

Research direction

Begin at plugins/ocsinventoryng/inc/dbocs.class.php:97 and follow connect() from line 55, using the php-errors.log warning and the stated GLPI/OCSNG VM setup as context. Reproduce the failed connection and trace the configuration, network, and database-access behavior; done means the OCSNG plugin connects without the mysqli permission-denied warning.

Written by the indexing model from the issue text.

Description

  • PLUGIN VERSION = 2.0.4
  • GLPI 10.0.6

I've been trying to connect to my ocsng database via the OCSNG plugin and the plugin returns to me that it failed to connect to the database.

My current setup is two Virtual Machines running AlmaLinux 9.1 server (no gui). One running GLPI and another running OCSNG, both are on the same network

I went into the php-errors.log of GLPI and it returns this detailed Warning:

[2023-03-23 08:08:59] glpiphplog.WARNING: *** PHP Warning (2): mysqli::real_connect(): (HY000/2002): Permission denied in /var/www/html/glpi/plugins/ocsinventoryng/inc/dbocs.class.php at line 97
Backtrace :
plugins/ocsinventoryng/inc/dbocs.class.php:97 mysqli->real_connect()
plugins/ocsinventoryng/inc/dbocs.class.php:55 PluginOcsinventoryngDBocs->connect()
...ins/ocsinventoryng/inc/ocsdbclient.class.php:54 PluginOcsinventoryngDBocs->__construct()
...ins/ocsinventoryng/inc/ocsserver.class.php:1926 PluginOcsinventoryngOcsDbClient->__construct()
...ins/ocsinventoryng/inc/ocsserver.class.php:1905 PluginOcsinventoryngOcsServer::getDBocs()
...ins/ocsinventoryng/inc/snmpocslink.class.php:65 PluginOcsinventoryngOcsServer::checkOCSconnection()
src/CommonGLPI.php:382 PluginOcsinventoryngSnmpOcslink->getTabNameForItem()
plugins/ocsinventoryng/inc/ocsserver.class.php:146 CommonGLPI->addStandardTab()
src/CommonGLPI.php:332 PluginOcsinventoryngOcsServer->defineTabs()
src/Toolbox.php:3559 CommonGLPI->defineAllTabs()
ajax/updatecurrenttab.php:46 Toolbox::getAvailablesTabs()

Dominant language
JavaScript
Stars
75
Forks
54
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pluginsGLPI/ocsinventoryng

All issues in pluginsGLPI/ocsinventoryng

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.