-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Duplicates deletion error #6217
Comments
I would really like to activate duplicate deletion but I guess it would be safer to fix this issue first. Is there any investigation on this issue? |
we also have the same issue. any plan to fix it soon :-( |
Same for us. We have the same but in 2.19.2 version. |
There is a possible solution in the linked Draft Pull Request, it's currently having trouble with the JIRA integration's unit tests. This is holding it back from leaving its draft state. Feel free to take a look - maybe you have a idea for that situation. |
Is there any update on this or plan when this will be fixed? |
Also affects uploading large trivy.json results via pipeline if import takes over 1 minute. |
A hot fix of changing the following settings allowed me to upload the 5mb trivy scan import.
|
any updates regarding this? |
The PR is quite a big change in transactional behaviour, which might be hard to predict what the impact will be on all the different use cases people are using Defect Dojo imports. It would also be an option to create the Test_Import_Finding_Action objects instantly during import instead of after the import process has completed. |
The history is created using django-DefectDojo/dojo/importers/base_importer.py Lines 360 to 391 in d3b3c26
The The only "correct" solution is to indeed go with transactions, but as stated before that impact is or might be quite big so needs further consideration and testing. For now the safest way would be to create the import history records one-by-one instead of using What do you think @Maffooch ? |
Great analysis on this one. I think your proposal here would be the safe bet for a baby step approach. If all well goes there, we could further explore the idea of creating finding actions right after the action on the finding is made
|
I have created multiple PRs. Option A: Use try-catch to catch the IntegrityError -> #11739 Option B: Inline the creation of history and tag objects -> #11740 Option C: Postponse dedupe and JIRA pushing -> #11741 The PRs are all in draft to get some feedback from other Defect Dojo developers including @Maffooch I'm a bit torn between Option A and Option B. |
Option A was merged into bugfix and should be out in 2.43.3. @kokhanevych-macpaw @bgoareguer @sameeraksc @MathRig @fhoeborn @quirinziessler @MRagulin |
thank you for addressing this |
Bug description
I found the issue with duplicates deletion. When I enabled this feature I started to face such errors sometimes during report uploading:
{"message":"Internal server error, check logs for details"}
In django logs I found the error:
As I understand DD tried to find a finding that was deleted as a duplicate.
@valentijnscholten commented on Slack:
"The job to delete duplicates runs every minute, so if you have an import that runs longer than that, there may be a race condition that newly imported findings which are duplicates of existing findings are deleted before the import is complete. I can't remember exactly what the transactional model is in django, but probably not everything runs in a transaction so duplicates become visible to the job that deletes duplicates before the import is completed."
Steps to reproduce
Steps to reproduce the behavior:
{"message":"Internal server error, check logs for details"}
Expected behavior
The report should be imported successfully.
Deployment method (select with an
X
)X
] KubernetesEnvironment information
Logs
The text was updated successfully, but these errors were encountered: