pluginsGLPI / ocsinventoryng

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

PHP errors when sincronize #336

Closed jjmg84 closed 1 year ago

jjmg84 commented 1 year ago

Hi, when sincronize we have these error recurently , too many times on log:

2022-10-31 13:04:43] glpiphplog.WARNING: *** PHP Warning (2): preg_match_all(): Unknown modifier ']' in /var/www/glpi10/src/RuleCriteria.php at line 494 Backtrace : src/RuleCriteria.php:494 preg_match_all() src/Rule.php:1702 RuleCriteria::match() src/Rule.php:1624 Rule->checkCriteria() src/Rule.php:1507 Rule->checkCriterias() src/RuleCollection.php:1591 Rule->process() src/CommonDBTM.php:5630 RuleCollection->processAllRules() src/CommonDBTM.php:1595 CommonDBTM->assetBusinessRules() plugins/ocsinventoryng/inc/hardware.class.php:251 CommonDBTM->update() ...ins/ocsinventoryng/inc/ocsprocess.class.php:901 PluginOcsinventoryngHardware::updateComputerHardware() ...ins/ocsinventoryng/inc/ocsprocess.class.php:471 PluginOcsinventoryngOcsProcess::synchronizeComputer() ...s/ocsinventoryng/scripts/ocsng_fullsync.php:448 PluginOcsinventoryngOcsProcess::processComputer() ...s/ocsinventoryng/scripts/ocsng_fullsync.php:297 plugin_ocsinventoryng_importFromOcsServer() ...s/ocsinventoryng/scripts/ocsng_fullsync.php:179 SecondPass()

Versions:

Thanks in advance, if more information is needed please ask it

tsmr commented 1 year ago

There is a problem with a rule of your rule engine

jjmg84 commented 1 year ago

There is a problem with a rule of your rule engine

We review all rules and all seems to be okay, and with GLPI 9 it was working allright, how we can debug the rule engine?

Thanks,

eabreu218 commented 1 year ago

I had the same error messages on a server upgraded from 9.5 to 10.0.5

I just found out there was a problem on this server with rule "Business rules for assets / Multiple users: assign to the first". 3rd Criterion for that rule was : 'Alternate username regular expression matches /(.*)[,|/]/' That pattern should be '/(.*)[,|\/]/'

I believe this problem must be caused by some upgrade script: