Skip to content
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

No SBOM generated when FETCH_LICENSE=true is set #1620

Open
emcfins opened this issue Feb 5, 2025 · 6 comments
Open

No SBOM generated when FETCH_LICENSE=true is set #1620

emcfins opened this issue Feb 5, 2025 · 6 comments

Comments

@emcfins
Copy link
Contributor

emcfins commented Feb 5, 2025

Hello!

We require the licenses to be included in the dependencies when we generate our SBOMs.

When FETCH_LICENSE=true is included in the command to run against our codebases, in some cases, the command ends but no SBOM is generated.

Cause found:

Through some testing, it turns out that the cache: gotHttpCache, part of the cdxgenAgent is causing the issue.
The command doesn't throw any errors or exceptions that I can see, even with CDXGEN_DEBUG_MODE=debug set.

When I remove that parameter from the agent, the SBOM is generated without a problem.

What is the purpose of the cache here? I see that gotHttpCache is initiated with new Map() right before included in the agent but I'm not too clear on what it's doing.

Thanks

@emcfins
Copy link
Contributor Author

emcfins commented Feb 7, 2025

I'm happy to submit a PR to remove it but I wanted to better understand the impact of doing it before submitting the change.

Thanks!

@prabhu
Copy link
Collaborator

prabhu commented Feb 13, 2025

It's an http cache which must help speed up subsequent calls. Is anything else going on in your environment like a proxy or redirection so the cache is getting filled with empty values?

@emcfins
Copy link
Contributor Author

emcfins commented Feb 17, 2025

Nothing else is different, just enabling fetching the license. It has worked with previous versions.

I'm not sure how to check the cache status for debugging - is that worth diving into as a possible cause of this issue?

@prabhu
Copy link
Collaborator

prabhu commented Feb 18, 2025

Maybe we support an option (environment variable) to disable caching? Might help server use cases too.

@emcfins
Copy link
Contributor Author

emcfins commented Feb 18, 2025

I think that sounds good. Is that something you'd be open to receiving a PR for?

@prabhu
Copy link
Collaborator

prabhu commented Feb 18, 2025

Absolutely!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants