{"record":{"id":"9ad1013822abeb7e","repo":"OpenBB-finance/OpenBB","slug":"no-valid-combination-of-indicator-symbols-and-coun","errorCode":null,"errorMessage":"No valid combination of indicator symbols and countries were supplied.\\nValid countries for '{query.symbol}' are: {symbol_message}\\nIf the symbol - {query.symbol} - is missing a country code. Please add the two-letter country code or use the country parameter.\\nIf already included, add '~' to the end of the symbol.","messagePattern":"No valid combination of indicator symbols and countries were supplied\\.\\\\nValid countries for '(.+?)' are: (.+?)\\\\nIf the symbol - (.+?) - is missing a country code\\. Please add the two-letter country code or use the country parameter\\.\\\\nIf already included, add '~' to the end of the symbol\\.","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/econdb/openbb_econdb/models/economic_indicators.py","lineNumber":303,"sourceCode":"                    new_symbols.extend(new_symbol)\n            # If it is a commodity symbol, there will be no country associated with the indicator.\n            elif (\n                symbol in helpers.HAS_COUNTRIES\n                and helpers.HAS_COUNTRIES[symbol] is False\n            ):\n                new_symbols.append(symbol)\n        if not new_symbols:\n            symbol_message = helpers.INDICATOR_COUNTRIES.get(\n                query.symbol.upper(), \"None\"\n            )\n            error_message = (\n                \"No valid combination of indicator symbols and countries were supplied.\"\n                + f\"\\nValid countries for '{query.symbol}' are: {symbol_message}\"\n                + f\"\\nIf the symbol - {query.symbol} - is missing a country code.\"\n                + \" Please add the two-letter country code or use the country parameter.\"\n                + \"\\nIf already included, add '~' to the end of the symbol.\"\n            )\n            raise OpenBBError(error_message)\n        url = base_url + f\"%5B{','.join(new_symbols)}%5D&format=json&token={token}\"\n        if query.start_date:\n            url += f\"&from={query.start_date}\"\n        if query.end_date:\n            url += f\"&to={query.end_date}\"\n        # If too many indicators and countries are supplied the request url will be too long.\n        # Instead of chunking we request the user reduce the number of indicators and countries.\n        # This might be able to nudge higher, but it is a safe limit for all operating systems.\n        if len(url) > 2000:\n            raise OpenBBError(\n                \"The request has generated a url that is too long.\"\n                + \" Please reduce the number of symbols or countries and try again.\"\n            )\n\n        async def response_callback(response, session):\n            \"\"\"Response callback.\"\"\"\n            if response.status != 200:\n                warn(f\"Error: {response.status} - {response.reason}\")","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/econdb/openbb_econdb/models/economic_indicators.py#L285-L321","documentation":"OpenBBError raised when symbol×country expansion produced zero valid combinations: `new_symbols` is empty after checking each symbol's allowed countries (INDICATOR_COUNTRIES). The message embeds the valid country list for the requested symbol and hints about the '~' suffix grammar.","triggerScenarios":"Calling obb.economy.indicator(provider='econdb', symbol='cpi', country='cn') when the indicator has no data for that country; or a bare multi-country symbol with countries that all fail INDICATOR_COUNTRIES membership. The message shows exactly which countries are available for query.symbol.","commonSituations":"Assuming every indicator covers every country (small economies are frequently missing); country/indicator matrices built from a different data vendor's coverage; stale provider catalog after EconDB coverage changes.","solutions":["Read the error body: 'Valid countries for {symbol} are: ...' lists exactly what works — pick from it.","Cross-check coverage with the available-indicators endpoint / INDICATOR_COUNTRIES in openbb_econdb.utils.helpers.","Update openbb-econdb if coverage changed upstream.","Request per-country and merge client-side so one unsupported country doesn't kill the whole batch."],"exampleFix":"# before\nres = obb.economy.indicator(provider=\"econdb\", symbol=\"cpi\", country=\"cn\")  # unsupported -> raises\n\n# after\nfrom openbb_econdb.utils import helpers\nvalid = helpers.INDICATOR_COUNTRIES.get(\"CPI\", [])\ncountries = [c for c in [\"us\", \"cn\"] if c.upper() in valid] or [\"us\"]\nres = obb.economy.indicator(provider=\"econdb\", symbol=\"cpi\", country=\",\".join(countries))","handlingStrategy":"validation","validationCode":"from openbb_econdb.utils import helpers\n\ndef covered_countries(symbol: str, countries: list[str]) -> list[str]:\n    allowed = set(helpers.INDICATOR_COUNTRIES.get(symbol.upper(), []))\n    if not countries:\n        return []\n    expanded = [c for cc in countries for c in (helpers.COUNTRY_GROUPS.get(cc.lower(), [cc]) if cc.lower() in helpers.COUNTRY_GROUPS else [cc])]\n    return [c.upper() for c in expanded if c.upper() in allowed]\n# empty result => the call would raise; intersect or drop","typeGuard":null,"tryCatchPattern":"from openbb_core.provider.utils.errors import OpenBBError\ntry:\n    res = obb.economy.indicator(provider=\"econdb\", symbol=s, country=cs)\nexcept OpenBBError as e:\n    if \"No valid combination\" in str(e):\n        valid = [c for c in cs.split(\",\") if covered_countries(s, [c])]\n        res = obb.economy.indicator(provider=\"econdb\", symbol=s, country=\",\".join(valid))\n    else:\n        raise","preventionTips":["Never assume full country coverage per indicator — check INDICATOR_COUNTRIES first.","Query per-country and merge so unsupported countries don't void the whole request."],"tags":["econdb","validation","coverage","symbols","country-codes"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}