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

Timeout when fetching license information #584

Open
erri120 opened this issue May 27, 2024 · 5 comments
Open

Timeout when fetching license information #584

erri120 opened this issue May 27, 2024 · 5 comments
Labels
await community interest Looking for further community engagement on this topic before further action

Comments

@erri120
Copy link

erri120 commented May 27, 2024

The timeout of 30 seconds is a bit too short for larger projects:

##[debug]Retrieving license information for 500 components...
##[warning]Error encountered while fetching license information from API, resulting SBOM may have incomplete license information: The request was canceled due to the configured HttpClient.Timeout of 30 seconds elapsing.

Would it be possible to increase the timeout or have a configuration option?

private const int ClientTimeoutSeconds = 30;

httpClient.Timeout = TimeSpan.FromSeconds(ClientTimeoutSeconds);

@sfoslund sfoslund added needs triage Default status upon issue submission await community interest Looking for further community engagement on this topic before further action and removed needs triage Default status upon issue submission labels May 28, 2024
@LucaBlackDragon
Copy link

LucaBlackDragon commented Aug 23, 2024

I'm facing the same issue in what I'd consider a small project (102 components in total, 27 explicitly referenced).
Maybe using a lower batchSize would help preventing timeouts:


But it would also increase the risk of hitting the documented rate limits, so all things considered, I think a configurable timeout would be the best solution.

EDIT: I tried to make a PR about this, but can't build the solution, see #687.

@cz-dev-ge
Copy link

Same here. But I don't know the root cause for the timeout. Very large project.

@philipp-naused
Copy link

philipp-naused commented Oct 31, 2024

We have a project with 121 components that times out every single time. Please make this configurable.

kidcline1 added a commit to kidcline1/sbom-tool that referenced this issue Nov 1, 2024
@kidcline1
Copy link
Contributor

I've submitted a PR that adds a CLI argument to configure this.

@erri120
Copy link
Author

erri120 commented Nov 6, 2024

PR is #773.

DaveTryon added a commit that referenced this issue Dec 9, 2024
…gument (#584) (#773)

* Made the Timeout in LicenseInformationService configurable via CLI argument (#584)

* Added recommended fixes for PR #773
- Renamed variables to specify Seconds
- Added new CLI arg -lto to docs
- Added support for negative values for -lto
- Added tests for limits of -lto
- Fixed breaking API change by creating new Interfaces
- Changed some magic numbers to constants instead
- Added some Warning statements

* Added additional recommended fixes for PR #773
- Fixed a couple of minor bugs
- Reduced valid input range for -lto to 1-86400
- Moved MaxTimeout and DefaultTimeout to Constants class

---------

Co-authored-by: Dave Tryon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
await community interest Looking for further community engagement on this topic before further action
Projects
None yet
Development

No branches or pull requests

6 participants