OpenBB-finance/OpenBB · error · ValueError

Invalid report_id '{v}'. Valid report IDs are: {valid_report

Error message

Invalid report_id '{v}'. Valid report IDs are: {valid_report_ids}

What it means

Error "Invalid report_id '{v}'. Valid report IDs are: {valid_report_ids}" thrown in OpenBB-finance/OpenBB.

Source

Thrown at openbb_platform/providers/government_us/openbb_government_us/models/commodity_psd_data.py:202

        default=None,
        description="Start year for filtering time series data. None returns from the beginning of the series.\n"
        + "Parameter is ignored when 'commodity' is None.",
    )
    end_year: int | None = Field(
        default=None,
        description="End year for filtering time series data. If None, returns up to the most recent year.\n"
        + "Parameter is ignored when 'commodity' is None.",
    )

    @field_validator("report_id", mode="before", check_fields=False)
    @classmethod
    def _validate_report_id(cls, v):
        """Validate report_id."""
        if not v:
            return "world_crop_production_summary"

        if v not in PSD_REPORT_NAMES:
            raise ValueError(
                f"Invalid report_id '{v}'. Valid report IDs are: "
                + ", ".join(sorted(list(PSD_REPORT_NAMES.keys())))
            )
        return v

    @field_validator("commodity", mode="before", check_fields=False)
    @classmethod
    def _validate_commodity(cls, v):
        """Validate commodity."""
        if not v:
            return None
        if v and v not in COMMODITIES:
            raise ValueError(
                f"Invalid commodity '{v}'. Valid commodities are: "
                + ", ".join(sorted(list(COMMODITIES)))
            )
        return v

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Choose a report_id from the listed valid report IDs.
  2. Use the commodity parameter instead of report_id if unsure of the ID.

When it happens

Trigger: Thrown at openbb_platform/providers/government_us/openbb_government_us/models/commodity_psd_data.py:202 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14). Data as JSON: /api/errors/07e8ca2d8ba21d0c. Report an issue: GitHub.