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 2023-06-15 09:04:50

itheesh
Member
Registered: 2022-11-21
Posts: 25

Error when importing rules exported xml from other server

HI,
  When trying to import the XML file of the rules from another server to the test server, the xml exported is showing.

In debugging mode, it is showing error:-

"Uncaught Exception RuntimeException: Empty IN are not allowed in /var/www/html/glpi/src/DBmysqlIterator.php at line 588"

My server is 10.0.6 updated from 10.0.5 recently.

Is this a bug or any rights issue?

Offline

#2 2023-06-15 12:14:13

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,813
Website

Re: Error when importing rules exported xml from other server

Please provide the complete error stack trace from the "files/_log/php-errors.log" file.


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#3 2023-06-16 11:51:28

itheesh
Member
Registered: 2022-11-21
Posts: 25

Re: Error when importing rules exported xml from other server

Hi,
Thank you for that reply. Here is the error shown in the php log file.

[2023-06-16 15:16:19] glpiphplog.CRITICAL:   *** Uncaught Exception RuntimeException: Empty IN are not allowed in /var/www/html/glpi/src/DBmysqlIterator.php at line 588
  Backtrace :
  src/DBmysqlIterator.php:559                        DBmysqlIterator->analyseCriterion()
  src/DBmysqlIterator.php:314                        DBmysqlIterator->analyseCrit()
  src/DBmysqlIterator.php:111                        DBmysqlIterator->buildQuery()
  src/DBmysql.php:1056                               DBmysqlIterator->execute()
  src/CommonDBTM.php:577                             DBmysql->request()
  src/RuleCollection.php:1242                        CommonDBTM->find()
  front/rule.backup.php:61                           RuleCollection::previewImportRules()

Offline

#4 2023-06-16 16:49:51

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,813
Website

Re: Error when importing rules exported xml from other server

It seems like one or more pattern properties for criteria are invalid and look like empty arrays when processed by GLPI.
I don't know if there is an issue with the rule(s) themselves or the way GLPI exported it though.


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#5 2023-06-17 13:30:27

itheesh
Member
Registered: 2022-11-21
Posts: 25

Re: Error when importing rules exported xml from other server

Actually, the rules are been exported from another server which is our production server. The production server 10.0.6 has been updated recently. In this server, the rules for authorization and others are working fine.

Before upgrading to 10.0.6 I had exported the rule to our test server. It was working fine at that time. The error happened only after the upgradation.

Offline

#6 2023-06-17 13:31:28

itheesh
Member
Registered: 2022-11-21
Posts: 25

Re: Error when importing rules exported xml from other server

I will share the XML if you want to...

Offline

#7 2023-06-21 07:27:07

itheesh
Member
Registered: 2022-11-21
Posts: 25

Re: Error when importing rules exported xml from other server

Hi,
As you have told I have checked the rules one by one and found errors while importing one rule in "Authorizations assignment rules". But I couldn't understand why it is causing the error. I am sharing the XML of that file.

<?xml version="1.0"?>
<rules><rule><entities_id>Root Entity</entities_id><sub_type>RuleRight</sub_type><ranking>82</ranking><name>Entity assignment rules-Editorial xxxxx </name><description>xxxxxx  Editorial office</description><match>AND</match><is_active>1</is_active><comment>Assign the entity xxxxxx for the users</comment><is_recursive>0</is_recursive><uuid>e346c578-e509fb39-648a89e6ac77b1.78018908</uuid><condition>0</condition><date_creation>2023-06-15 09:17:50</date_creation><rulecriteria><criteria>LDAP_SERVER</criteria><condition>0</condition><pattern>xxxxx.COM</pattern></rulecriteria><rulecriteria><criteria>dn</criteria><condition>5</condition><pattern>OU=Editorial Daily,OU=Head Office,OU=xxxxxx,DC=MPP,DC=COM</pattern></rulecriteria><ruleaction><action_type>assign</action_type><field>entities_id</field><value>Root Entity &amp;#62; xxxxx_xxxx &amp;#62; xxxxxx &amp;#62; Headoffice &amp;#62; Editorial_Headoffice</value></ruleaction><ruleaction><action_type>assign</action_type><field>_entities_id_default</field><value>Root Entity &amp;#62; xxx_xxxx &amp;#62; xxxxxxx &amp;#62; Headoffice &amp;#62; Editorial_Headoffice</value></ruleaction><ruleaction><action_type>assign</action_type><field>specific_groups_id</field><value></value></ruleaction><ruleaction><action_type>assign</action_type><field>groups_id</field><value>xxxx_Editorial department</value></ruleaction></rule></rules>

Offline

#8 2023-06-21 20:22:54

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,813
Website

Re: Error when importing rules exported xml from other server

Sorry, I forgot to link the pull request I made for a possible fix after it was approved.
You can find a possible fix here:
https://github.com/glpi-project/glpi/pull/14946


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#9 2023-07-01 13:43:20

itheesh
Member
Registered: 2022-11-21
Posts: 25

Re: Error when importing rules exported xml from other server

Thank you for that reply. I have tested. But I am another error saying that action was refused for the rule. This was the same rule for which I got the error.
The action was refused for the Field - group, Action -Assign

Offline

Board footer

Powered by FluxBB