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
- Retry with dividends=False (or True) — the two archives have different member names.
- Manually download the zip URL (BASE_URL + INTERNATIONAL_INDEX_PORTFOLIOS_URLS[...]) and list its contents to see the real filenames.
- Update openbb-famafrench; if still broken, open a provider issue with the zip's namelist.
- 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
- Try both dividends=True and dividends=False — the two archives have different member filenames.
- Pin the provider version you validated against; upstream zip renames surface here first.
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
- The request was returned empty. This may be due to an invali
- Invalid region, '{region}', for factor '{factor}'. Only 'ame
- Invalid region: '{region}'. Valid regions are: {", ".join(FA
- Invalid factor: '{factor}' for region: '{region}'. Valid fac
- Invalid frequency: '{frequency}' for factor: '{factor}' in r
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/495d52f02a8ef225.
Report an issue: GitHub.