Skip to content

Unhelpful error message: Unexpected SPDX error parsing license string #213

Closed

Description

@bitmotivator

While trying to convert this v2.3 SBOM to v3, the folowing error message is written:

Error converting: Error converting SPDX file: class org.spdx.core.InvalidSPDXAnalysisException Error parsing JSON field for ID SPDXRef-nginx-source: Unexpected SPDX error parsing license string

The license string in question is BSD-2-Clause, which is a valid SPDX license string. The error message does not elaborate why the license is invalid and it is not clear if the correct license is read.

Activity

  1. goneall commented on Jul 28, 2025

    @goneall
    Member

    There was an incorrect import in the SPDX Java Library which masked the more detailed error message.

    Here's the full message:

    Error converting: Error converting SPDX file: class org.spdx.core.InvalidSPDXAnalysisException Error parsing JSON field for ID SPDXRef-nginx-source: Unknown license nginx-1.29.0/LICENSE.  Must be a listed license or have the syntax LicenseRef-([0-9a-zA-Z\.\-\_]+)\+?$ License expression: 'nginx-1.29.0/LICENSE'
    

    I'll create a separate issue and pull request to fix the error message issue.

  2. goneall commented on Jul 28, 2025

    @goneall
    Member

    It looks like this PR already fixes the error message: spdx/Spdx-Java-Library#339

  3. goneall commented on Jul 28, 2025

    @goneall
    Member

    Looking at the source sbom, the issue is with line 142 - the licenseInfoInFiles is intended to list out the license expressions for each file.

  4. bitmotivator commented on Jul 28, 2025

    @bitmotivator
    Author

    Wow, thank you for the quick response @goneall !

  5. goneall commented on Oct 15, 2025

    @goneall
    Member

    Looks like this is fixed with spdx/Spdx-Java-Library#339

    Closing the issue

    I'll be creating a new release soon

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions