OpenBB-finance/OpenBB · error · ValueError

Index {index} not found in available indexes: {filenames}

Error message

Index {index} not found in available indexes: {filenames}

What it means

Raised by get_international_portfolio_data after downloading the international portfolios zip: the expected member filename (derived from the index or country mapping) was not among the zip's entries. This is a downstream consistency check — the URL mapping and the archive contents disagreed.

Source

Thrown at openbb_platform/providers/famafrench/openbb_famafrench/utils/helpers.py:572

            )
        url = BASE_URL + COUNTRY_PORTFOLIOS_URLS["dividends" if dividends else "ex"]
        index = COUNTRY_PORTFOLIO_FILES[country]

    response = download_international_portfolios(url)

    with zipfile.ZipFile(BytesIO(response.content)) as f:
        filenames = f.namelist()

        if index in filenames:
            try:
                with f.open(index) as file:
                    data = file.read().decode("utf-8")
            except UnicodeDecodeError:
                # Fallback to latin-1 encoding if utf-8 fails
                with f.open(index) as file:
                    data = file.read().decode("latin-1")
        else:
            raise ValueError(
                f"Index {index} not found in available indexes: {filenames}"
            )

    return data


def process_international_portfolio_data(tables: list, dividends: bool = True) -> tuple:
    """Convert parsed table dictionaries to pandas DataFrames with proper multi-index columns.

    Note: Not intended for direct use, this function is called by `get_international_portfolio`.
    """
    # pylint: disable=import-outside-toplevel
    import re  # noqa
    import warnings
    from pandas import DataFrame, MultiIndex

    dataframes: list = []
    metadata: list = []

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Retry with dividends=False (or True) — the two archives have different member names.
  2. Manually download the zip URL (BASE_URL + INTERNATIONAL_INDEX_PORTFOLIOS_URLS[...]) and list its contents to see the real filenames.
  3. Update openbb-famafrench; if still broken, open a provider issue with the zip's namelist.
  4. Toggling the other dimension (country instead of index) can confirm the archive itself is fine.
Defensive patterns

Strategy: try-catch

Try / catch

try:
    res = obb.economy.famafrench.international_index_returns(index='Developed', dividends=False)
except ValueError as e:
    if 'not found in available indexes' in str(e):
        res = obb.economy.famafrench.international_index_returns(index='Developed', dividends=True)
    else:
        raise

Prevention

When it happens

Trigger: INTERNATIONAL_INDEX_PORTFOLIO_FILES/COUNTRY_PORTFOLIO_FILES maps a label to a filename (e.g. 'Developed_ex.VW_Cap.txt') that the freshly downloaded zip no longer contains.

Common situations: Upstream Fama/French renamed or removed files inside the dividends or ex-dividends archive; provider mapping out of date relative to the live site; dividends=True selecting the 'dividends' zip whose filenames differ from the expected one.

Related errors


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