{"record":{"id":"12deb5b414183d01","repo":"OpenBB-finance/OpenBB","slug":"index-index-not-found-in-available-indexes-int","errorCode":null,"errorMessage":"Index {index} not found in available indexes: {INTERNATIONAL_INDEX_PORTFOLIO_FILES}","messagePattern":"Index (.+?) not found in available indexes: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/famafrench/openbb_famafrench/utils/helpers.py","lineNumber":540,"sourceCode":"    Note: Not intended for direct use, this function is called by `get_international_portfolio`.\n    \"\"\"\n    # pylint: disable=import-outside-toplevel\n    import zipfile\n    from io import BytesIO\n\n    url: str = \"\"\n    data: str = \"\"\n    if not index and not country:\n        raise ValueError(\"Please provide either an index or a country.\")\n    if index and country:\n        raise ValueError(\n            \"Please provide either an index or a country, not both at the same time.\"\n        )\n    if index:\n        index = INTERNATIONAL_INDEX_PORTFOLIO_FILES.get(index)\n\n        if not index:\n            raise ValueError(\n                f\"Index {index} not found in available indexes: \"\n                + f\"{INTERNATIONAL_INDEX_PORTFOLIO_FILES}\"\n            )\n        url = (\n            BASE_URL\n            + INTERNATIONAL_INDEX_PORTFOLIOS_URLS[\"dividends\" if dividends else \"ex\"]\n        )\n    if country:\n        country = country.title().replace(\"_\", \" \")\n        if country not in list(COUNTRY_PORTFOLIO_FILES):\n            raise ValueError(\n                f\"Country {country} not found in available countries: \"\n                + f\"{COUNTRY_PORTFOLIO_FILES}\"\n            )\n        url = BASE_URL + COUNTRY_PORTFOLIOS_URLS[\"dividends\" if dividends else \"ex\"]\n        index = COUNTRY_PORTFOLIO_FILES[country]\n\n    response = download_international_portfolios(url)","sourceCodeStart":522,"sourceCodeEnd":558,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/famafrench/openbb_famafrench/utils/helpers.py#L522-L558","documentation":"Raised by get_international_portfolio_data when the `index` argument is not a key in INTERNATIONAL_INDEX_PORTFOLIO_FILES. Note the f-string interpolates the variable AFTER it has been overwritten by the failed .get() — so the message shows 'Index None not found', a minor logging bug that hides the bad input value.","triggerScenarios":"Passing an index name that is not in the INTERNATIONAL_INDEX_PORTFOLIO_FILES mapping, e.g. 'developed' (wrong case) or a renamed index.","commonSituations":"Case-sensitive index labels; index names changed between provider versions; the misleading 'Index None' message leading developers to think the parameter was not sent.","solutions":["Use an exact key from INTERNATIONAL_INDEX_PORTFOLIO_FILES in openbb_famafrench/utils/helpers.py (e.g. 'Developed', 'World').","Ignore the 'Index None' text in the error body — your original value is what failed the lookup.","Upgrade the provider if the index list changed upstream."],"exampleFix":"// before\nobb.economy.famafrench.international_index_returns(index='developed')\n\n// after\nobb.economy.famafrench.international_index_returns(index='Developed')","handlingStrategy":"validation","validationCode":"from openbb_famafrench.utils.helpers import INTERNATIONAL_INDEX_PORTFOLIO_FILES\nif index and index not in INTERNATIONAL_INDEX_PORTFOLIO_FILES:\n    raise ValueError(f'{index!r} not in {list(INTERNATIONAL_INDEX_PORTFOLIO_FILES)}')","typeGuard":"def is_valid_ff_index(index: str) -> bool:\n    from openbb_famafrench.utils.helpers import INTERNATIONAL_INDEX_PORTFOLIO_FILES\n    return index in INTERNATIONAL_INDEX_PORTFOLIO_FILES","tryCatchPattern":null,"preventionTips":["Populate dropdowns from INTERNATIONAL_INDEX_PORTFOLIO_FILES keys at startup.","Note the error message shows 'Index None' due to variable overwrite — rely on your own validation, not the message."],"tags":["famafrench","validation","index-choice","error-message-bug"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}