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 2021-01-12 12:49:21

brusilva
Member
Registered: 2020-11-17
Posts: 29

PHP Erros

I'm getting this error on my logs:

CommonDBTM::getFromDBByCrit() in /var/www/html/glpi/inc/commondbtm.class.php line 351
getFromDBByCrit expects to get one result, 97 found!

Anyone knows what to do about it?

Offline

#2 2021-01-12 13:13:45

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

Re: PHP Erros

Which version of GLPI are you using?
Is there a stack trace/Backtrace with that error? It will help identify where in GLPI or a plugin the fault occurs.


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 2021-01-12 13:37:47

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,241

Re: PHP Erros

GLPI9.4.6
i also get these errors in log:

[2021-01-11 23:11:09] glpiphplog.WARNING: CommonDBTM::getFromDBByCrit() in /var/www/html/glpi/inc/commondbtm.class.php line 386
getFromDBByCrit expects to get one result, 2 found!  {"user":"@hdvapp153-test"}

this happens when synchronising user with active directory :

php ldap_mass_sync.php -server_id=2 action=2 > /dev/null


Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9

Offline

#4 2021-01-14 18:59:22

brusilva
Member
Registered: 2020-11-17
Posts: 29

Re: PHP Erros

Managed to solve this by doing

changed the commondbtm.class file

sprintf(
               'getFromDBByCrit expects to get one result, %1$s found!',
               /*count($iter)*/
               print_r($crit['WHERE'],1)
       )

         );

That way it printed me the table it was checking. On my case was some networkports... deleted them and the error disappeared

Offline

#5 2021-01-15 17:01:43

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,241

Re: PHP Erros

@brusilva  thanks for your tip

i could find my duplicate users ( same CN but 2 different logins)


Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9

Offline

Board footer

Powered by FluxBB