OpenBB-finance/OpenBB · error · OpenBBError
No valid combination of indicator symbols and countries were
Error message
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. What it means
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.
Source
Thrown at openbb_platform/providers/econdb/openbb_econdb/models/economic_indicators.py:303
new_symbols.extend(new_symbol)
# If it is a commodity symbol, there will be no country associated with the indicator.
elif (
symbol in helpers.HAS_COUNTRIES
and helpers.HAS_COUNTRIES[symbol] is False
):
new_symbols.append(symbol)
if not new_symbols:
symbol_message = helpers.INDICATOR_COUNTRIES.get(
query.symbol.upper(), "None"
)
error_message = (
"No valid combination of indicator symbols and countries were supplied."
+ f"\nValid countries for '{query.symbol}' are: {symbol_message}"
+ f"\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."
)
raise OpenBBError(error_message)
url = base_url + f"%5B{','.join(new_symbols)}%5D&format=json&token={token}"
if query.start_date:
url += f"&from={query.start_date}"
if query.end_date:
url += f"&to={query.end_date}"
# If too many indicators and countries are supplied the request url will be too long.
# Instead of chunking we request the user reduce the number of indicators and countries.
# This might be able to nudge higher, but it is a safe limit for all operating systems.
if len(url) > 2000:
raise OpenBBError(
"The request has generated a url that is too long."
+ " Please reduce the number of symbols or countries and try again."
)
async def response_callback(response, session):
"""Response callback."""
if response.status != 200:
warn(f"Error: {response.status} - {response.reason}")View on GitHub (pinned to 3e071fcc2c)
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.
Example fix
# before
res = obb.economy.indicator(provider="econdb", symbol="cpi", country="cn") # unsupported -> raises
# after
from openbb_econdb.utils import helpers
valid = helpers.INDICATOR_COUNTRIES.get("CPI", [])
countries = [c for c in ["us", "cn"] if c.upper() in valid] or ["us"]
res = obb.economy.indicator(provider="econdb", symbol="cpi", country=",".join(countries)) Defensive patterns
Strategy: validation
Validate before calling
from openbb_econdb.utils import helpers
def covered_countries(symbol: str, countries: list[str]) -> list[str]:
allowed = set(helpers.INDICATOR_COUNTRIES.get(symbol.upper(), []))
if not countries:
return []
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])]
return [c.upper() for c in expanded if c.upper() in allowed]
# empty result => the call would raise; intersect or drop Try / catch
from openbb_core.provider.utils.errors import OpenBBError
try:
res = obb.economy.indicator(provider="econdb", symbol=s, country=cs)
except OpenBBError as e:
if "No valid combination" in str(e):
valid = [c for c in cs.split(",") if covered_countries(s, [c])]
res = obb.economy.indicator(provider="econdb", symbol=s, country=",".join(valid))
else:
raise Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- The 'main' indicator cannot be combined with multiple countr
- Invalid symbol: '{symbol}'. It must have a two-letter countr
- No valid countries were supplied.
- No valid countries were supplied.
- The 'main' indicator cannot be combined with other indicator
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/9ad1013822abeb7e.
Report an issue: GitHub.