You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2016-12-01 17:13:03

petithomme
Member
Registered: 2009-01-05
Posts: 305

Bug plugin ocs

Bonjour,

à chaque synchro auto (via crontab avec le script ocsng_fullsync.sh) j'ai des erreurs mysql du type :

2016-12-01 14:44:05 [@LD2APP003P]
  *** MySQL query error:
  SQL: SELECT DISTINCT `hardware`.`ID` FROM `hardware`, `accountinfo`
                           WHERE `hardware`.`DEVICEID` NOT LIKE \'\\_%\'
                           AND `hardware`.`ID` = `accountinfo`.`HARDWARE_ID`
                            AND hardware.ID IN (49572) 
                           ORDER BY  LASTDATE 
                            
  Error: 
  Backtrace :
  ...ns/ocsinventoryng/inc/ocsdbclient.class.php:526 
  plugins/ocsinventoryng/inc/ocsclient.class.php:317 PluginOcsinventoryngOcsDbClient->getComputers()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:2451 PluginOcsinventoryngOcsClient->getComputer()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:2578 PluginOcsinventoryngOcsServer::getComputerHardware()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:2318 PluginOcsinventoryngOcsServer::updateHardware()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:1598 PluginOcsinventoryngOcsServer::updateComputer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:400 PluginOcsinventoryngOcsServer::processComputer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:284 plugin_ocsinventoryng_importFromOcsServer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:159 SecondPass()

Dans le fichier d'erreurs php j'ai ceci de redondant :

2016-12-01 14:44:05 [@LD2APP003P]
  *** PHP Warning(2): mysqli::mysqli(): (HY000/2003): Can't connect to MySQL server on 's01myc024' (99)
  Backtrace :
  :                                                  
  inc/dbmysql.class.php:118                          mysqli->mysqli()
  inc/dbmysql.class.php:82                           DBmysql->connect()
  plugins/ocsinventoryng/inc/dbocs.class.php:47      DBmysql->__construct()
  ...ins/ocsinventoryng/inc/ocsdbclient.class.php:39 PluginOcsinventoryngDBocs->__construct()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:4314 PluginOcsinventoryngOcsDbClient->__construct()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:5210 PluginOcsinventoryngOcsServer::getDBocs()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:2306 PluginOcsinventoryngOcsServer::updateAdministrativeInfoUseDate()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:1598 PluginOcsinventoryngOcsServer::updateComputer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:400 PluginOcsinventoryngOcsServer::processComputer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:284 plugin_ocsinventoryng_importFromOcsServer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:159 SecondPass()

2016-12-01 14:44:09 [@LD2APP003P]
  *** PHP Warning(2): mysqli::query(): Couldn't fetch mysqli
  Backtrace :
  :                                                  
  inc/dbmysql.class.php:168                          mysqli->query()
  ...ns/ocsinventoryng/inc/ocsdbclient.class.php:526 DBmysql->query()
  plugins/ocsinventoryng/inc/ocsclient.class.php:317 PluginOcsinventoryngOcsDbClient->getComputers()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:2088 PluginOcsinventoryngOcsClient->getComputer()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:1598 PluginOcsinventoryngOcsServer::updateComputer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:400 PluginOcsinventoryngOcsServer::processComputer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:284 plugin_ocsinventoryng_importFromOcsServer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:159 SecondPass()

2016-12-01 14:44:32 [@LD2APP003P]
  *** PHP Notice(8): Trying to get property of non-object
  Backtrace :
  inc/dbmysql.class.php:240                          
  ...ns/ocsinventoryng/inc/ocsdbclient.class.php:528 DBmysql->numrows()
  plugins/ocsinventoryng/inc/ocsclient.class.php:317 PluginOcsinventoryngOcsDbClient->getComputers()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:2088 PluginOcsinventoryngOcsClient->getComputer()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:1598 PluginOcsinventoryngOcsServer::updateComputer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:400 PluginOcsinventoryngOcsServer::processComputer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:284 plugin_ocsinventoryng_importFromOcsServer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:159 SecondPass()

Pourtant en ligne de commande depuis mon serveurs php hébergeant GLPI je n'ai aucun soucis pour me connecter à ma base OCS via MySQL avec les identifiants saisis pour le plugin.
Le test de connection du plugin vers la base OCS est fonctionnel.

Je suis sous GLPI 0.90.5, ocs serveur 2.1.2 et le plugin est en version 1.2.2
Dans le plugin j'ai ceci d'afficher :

Version : 7006    Checksum : 252887

Last edited by petithomme (2016-12-01 17:14:07)


GLPI 0.90.5 - OCS 2.3.1 - Plugin OCS / GLPI 1.2.2

Offline

#2 2016-12-01 18:13:19

tsmr
GLPI-DEV
From: Rennes
Registered: 2005-08-26
Posts: 11,632
Website

Re: Bug plugin ocs

Pour moi le plugin a pas les accès sur la base

 *** PHP Warning(2): mysqli::mysqli(): (HY000/2003): Can't connect to MySQL server on 's01myc024' (99)

L'utilisateur utilisé doit avoir des droits spécifiques sur la base ocs

MariaDB> CREATE USER 'synchro'@'%' IDENTIFIED BY 'syncsecret';
MariaDB> GRANT USAGE ON *.* TO 'synchro'@'%' IDENTIFIED BY 'syncsecret';
MariaDB> GRANT SELECT ON `ocsweb`.* TO 'synchro'@'%';
MariaDB> GRANT DELETE ON `ocsweb`.`deleted_equiv` TO 'synchro'@'%';
MariaDB> GRANT UPDATE (`CHECKSUM`) ON `ocsweb`.`hardware` TO 'synchro'@'%';


Xavier Caillaud
Blog GLPI Infotel

Offline

#3 2016-12-02 10:27:46

petithomme
Member
Registered: 2009-01-05
Posts: 305

Re: Bug plugin ocs

Ok merci pour la réponse
Je vérifie ça, mais je trouve étonnant que le test via le plugin soit positif si les droits spécifiques ne sont pas valides non ?

D'autant plus que j'avais eu la même idée et que j'avais testé avec l'utilisateur root sans succès.


GLPI 0.90.5 - OCS 2.3.1 - Plugin OCS / GLPI 1.2.2

Offline

#4 2016-12-02 10:33:56

tsmr
GLPI-DEV
From: Rennes
Registered: 2005-08-26
Posts: 11,632
Website

Re: Bug plugin ocs

Non le test ne permet pas de contrôler les droits d'accès.


Xavier Caillaud
Blog GLPI Infotel

Offline

#5 2016-12-02 11:11:03

petithomme
Member
Registered: 2009-01-05
Posts: 305

Re: Bug plugin ocs

Même résultat :

php-errors.log

2016-12-02 09:54:01 [@LD2APP003P]
  *** PHP Warning(2): mysqli::mysqli(): (HY000/2003): Can't connect to MySQL server on 'S01MYC024' (99)
  Backtrace :
  :                                                  
  inc/dbmysql.class.php:118                          mysqli->mysqli()
  inc/dbmysql.class.php:82                           DBmysql->connect()
  plugins/ocsinventoryng/inc/dbocs.class.php:47      DBmysql->__construct()
  ...ins/ocsinventoryng/inc/ocsdbclient.class.php:39 PluginOcsinventoryngDBocs->__construct()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:4314 PluginOcsinventoryngOcsDbClient->__construct()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:4298 PluginOcsinventoryngOcsServer::getDBocs()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:5209 PluginOcsinventoryngOcsServer::checkOCSconnection()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:2306 PluginOcsinventoryngOcsServer::updateAdministrativeInfoUseDate()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:1598 PluginOcsinventoryngOcsServer::updateComputer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:400 PluginOcsinventoryngOcsServer::processComputer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:284 plugin_ocsinventoryng_importFromOcsServer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:159 SecondPass()

[...]

2016-12-02 09:54:01 [@LD2APP003P]
  *** PHP Warning(2): mysqli::query(): Couldn't fetch mysqli
  Backtrace :
  :                                                  
  inc/dbmysql.class.php:168                          mysqli->query()
  ...ns/ocsinventoryng/inc/ocsdbclient.class.php:526 DBmysql->query()
  plugins/ocsinventoryng/inc/ocsclient.class.php:317 PluginOcsinventoryngOcsDbClient->getComputers()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:5146 PluginOcsinventoryngOcsClient->getComputer()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:2305 PluginOcsinventoryngOcsServer::updateAdministrativeInfo()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:1598 PluginOcsinventoryngOcsServer::updateComputer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:400 PluginOcsinventoryngOcsServer::processComputer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:284 plugin_ocsinventoryng_importFromOcsServer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:159 SecondPass()

[...]

2016-12-02 09:54:08 [@LD2APP003P]
  *** PHP Notice(8): Trying to get property of non-object
  Backtrace :
  inc/dbmysql.class.php:240                          
  ...ns/ocsinventoryng/inc/ocsdbclient.class.php:528 DBmysql->numrows()
  plugins/ocsinventoryng/inc/ocsclient.class.php:317 PluginOcsinventoryngOcsDbClient->getComputers()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:2088 PluginOcsinventoryngOcsClient->getComputer()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:1598 PluginOcsinventoryngOcsServer::updateComputer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:400 PluginOcsinventoryngOcsServer::processComputer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:284 plugin_ocsinventoryng_importFromOcsServer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:159 SecondPass()

sql-errors.log

2016-12-02 09:54:01 [@LD2APP003P]
  *** MySQL query error:
  SQL: SELECT DISTINCT `hardware`.`ID` FROM `hardware`, `accountinfo`
                           WHERE `hardware`.`DEVICEID` NOT LIKE \'\\_%\'
                           AND `hardware`.`ID` = `accountinfo`.`HARDWARE_ID`
                            AND hardware.ID IN (48941) 
                           ORDER BY  LASTDATE 
                            
  Error: 
  Backtrace :
  ...ns/ocsinventoryng/inc/ocsdbclient.class.php:526 
  plugins/ocsinventoryng/inc/ocsclient.class.php:317 PluginOcsinventoryngOcsDbClient->getComputers()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:5146 PluginOcsinventoryngOcsClient->getComputer()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:2305 PluginOcsinventoryngOcsServer::updateAdministrativeInfo()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:1598 PluginOcsinventoryngOcsServer::updateComputer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:400 PluginOcsinventoryngOcsServer::processComputer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:284 plugin_ocsinventoryng_importFromOcsServer()
  ...s/ocsinventoryng/scripts/ocsng_fullsync.php:159 SecondPass()

[...]

GLPI 0.90.5 - OCS 2.3.1 - Plugin OCS / GLPI 1.2.2

Offline

#6 2016-12-02 16:35:16

petithomme
Member
Registered: 2009-01-05
Posts: 305

Re: Bug plugin ocs

Pour info, la synchro semble pourtant bien se passer si on s'en tient à l'interface :
318736ocs.png

Et si je force une synchro sur un poste manuellement, cela fonctionne.

C'est en vérifiant les logs que j'ai constaté ce bug qui me coute des dizaines de Mo de log à chaques synchros hmm

Last edited by petithomme (2016-12-02 18:03:56)


GLPI 0.90.5 - OCS 2.3.1 - Plugin OCS / GLPI 1.2.2

Offline

#7 2016-12-05 10:39:41

petithomme
Member
Registered: 2009-01-05
Posts: 305

Re: Bug plugin ocs

Personne n'a d'idée ?


GLPI 0.90.5 - OCS 2.3.1 - Plugin OCS / GLPI 1.2.2

Offline

#8 2016-12-05 14:40:50

tsmr
GLPI-DEV
From: Rennes
Registered: 2005-08-26
Posts: 11,632
Website

Re: Bug plugin ocs

Quand tu appelles le script ocsng_fullsync.sh , quelles sont les paramètres que tu utilises ?


Xavier Caillaud
Blog GLPI Infotel

Offline

#9 2016-12-05 17:56:36

petithomme
Member
Registered: 2009-01-05
Posts: 305

Re: Bug plugin ocs

--server_id=1 --thread_nbr=4

Je n'ai qu'un serveur OCS.


GLPI 0.90.5 - OCS 2.3.1 - Plugin OCS / GLPI 1.2.2

Offline

#10 2016-12-05 18:17:40

tsmr
GLPI-DEV
From: Rennes
Registered: 2005-08-26
Posts: 11,632
Website

Re: Bug plugin ocs

Avez-vous selinux sur votre serveur ?

http://stackoverflow.com/questions/3407 … ct-problem

setsebool -P httpd_can_network_connect=1


Xavier Caillaud
Blog GLPI Infotel

Offline

#11 2016-12-05 18:41:26

petithomme
Member
Registered: 2009-01-05
Posts: 305

Re: Bug plugin ocs

Sur le serveur php / mysql de glpi oui et la valeur est bien à 1.
Sur le serveur mysql d'OCS non.


GLPI 0.90.5 - OCS 2.3.1 - Plugin OCS / GLPI 1.2.2

Offline

#12 2016-12-06 10:16:39

tsmr
GLPI-DEV
From: Rennes
Registered: 2005-08-26
Posts: 11,632
Website

Re: Bug plugin ocs

Bonjour

Déjà je pense qu'il faudrait upgrader votre instance OCS car votre version comporte un bug impactant la synchronisation GLPI :
https://github.com/pluginsGLPI/ocsinven … CS-2.1-Bug


Xavier Caillaud
Blog GLPI Infotel

Offline

Board footer

Powered by FluxBB