-
-
Notifications
You must be signed in to change notification settings - Fork 50
UnknownComponentDependencyException with SBOM from cyclonedx-javascript-library #746
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
Comments
Thanks for the report, @finger42 . Could you provide a reproducible setup? |
Hello, Thx for the hint do to my homework ;-)
I think the problem is that there are two components, which are exactly the same ( only the bom-ref differs ) If I modify one property in one of the comonents. e.g. version to something other, the problem is gone. Now my question: Is this a valid SBOM ? If not, then the generator of the original SBOM , or another script, needs to strip the duplicated components ? Beside that, the error msg:
could be improved to point out that there are duplicated components in the dependency tree ? |
yepp, exactly that should be the reason. The python library does some deduplication, since it uses |
It should be schema-valid, yes. |
So I need to deduplicate the SBOM generated with the cyclonedx-javascript-library. |
@finger42 , may I ask for some background? Are you using one of the many open-source SBOM generators running on nodej? Which one? Thank you in advance. |
I try to build SBOMs with different tools. Some of these tools are using javascirpt for webapps, some of them the nuget lib, others the python lib. Or even other SBOM generators ( yocto. buildroot, ... ) I currently dont know, but they exist ;-) All in common is the final goal to import SBOMs in self hosted https://dependencytrack.org/ to monitor the components for different firmware versions (also for old devices). I will ask my webdevs why the double components are inside the given SBOM. I think that the CRA is the reason why this topic ( SBOM ) is getting more attention. And yes, I understand that it is hard to get feedback from closed source to open source projects. Thank you ! |
a workaround: use properties to make each component unique. |
@jkowalleck I need to wait till next year for my team an test the properties as a workaround. |
a thing could be the nature of not-deduplicated node modules - read https://github.com/CycloneDX/cyclonedx-node-npm/blob/main/docs/component_deduplication.md and see examples here: |
Some background info:
SBOM generation:
Results and Issues:
This seems strange because our yarn.lock lists it only once:
but the results of running “yarn why @mui/styled-engine” correspond with the SBOM:
|
Ah, the usual non-deduplicated node modules, that is not an issue. That should be no issue. Anyway, I see the root cause to be, as you suggested, I guess there is only one long-term solution to it: I will work on a fix - a breaking change that should be released with the next major version, soon. |
this bug caused #753 |
Hello, Thx for your help @jkowalleck and also thx @wkoot ! Can you tell me when the version 9.x will be released ? |
the next release will take a while, as it will be composed of several interlinked features. you can speed this up by contributing to them. but before all of this, i would really love to get #755 done. this one will make #754 easier to review. for all of this it is the same: pullrequest early (draft/wip) to indicate your intention & dont try to be perfect. "it works" is enough, we can improve over time. |
A preview of the fix/feature is available via https://github.com/CycloneDX/cyclonedx-python-lib/releases/tag/v9.0.1-rc.1 |
Thank you. |
Hello,
I try to enhance a given SBOM, which is generated with
https://github.com/CycloneDX/cyclonedx-javascript-library
While writing the sbom with output_as_string I get the exception:
UnknownComponentDependencyException
cyclonedx.exception.model.UnknownComponentDependencyException: One or more Components have Dependency references to Components/Services that are not known in this BOM. They are: {<BomRef '@mui/styled-engine@npm:5.16.6 [3135b]' id=126477793907040>, <BomRef '@mui/material@npm:5.14.0 [cd63f]' id=126477793557152>, <BomRef 'react-redux@npm:8.1.1 [cd63f]' id=126477790002304>, <BomRef '@mui/system@npm:5.16.7 [c1a0d]' id=126477793910160>}
For example the component:
@mui/styled-engine@npm:5.16.6 [3135b]
is used in:
and
I dont know why the [3135b] is added to this component. It looks like an hash or something.
Could it be that the space between @mui/system@npm:5.16.7 and [260c3] causes the problems?
I am using cyclonedx-python-lib Version: 8.5.0
Any ideas or suggestions would help.
The text was updated successfully, but these errors were encountered: