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

Better error output for malformed inputs. #86

Closed
0-wiz-0 opened this issue Dec 19, 2022 · 4 comments · Fixed by #1283
Closed

Better error output for malformed inputs. #86

0-wiz-0 opened this issue Dec 19, 2022 · 4 comments · Fixed by #1283
Assignees
Labels
bug Something isn't working

Comments

@0-wiz-0
Copy link

0-wiz-0 commented Dec 19, 2022

I've created a CycloneDX SBOM JSON file using syft in the file system detection mode.
I then passed it to osv-scanner 1.0.1 and got the following error message:

# osv-scanner --sbom sbom.cyclonedx.json                                                                                                                                                            
Scanned CycloneDX SBOM                                                                                                                                                                                      
scan failed server response error: {"code":3,"message":"Invalid Package URL."}    

Can you please make this error more detailed so it's clearer which Package URL is invalid?

(I think I know what the reason is; syft created 59 sections looking like this:

       "externalReferences": [
         {
           "url": "",
           "hashes": [
             {
               "alg": "SHA-1",
               "content": "SOMESHA1"
             }
           ],
           "type": "build-meta"
            }                                                                                                                                                                                                 
       ],

and one like this:

       "bom-ref": "77d4884a4c0c2f96",
       "type": "library",
       "name": "",
       "cpe": "cpe:2.3:a:python-:python-:*:*:*:*:*:*:*:*",
       "purl": "pkg:pypi/",
       "properties": [
...

when I deleted these, osv-scanner didn't report this error any longer.)
(I'll file a bug report for syft next.)

@another-rex another-rex added the bug Something isn't working label Dec 19, 2022
@oliverchang oliverchang changed the title output in error case not very helpful Better error output for malformed inputs. Dec 20, 2022
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 25, 2024
@0-wiz-0
Copy link
Author

0-wiz-0 commented Jul 25, 2024

Anyone working on this?

@github-actions github-actions bot removed the stale The issue or PR is stale and pending automated closure label Jul 30, 2024
Copy link

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

See https://github.com/google/osv-scanner/blob/main/CONTRIBUTING.md for how to contribute a PR if you're interested in helping out.

@github-actions github-actions bot added the stale The issue or PR is stale and pending automated closure label Sep 28, 2024
@G-Rath G-Rath removed the stale The issue or PR is stale and pending automated closure label Sep 29, 2024
@G-Rath G-Rath self-assigned this Sep 29, 2024
@0-wiz-0
Copy link
Author

0-wiz-0 commented Sep 30, 2024

Thank you, @another-rex !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants