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

Errors spamming the stderr output #1005

Closed
another-rex opened this issue May 30, 2024 · 3 comments · Fixed by #1279
Closed

Errors spamming the stderr output #1005

another-rex opened this issue May 30, 2024 · 3 comments · Fixed by #1279
Assignees
Labels
backlog Important but currently unprioritized bug Something isn't working

Comments

@another-rex
Copy link
Collaborator

another-rex commented May 30, 2024

Some errors should only be displayed once, but spams the output because of its location in the code flow.

Currently the only example of this I have is :

https://github.com/google/osv-scanner/blob/main/internal/local/check.go/#L147-L148

Solution proposed:
Have some global hashmap that checks if this error has already been logged and don't repeat the log.

@G-Rath
Copy link
Collaborator

G-Rath commented May 30, 2024

Can you provide a reproduction for that specific example? as it sounds like a potential bug.

The whole concept though of not spamming errors sounds good

@another-rex
Copy link
Collaborator Author

Call osv-scanner --experimental-offline . without a local-db already set up, and it'll print one error per package that's scanned, since the error is in MakeRequest. So it's working as intended, it's just not great UX.

Copy link

This issue has not had any activity for 60 days and will be automatically closed in two weeks

@github-actions github-actions bot added the stale The issue or PR is stale and pending automated closure label Jul 30, 2024
@another-rex another-rex added bug Something isn't working backlog Important but currently unprioritized and removed stale The issue or PR is stale and pending automated closure labels Aug 7, 2024
@G-Rath G-Rath self-assigned this Sep 26, 2024
another-rex pushed a commit that referenced this issue Sep 30, 2024
…ngle line (#1279)

This reduces the amount of noise generated when using `--offline` if a
database is not available for a particular ecosystem. While it was
suggested that we could have some form of general error cache, for now
I've just optimized for this specific case as really it's the one we
expect the most and (in part) I think the nature of Go makes the more
generic improvement a bit too faffy vs the gain.

Resolves #1005
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Important but currently unprioritized bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants