Skip to main content
Solved

Impossible to import users using LDAP

  • May 20, 2022
  • 3 replies
  • 521 views

Forum|alt.badge.img+3

Hello
I have a strange behavior when I import certain ldap users
I get a blank Contacts/Users page

I enabled ldap debug, and on centreon-error.log, there is this error every time I try to import an user

PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`centreon`.`contactgroup_contact_relation`, CONSTRAINT `contactgroup_contact_relation_ibfk_1` FOREIGN KEY (`contact_contact_id`) REFERENCES `contact` (`contact_id`) ON DELETE CASCADE) in /usr/share/centreon/www/class/centreonDB.class.php:274
Stack trace:
#0 /usr/share/centreon/www/include/configuration/configObject/contact/DB-Func.php(1277): CentreonDB->query('INSERT INTO con...')
#1 /usr/share/centreon/www/include/configuration/configObject/contact/ldapImportContact.php(134): insertLdapContactInDB(Array)
#2 /usr/share/centreon/www/include/configuration/configObject/contact/contact.php(168): require_once('/usr/share/cent...')
#3 /usr/share/centreon/www/main.get.php(257): include_once('/usr/share/cent...')
#4 {main}
thrown in /usr/share/centreon/www/class/centreonDB.class.php on line 274

I checked those tables where it say there is constraint violation, and I did not find any violation

the user that I try to add, had been deleted, and I tried to add them again

I’m using ActiveDirectory

Centreon version 20.10

 

Thank you

Best answer by wadOps

problem solved

there was another ldap connection which had users with the same name
and that created data base constrainte

3 replies

sduret
Centreonian
Forum|alt.badge.img+13
  • Centreonian
  • May 24, 2022

Hi @wadOps 
Can you go on the page Administration > Parameters > Debug and enable the SQL debug?
After doign that, can you import the contact again and check the logfile /var/log/centreon/sql-error.log?


Forum|alt.badge.img+3
  • Author
  • Steward *
  • May 30, 2022

Hello @sduret,

Thank you for reply

I did what have you told, I tried adding those users multiple times, but every time, sql-error.log is always empty


Forum|alt.badge.img+3
  • Author
  • Steward *
  • Answer
  • July 27, 2022

problem solved

there was another ldap connection which had users with the same name
and that created data base constrainte