janus-ssp / janus

Fully featured metadata registration administration module built on top of simpleSAMLphp.
Other
13 stars 8 forks source link

Deleting a user fails with constraint violation #507

Open thijskh opened 10 years ago

thijskh commented 10 years ago

When pressing Delete on a user on test that was created just moments before by the automatic user creation feature, seemingly nothing happens; the Ajax call receives an error 500 because of:

Sep 17 14:58:13 simplesamlphp ERROR [0c8ef81c3a] SimpleSAML_Error_Error: UNHANDLEDEXCEPTION
Sep 17 14:58:13 simplesamlphp ERROR [0c8ef81c3a] Backtrace:
Sep 17 14:58:13 simplesamlphp ERROR [0c8ef81c3a] 0 /opt/data/test/OpenConext-serviceregistry/simplesamlphp/www/module.php:180 (N/A)
Sep 17 14:58:13 simplesamlphp ERROR [0c8ef81c3a] Caused by: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`sr`.`janus__message`, CONSTRAINT `FK_560D05EB018BCAC` FOREIGN KEY (`from`) REFERENCES `janus__user` (`uid`))
Sep 17 14:58:13 simplesamlphp ERROR [0c8ef81c3a] Backtrace:
Sep 17 14:58:13 simplesamlphp ERROR [0c8ef81c3a] 6 /opt/data/test/OpenConext-serviceregistry/simplesamlphp/modules/janus/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php:131 (PDOStatement::execute)
Sep 17 14:58:13 simplesamlphp ERROR [0c8ef81c3a] 5 /opt/data/test/OpenConext-serviceregistry/simplesamlphp/modules/janus/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php:131 (Doctrine\DBAL\Statement::execute)
Sep 17 14:58:13 simplesamlphp ERROR [0c8ef81c3a] 4 /opt/data/test/OpenConext-serviceregistry/simplesamlphp/modules/janus/lib/Database.php:113 (sspmod_janus_Database::execute)
Sep 17 14:58:13 simplesamlphp ERROR [0c8ef81c3a] 3 /opt/data/test/OpenConext-serviceregistry/simplesamlphp/modules/janus/lib/User.php:475 (sspmod_janus_User::delete)
Sep 17 14:58:13 simplesamlphp ERROR [0c8ef81c3a] 2 /opt/data/test/OpenConext-serviceregistry/simplesamlphp/modules/janus/www/AJAXRequestHandler.php:417 (deleteUser)
Sep 17 14:58:13 simplesamlphp ERROR [0c8ef81c3a] 1 /opt/data/test/OpenConext-serviceregistry/simplesamlphp/modules/janus/www/AJAXRequestHandler.php:137 (require)
Sep 17 14:58:13 simplesamlphp ERROR [0c8ef81c3a] 0 /opt/data/test/OpenConext-serviceregistry/simplesamlphp/www/module.php:135 (N/A)
Sep 17 14:58:13 simplesamlphp ERROR [0c8ef81c3a] Error report with id 61d31256 generated.