pluginsGLPI / ocsinventoryng

Plugin ocsinventoryng for GLPI
GNU General Public License v2.0
68 stars 52 forks source link

Error in plugin, I cannot import new computers #234

Closed jcervantes-sipecom closed 4 years ago

jcervantes-sipecom commented 4 years ago

Hi, I cannot import some new computers, and I'm getting this error in debug mode:

PHP Notice: Undefined index: import_user_group_default in /var/www/html/glpi/plugins/ocsinventoryng/inc/hardware.class.php at line 412
PHP Notice: Undefined index: import_user_group_default in /var/www/html/glpi/plugins/ocsinventoryng/inc/hardware.class.php at line 412

Fatal error: Uncaught Error: Call to a member function fetch_assoc() on boolean in /var/www/html/glpi/inc/dbmysql.class.php:330 Stack trace: #0 /var/www/html/glpi/plugins/ocsinventoryng/inc/ocsdbclient.class.php(403): DBmysql->fetch_assoc(false) #1 /var/www/html/glpi/plugins/ocsinventoryng/inc/ocsdbclient.class.php(1020): PluginOcsinventoryngOcsDbClient->getComputerSections(Array, 524159, 1, 31, 0) #2 /var/www/html/glpi/plugins/ocsinventoryng/inc/ocsclient.class.php(373): PluginOcsinventoryngOcsDbClient->getComputers(Array, '7510') #3 /var/www/html/glpi/plugins/ocsinventoryng/inc/ocsprocess.class.php(1149): PluginOcsinventoryngOcsClient->getComputer('7510', Array) #4 /var/www/html/glpi/plugins/ocsinventoryng/inc/ocsprocess.class.php(614): PluginOcsinventoryngOcsProcess::synchronizeComputer(Array) #5 /var/www/html/glpi/plugins/ocsinventoryng/inc/ocsprocess.class.php(480): PluginOcsinventoryngOcsProcess::importComputer(Array) #6 /var/www/html/glpi/plugins/ocsinventoryng/front/ocsng.import.php(75): PluginOcsinventoryngOcsPro in /var/www/html/glpi/inc/dbmysql.class.php on line 330

The /var/www/html/glpi/files/_log/sql-errors.log

[2020-02-20 16:03:56] glpisqllog.ERROR: DBmysql::query() in /var/www/html/glpi/inc/dbmysql.class.php line 188
  *** MySQL query error:
  SQL: SELECT `ID`, `HARDWARE_ID`, `OFFICEVERSION`, `PRODUCT`, `OFFICEKEY`, `NOTE`
                              FROM `officepack`
                              WHERE `HARDWARE_ID` IN (8235)
                              AND `INSTALL` = 1
  Error: Unknown column 'INSTALL' in 'where clause'
  Backtrace :
  ...ns/ocsinventoryng/inc/ocsdbclient.class.php:402
  ...s/ocsinventoryng/inc/ocsdbclient.class.php:1020 PluginOcsinventoryngOcsDbClient->getComputerSections()
  plugins/ocsinventoryng/inc/ocsclient.class.php:373 PluginOcsinventoryngOcsDbClient->getComputers()
  ...ns/ocsinventoryng/inc/ocsprocess.class.php:1149 PluginOcsinventoryngOcsClient->getComputer()
  ...ins/ocsinventoryng/inc/ocsprocess.class.php:771 PluginOcsinventoryngOcsProcess::synchronizeComputer()
  ...ins/ocsinventoryng/inc/ocsprocess.class.php:582 PluginOcsinventoryngOcsProcess::linkComputer()
  ...ins/ocsinventoryng/inc/ocsprocess.class.php:480 PluginOcsinventoryngOcsProcess::importComputer()
  plugins/ocsinventoryng/front/ocsng.import.php:75   PluginOcsinventoryngOcsProcess::processComputer()
  {"user":"7@sg01ilinv3sipe"}
[2020-02-20 16:08:35] glpisqllog.ERROR: DBmysql::query() in /var/www/html/glpi/inc/dbmysql.class.php line 188
  *** MySQL query error:
  SQL: SELECT `ID`, `HARDWARE_ID`, `OFFICEVERSION`, `PRODUCT`, `OFFICEKEY`, `NOTE`
                              FROM `officepack`
                              WHERE `HARDWARE_ID` IN (7510)
                              AND `INSTALL` = 1
  Error: Unknown column 'INSTALL' in 'where clause'
  Backtrace :
  ...ns/ocsinventoryng/inc/ocsdbclient.class.php:402
  ...s/ocsinventoryng/inc/ocsdbclient.class.php:1020 PluginOcsinventoryngOcsDbClient->getComputerSections()
  plugins/ocsinventoryng/inc/ocsclient.class.php:373 PluginOcsinventoryngOcsDbClient->getComputers()
  ...ns/ocsinventoryng/inc/ocsprocess.class.php:1149 PluginOcsinventoryngOcsClient->getComputer()
  ...ins/ocsinventoryng/inc/ocsprocess.class.php:614 PluginOcsinventoryngOcsProcess::synchronizeComputer()
  ...ins/ocsinventoryng/inc/ocsprocess.class.php:480 PluginOcsinventoryngOcsProcess::importComputer()
  plugins/ocsinventoryng/front/ocsng.import.php:75   PluginOcsinventoryngOcsProcess::processComputer()
  {"user":"7@sg01ilinv3sipe","mem_usage":"0.283\", 14.98Mio)"}

I provide you the info what you need :

tsmr commented 4 years ago

You must launch from SQL :

ALTER TABLEglpi_plugin_ocsinventoryng_ocsserversADDimport_user_group_defaulttinyint(1) NOT NULL DEFAULT '1';

For SQL errors You a problem into your OCS Server (the field exists) https://github.com/PluginsOCSInventory-NG/officepack/blob/3.1/sql/officepack.sql