Skip to content

Invalid PURL for conan package #2960

Closed

Description

@trew

Describe the bug
Since 7496fb4 the API no longer accepts the conan PURLs, for example: pkg:conan/[email protected]

I guess parsing this PURL returned None previously, but now it raises ValueError.

To Reproduce
Steps to reproduce the behaviour:

  1. curl -d '{"package": {"purl": "pkg:conan/[email protected]"}}' "https://api.osv.dev/v1/query"
  2. Response is {"code":3,"message":"Invalid PURL."}

Expected behaviour
Some kind of response with response code 200

Activity

  1. self-assigned this
    on Dec 4, 2024
  2. nchelluri commented on Dec 5, 2024

    @nchelluri

    I am not 100% sure that the commit mentioned here is the culprit for this, but I see the same response with this PURL: pkg:github/actions/checkout@v1 . I am sure it was not like this a few days ago. I don't know if pkg:github would be considered a valid PURL.

    Edit: just to provide a bit more detail, I generated this PURL by running syft version 1.17.0 (the latest release of that tool on https://github.com/anchore/syft/releases) to generate a CycloneDX SBOM for https://github.com/Chalarangelo/30-seconds-of-code/tree/e7a910e0c1d31657b5319618517189f0fc83c3ff. I used the command syft -o cyclonedx-json=cdx-sbom.json dir:. from a checkout of that repo.

  3. hogo6002 commented on Dec 5, 2024

    @hogo6002
    Contributor

    Hi @trew and @nchelluri, thanks for reporting this!

    The issue was caused by the PURL API refactoring, where we added PURL ecosystem validation. Because we lack Conan and GitHub Actions PURL converters, the system failed to extract the ecosystem name from the PURL string and treated the queries as invalid. I will do a fix release soon to address this issue.

  4. hogo6002 commented on Dec 5, 2024

    @hogo6002
    Contributor

    I have deployed the fix. PURL queries for Conan and GitHub Actions should no longer raise any errors. If you have any other questions, please let me know. Thanks again for the report!

  5. trew commented on Dec 5, 2024

    @trew
    Author

    I have deployed the fix. PURL queries for Conan and GitHub Actions should no longer raise any errors. If you have any other questions, please let me know. Thanks again for the report!

    Thank you so much for the quick resolution! Works as expected from my side now 👍

  6. nchelluri commented on Dec 5, 2024

    @nchelluri

    Yes, TSYM for the very quick turnaround!

    I have tested and things look good on my end as well. After the bug was introduced, but before the fix was deployed, I would call https://pkg.go.dev/github.com/google/[email protected]/pkg/osv#MakeRequestWithClient and get this error from one or a few of the PURLs and the whole response would error out. Now that doesn't happen. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions