Repository navigation
Description
Current Behavior
When the same BOM file of the project is scanned repeatedly, components are duplicated. The first scan of the project is correct, components are not duplicated and have the same amount of BOM file, but the next scan of the same project, a new version of the project is added to DependencyTrack and all previous components from the previous version are cloned and N-1 (one component less from total amount in BOM file) components from new scan are added.
In most cases, this happens exactly when rescanning in a close time interval - 1-2 hours or less. If you wait, say, 5-6 hours, then the new version of the scan again gives the correct number of components. I tried increasing DELAY in the project cloning script, but it didn't change anything. I assume the problem is that DepTrack doesn't have time to process the previous scan command or its results and adds new ones.
I checked the problem on v4.7.1 and v4.8.0.
I attach logs from v4.7.1
Initially a BOM file with 138 components is given as input.
This screenshot shows the third scan of the project
138 components first scan (correct) + 137 second scan + 137 third scan. The BOM is the same as the 138 components.
Third scan
May 16, 2023, 17:24:55

All the logs show a strange time.
First scan
May 16, 2023, 17:15:13

Second scan
May 16, 2023, 17:24:05

After 5-10 hours of this scan, I run the scan again and the number of components becomes correct (138).
Fourth scan
May 17, 2023, 11:21:40

Steps to Reproduce
- DepTrack receives the BOM file generated by cdxgen as input. The BOM file itself contains no duplicates and is correct with always the same number of components.
- DepTrack creates a new project, or if it already exists, creates a new version of that project and copies there the components/vulnerabilities from the previous version.
- After that it loads the components from the BOM file.
- In this step it must find NEW components compared to the previous version, but it ignores the components already loaded from the previous version and considers all the components loaded from the BOM file as NEW and just adds them, thus duplicating them with the previous version.
Expected Behavior
- DepTrack receives the BOM file generated by cdxgen as input. The BOM file itself contains no duplicates and is correct with always the same number of components.
- DepTrack creates a new project, or if it already exists, creates a new version of that project and copies there the components/vulnerabilities from the previous version.
- After that it loads the components from the BOM file.
4. Finds NEW components compared to the previous version.
5. Analyzes them.
6. Adds NEW components to the previous actual components cloned from the previous scan.
The correct behavior happens only when the BOM file is loaded for the first time for scanning (a new project is created in DepTrack), or in 90% of cases when there is a long break between scans (about more than 5 hours)
Dependency-Track Version
4.7.x
Dependency-Track Distribution
Container Image
Database Server
PostgreSQL
Database Server Version
13.2
Browser
Google Chrome
Checklist
- I have read and understand the contributing guidelines
- I have checked the existing issues for whether this defect was already reported



Activity
syalioune commentedon May 18, 2023
Hello @maveritas
How do you upload the SBOM to DT (i.e. custom script, jenkins plugins,...) ? And precisely why is there a project cloning on each uploads ?
Note that the project cloning and bom upload tasks are processed in parallel by DT
You can see above that :
14:25:08and ended at14:25:1014:25:08at14:25:09if the bom upload processing task happens before the cloning task, component deduplication cannot be done that why you can see at
14:25:09the message[BomProcessingUploadTask] Identified 137 new components.If you only need distinct versions on each upload, you can specify a new version and DT will create a new project. Components and vulnerabilities will be populated by SBOM and DT analyzers.
If you also need audit history propagation, you can either :
WDN2010 commentedon Jun 22, 2023
Hello @syalioune!
We use a custom Python script to make API requests to the Dependency Track server. I have conducted additional tests, and it appears that the problem is caused by cloning the project and uploading the new SBOM file simultaneously.
Here are the results of the test where the order of cloning and uploading the SBOM file was not checked:
Script Log:
Dependency Track Log:
Note the line "Identified 304 new components." These are the additional components that were cloned.
Here are the results of the test where the project was cloned first, and then the SBOM file was uploaded:
Script Log:
Dependency Track Log:
It worked perfectly! However, it appears that Dependency Track should not combine these two processes to avoid cluttering the results.
syalioune commentedon Aug 20, 2023
Fantastic, I guess this issue can be closed then. #2842 would track the API enhancement.
github-actions commentedon Feb 14, 2024
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.