antedebaas / Viesti-Reports

DMARC & SMTP-TLS Reports processor and visualizer and BIMI file hoster
https://docs.viestireports.com/
GNU Affero General Public License v3.0
82 stars 16 forks source link

BUG: Error 500 deleting Microsoft Corporation SMTPTLS reports #91

Closed MarcosBL closed 6 months ago

MarcosBL commented 6 months ago

"500 Internal Server Error" while trying to delete a Microsoft Corporation SMTPTLS report

TLDR Error:

NOTICE: PHP message: [critical] Uncaught Exception: An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (sys_dmarc_reports.smtptls_rdata_records, CONSTRAINT FK_65C68ADB2D29E3C6 FOREIGN KEY (policy_id) REFERENCES smtptls_policies (id))

Docker log:

2024/05/16 01:46:09 [error] 18#18: *183 FastCGI sent in stderr: "PHP message: [critical] Uncaught Exception: An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`sys_dmarc_reports`.`smtptls_rdata_records`, CONSTRAINT `FK_65C68ADB2D29E3C6` FOREIGN KEY (`policy_id`) REFERENCES `smtptls_policies` (`id`))" while reading response header from upstream, client: 172.17.0.1, server: _, request: "GET /reports/smtptls/delete/34 HTTP/1.0", upstream: "fastcgi://unix:/run/php-fpm.sock:", host: "emailreports.REDACTED.es", referrer: "https://emailreports.REDACTED.es/reports/smtptls?page=1&perpage=17"
172.17.0.1 - - [16/May/2024:01:46:09 +0200] "GET /reports/smtptls/delete/34 HTTP/1.0" 500 1017 "https://emailreports.REDACTED.es/reports/smtptls?page=1&perpage=17" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" "83.34.0.121" 0.105 0.105 . -

Sample report

image

Thank you very much for the project!

antedebaas commented 6 months ago

found the root cause. this should be fixed in 1.12.4. let me know if you still encounter issues

MarcosBL commented 6 months ago

Fixed, thanks ! :tada: