OpenBB-finance/OpenBB · error · OpenBBError

Asset '{asset}' not found.

Error message

Asset '{asset}' not found.

What it means

Raised by the BLS asset loader when the normalized asset name (after auto-appending .xz/.json) does not exist under the packaged openbb_bls/assets directory. The extension check has already passed, so this strictly means 'file missing from the installed package'. It is an OpenBBError about packaging state, not about user query parameters.

Source

Thrown at openbb_platform/providers/bls/openbb_bls/utils/helpers.py:385

    from importlib.resources import files
    from pathlib import Path
    from numpy import nan
    from openbb_core.app.model.abstract.error import OpenBBError
    from pandas import read_csv

    if ".xz" not in asset and "series" in asset:
        asset = asset + ".xz"
    elif ".json" not in asset and "codes" in asset:
        asset = asset + ".json"
    elif ".json" in asset or ".xz" in asset:
        pass
    else:
        raise OpenBBError(f"Asset '{asset}' not supported. Expected .json or .xz file.")

    assets_path = Path(str(files("openbb_bls").joinpath("assets")))

    if not os.path.exists(assets_path.joinpath(asset)):
        raise OpenBBError(f"Asset '{asset}' not found.")

    if asset.endswith(".json"):
        with open(assets_path.joinpath(asset)) as f:
            return json.load(f)
    else:
        with open(assets_path.joinpath(asset), "rb") as f:
            df = read_csv(f, compression="xz", low_memory=False, dtype="str")
        return df.replace({nan: None, "nan": None, "''": None}).dropna(
            how="all", axis=1
        )


async def update_static_asset(category: str) -> None:
    """Update a static file assets with series IDs and code maps for a given category.
    Do not use unless the static files in the assets folder require updating.
    """
    # pylint: disable=import-outside-toplevel
    import json  # noqa

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Reinstall openbb_bls cleanly (pip install --force-reinstall openbb-bls) to restore the packaged assets
  2. Run the maintenance helper update_survey_files() to regenerate missing category assets
  3. Confirm the category actually ships a series file - some surveys are intentionally skipped
  4. Check for typos in the asset base name

Example fix

# before
data = get_survey_asset('xx_series.xz')  # file never generated -> OpenBBError: not found

# after
from openbb_bls.utils.helpers import update_survey_files
# regenerate assets, then:
data = get_survey_asset('cu_series.xz')
Defensive patterns

Strategy: validation

Validate before calling

from importlib.resources import files
from pathlib import Path

def asset_exists(asset: str) -> bool:
    p = Path(str(files('openbb_bls').joinpath('assets')))
    return p.joinpath(asset).exists()

Type guard

from importlib.resources import files
from pathlib import Path

def asset_exists(asset: str) -> bool:
    p = Path(str(files('openbb_bls').joinpath('assets')))
    return p.joinpath(asset).exists()

Prevention

When it happens

Trigger: Requesting a survey asset for a category whose static file was never generated (e.g. 'oe_series.xz' - note the code explicitly skips downloading some surveys), or an installed openbb_bls version whose assets folder is incomplete/outdated relative to the code.

Common situations: Mixed-version installs (code newer than assets after a partial upgrade), editable installs missing built assets, or contributors referencing assets that the update script (update_survey_files) has not yet produced.

Related errors


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