pluginsGLPI / ocsinventoryng

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

Partial Import with various errors #354

Open silvanetgmcs opened 1 year ago

silvanetgmcs commented 1 year ago

Plugin Version 2.04 GLPI Version 10.0.7 OCSReports Version 2.11.1

I have over 10,000 devices in OCSInventory. The import into GLPI brings over 7,000 but however not all of the devices get imported into GLPI. I have no filters on imports.

In ocsng_fullsync.log, I see lots of these messages


PHP Deprecated:  Creation of dynamic property PluginOcsinventoryngOcsDbClient::$dbname is deprecated in /var/www/glpi/marketplace/ocsinventoryng/inc/ocsdbclient.class.php on line 55

PHP Deprecated function (8192): Creation of dynamic property PluginOcsinventoryngOcsDbClient::$dbname is deprecated in /var/www/glpi/marketplace/ocsinventoryng/inc/ocsdbclient.class.php at line 55

PHP User Warning (512): Relation between "glpi_networkports" and "glpi_plugin_ocsinventoryng_networkports" table based on "networkports_id" field cannot be handled automatically as "networkports_id" also corresponds to index field of the target table. in /var/www/glpi/src/DbUtils.php at line 2091

Anything thoughts or what I should look at next?

silvanetgmcs commented 1 year ago

I do not know if this will help in the php-errors.log I get this

[2023-04-24 01:20:22] glpiphplog.WARNING:   *** PHP User Warning (512): Relation between "glpi_networkports" and "glpi_plugin_ocsinventoryng_networkports" table based on "networkports_id" field cannot be handled automatically as "networkports_id" also corresponds to index field of the target table. in /var/www/glpi/src/DbUtils.php at line 2091
  Backtrace :
  src/DbUtils.php:2091                               trigger_error()
  inc/db.function.php:585                            DbUtils->getDbRelations()
  src/CommonDBTM.php:866                             getDbRelations()
  src/CommonDBTM.php:788                             CommonDBTM->cleanRelationData()
  src/CommonDBTM.php:2064                            CommonDBTM->deleteFromDB()
  ...ce/ocsinventoryng/inc/networkport.class.php:502 CommonDBTM->delete()
  ...etplace/ocsinventoryng/inc/device.class.php:545 PluginOcsinventoryngNetworkPort::importNetwork()
  ...ce/ocsinventoryng/inc/ocsprocess.class.php:1330 PluginOcsinventoryngDevice::updateDevices()
  ...ace/ocsinventoryng/inc/ocsprocess.class.php:480 PluginOcsinventoryngOcsProcess::synchronizeComputer()
  ...e/ocsinventoryng/scripts/ocsng_fullsync.php:461 PluginOcsinventoryngOcsProcess::processComputer()
  ...e/ocsinventoryng/scripts/ocsng_fullsync.php:298 plugin_ocsinventoryng_importFromOcsServer()
  ...e/ocsinventoryng/scripts/ocsng_fullsync.php:179 SecondPass()
TylerVD commented 1 year ago

Hello,

Same here since update to 10.0.7 and logs size is increasing.

image
Stufo76 commented 1 year ago

Same here, anyone found a solution?

kabassanov commented 1 year ago

Similar issue: https://github.com/pluginsGLPI/ocsinventoryng/issues/355

enryfantasy commented 1 year ago

I solved editing file /var/www/glpi/marketplace/ocsinventoryng/inc/ocsdbclient.class.php adding ad line 42 the following code:

private $dname;

TylerVD commented 1 year ago

Hi @enryfantasy,

I will try this for me. Do you mean $dbname or $dname ?

Thx !

enryfantasy commented 1 year ago

I mean $dbname. Sorry for the mistake.

Il ven 30 giu 2023, 13:35 TylerVD @.***> ha scritto:

Hi @enryfantasy https://github.com/enryfantasy,

I will try this for me. Do you mean $dbname or $dname ?

Thx !

— Reply to this email directly, view it on GitHub https://github.com/pluginsGLPI/ocsinventoryng/issues/354#issuecomment-1614527152, or unsubscribe https://github.com/notifications/unsubscribe-auth/APURLYP4LHIYZRAO3JMFEJTXN22XFANCNFSM6AAAAAAXI4RBLM . You are receiving this because you were mentioned.Message ID: @.***>

JastrzebskiKrzysztof commented 1 year ago

I mean $dbname. Sorry for the mistake. Il ven 30 giu 2023, 13:35 TylerVD @.***> ha scritto: Tried, but it does not solve in my environment...

JastrzebskiKrzysztof commented 1 year ago

OS: debian 12 PHP: 8.2.7-1~deb12u1 GLPI: 10.0.10 (git) OCSNG: 2.11.1 rev. 7069 (git) ocsinventory-agent: 2.10.0-3 (deb) ocsinventoryng plugin: 2.0.4 rev. 15930 (git)

Same problem here. All work with assigning NIC's to swiches ports lost :-( Force full resync is not an option - overwritten with next ocsng sync cronjob...

ozit commented 9 months ago

Thanks @enryfantasy ! Adding private $dbname; line 42 resume the issue. :-)

Mirkk commented 9 months ago

Hi, unfortunately for me this does not solve the 3rd error in the original post, which is probably the origin for getting networks only on every second synchronisation: PHP User Warning (512): Relation between "glpi_networkports" and "glpi_plugin_ocsinventoryng_networkports" table based on "networkports_id" field cannot be handled automatically as "networkports_id" also corresponds to index field of the target table. in /var/www/glpi/src/DbUtils.php at line 2091

Note: this is also NOT solved by 8433a4822d7693619981adfcd0c5a934633a55ec