Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot delete or update a parent row: a foreign key constraint fails #747

Closed
emmettprexus opened this issue Mar 30, 2022 · 4 comments · Fixed by #789
Closed

Cannot delete or update a parent row: a foreign key constraint fails #747

emmettprexus opened this issue Mar 30, 2022 · 4 comments · Fixed by #789
Labels
bug Something isn't working

Comments

@emmettprexus
Copy link

emmettprexus commented Mar 30, 2022

Hashtopolis server: 0.12.0
Hashtopolis client: 0.6.1.6
Hashcat: 6.2.5 (ARM build)

I'm trying to delete a hash-list via the UI and API but get a 500. The following is in the error.log:

[php:error] [pid 137079] [client 192.168.1.49:51129] PHP Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (hashtopolis.AgentZap, CONSTRAINT AgentZap_ibfk_2 FOREIGN KEY (lastZapId) REFERENCES Zap (zapId)) in /var/www/html/dba/AbstractModelFactory.class.php:769\nStack trace:\n#0 /var/www/html/dba/AbstractModelFactory.class.php(769): PDOStatement->execute()\n#1 /var/www/html/inc/utils/HashlistUtils.class.php(510): DBA\\AbstractModelFactory->massDeletion()\n#2 /var/www/html/inc/handlers/HashlistHandler.class.php(65): HashlistUtils::delete()\n#3 /var/www/html/hashlists.php(31): HashlistHandler->handle()\n#4 {main}\n thrown in /var/www/html/dba/AbstractModelFactory.class.php on line 769, referer: http://x/hashlists.php

I was able to reproduce it:

  1. Create a hashlist
  2. Create a task
  3. While task is running, delete the task
  4. Delete the hashlist boom

This happens both using the UI and the API.

@zyronix zyronix added the bug Something isn't working label Apr 6, 2022
@s3inlc
Copy link
Member

s3inlc commented Jun 26, 2022

Can you please test if the fix in the issue/747 branch fixes your issue?

@emmettprexus
Copy link
Author

Can you please test if the fix in the issue/747 branch fixes your issue?

I have tested the fix and can confirm that it is now working! Great!

@zyronix
Copy link
Member

zyronix commented Jun 29, 2022

Created pull request for this, tested and can confirm that it is fixed.

@s3inlc
Copy link
Member

s3inlc commented Jun 29, 2022

Thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Done
3 participants