-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Unique constraint violation while mirroring NVD via feed files #3663
Comments
nscuro
added a commit
to nscuro/dependency-track
that referenced
this issue
May 1, 2024
The fix is achieved by using the same logic for persisting `Vulnerability` and `VulnerableSoftware` records that `NistApiMirrorTask` was already using. It handles duplicate records. This should also yield a performance boost (did not benchmark because that wasn't the focus of this change), since the transaction commit frequency is reduced compared to the previous logic. Fixes DependencyTrack#3663 Signed-off-by: nscuro <[email protected]>
2 tasks
nscuro
added a commit
to nscuro/dependency-track
that referenced
this issue
May 1, 2024
The fix is achieved by using the same logic for persisting `Vulnerability` and `VulnerableSoftware` records that `NistApiMirrorTask` was already using. It handles duplicate records. This should also yield a performance boost (did not benchmark because that wasn't the focus of this change), since the transaction commit frequency is reduced compared to the previous logic. Fixes DependencyTrack#3663 Signed-off-by: nscuro <[email protected]>
nscuro
added a commit
to nscuro/dependency-track
that referenced
this issue
May 1, 2024
The fix is achieved by using the same logic for persisting `Vulnerability` and `VulnerableSoftware` records that `NistApiMirrorTask` was already using. It handles duplicate records. This should also yield a performance boost (did not benchmark because that wasn't the focus of this change), since the transaction commit frequency is reduced compared to the previous logic. Fixes DependencyTrack#3663 Signed-off-by: nscuro <[email protected]>
nscuro
added a commit
to nscuro/dependency-track
that referenced
this issue
May 2, 2024
Some CVE records contain duplicate CPEs. The original parsing logic did not de-duplicate those, consequently causing duplicate `VulnerableSoftware` records in the database. De-duplication was already handled in `NistApiMirrorTask`, but not `NistMirrorTask`. Relates to DependencyTrack#3663 Signed-off-by: nscuro <[email protected]>
2 tasks
rkg-mm
pushed a commit
to rkg-mm/dependency-track
that referenced
this issue
May 5, 2024
The fix is achieved by using the same logic for persisting `Vulnerability` and `VulnerableSoftware` records that `NistApiMirrorTask` was already using. It handles duplicate records. This should also yield a performance boost (did not benchmark because that wasn't the focus of this change), since the transaction commit frequency is reduced compared to the previous logic. Fixes DependencyTrack#3663 Signed-off-by: nscuro <[email protected]>
rkg-mm
pushed a commit
to rkg-mm/dependency-track
that referenced
this issue
May 5, 2024
Some CVE records contain duplicate CPEs. The original parsing logic did not de-duplicate those, consequently causing duplicate `VulnerableSoftware` records in the database. De-duplication was already handled in `NistApiMirrorTask`, but not `NistMirrorTask`. Relates to DependencyTrack#3663 Signed-off-by: nscuro <[email protected]>
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
MM-msr
pushed a commit
to MM-msr/dependency-track
that referenced
this issue
Jun 18, 2024
The fix is achieved by using the same logic for persisting `Vulnerability` and `VulnerableSoftware` records that `NistApiMirrorTask` was already using. It handles duplicate records. This should also yield a performance boost (did not benchmark because that wasn't the focus of this change), since the transaction commit frequency is reduced compared to the previous logic. Fixes DependencyTrack#3663 Signed-off-by: nscuro <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Current Behavior
Mirroring the NVD via feed files can fail due to unique constraint violations in the
AFFECTEDVERSIONATTRIBUTION
table:Mirroring via API does not seem to be affected. Taking an educated guess here, the logic that processes the feed files can sometimes create duplicate
Vulnerability
<->VulnerableSoftware
relationships. I had to deal with that while implementing the API mirroring:dependency-track/src/main/java/org/dependencytrack/tasks/NistApiMirrorTask.java
Lines 268 to 273 in fd82e58
Steps to Reproduce
Expected Behavior
Mirroring should not fail. We should not create duplicate records that cause unique constraint violations.
Dependency-Track Version
4.11.0-SNAPSHOT
Dependency-Track Distribution
Container Image, Executable WAR
Database Server
N/A
Database Server Version
No response
Browser
N/A
Checklist
The text was updated successfully, but these errors were encountered: