You are not logged in.
Pages: 1
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
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
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
Non le test ne permet pas de contrôler les droits d'accès.
Xavier Caillaud
Blog GLPI Infotel
Offline
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
Pour info, la synchro semble pourtant bien se passer si on s'en tient à l'interface :
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
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
Personne n'a d'idée ?
GLPI 0.90.5 - OCS 2.3.1 - Plugin OCS / GLPI 1.2.2
Offline
Quand tu appelles le script ocsng_fullsync.sh , quelles sont les paramètres que tu utilises ?
Xavier Caillaud
Blog GLPI Infotel
Offline
--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
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
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
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
Pages: 1