OpenBB-finance/OpenBB · error · OpenBBError
Failed to get instruments -> {e.__class__.__name__}: {e}
Error message
Failed to get instruments -> {e.__class__.__name__}: {e} What it means
OpenBBError wrapping any exception raised by the amake_request call inside get_instruments, prefixed with the exception class name for diagnosability. Because get_instruments is @alru_cache(maxsize=64)-decorated, note that a successful (even empty) result is cached; only the raising path bypasses caching.
Source
Thrown at openbb_platform/providers/deribit/openbb_deribit/utils/helpers.py:96
)
if derivative_type and derivative_type not in DERIVATIVE_TYPES:
raise ValueError(
f"Kind {derivative_type} not supported. Supported kinds are: {', '.join(DERIVATIVE_TYPES)}"
)
url = f"{BASE_URL}/api/v2/public/get_instruments?currency={currency.upper() if currency != 'all' else 'any'}"
if derivative_type is not None:
url += f"&kind={derivative_type}"
if expired:
url += f"&expired={str(expired).lower()}"
try:
response = await amake_request(url)
return response.get("result", []) # type: ignore
except Exception as e: # pylint: disable=broad-except
raise OpenBBError(
f"Failed to get instruments -> {e.__class__.__name__}: {e}"
) from e
async def get_options_symbols(symbol: OptionsSymbols = "BTC") -> dict:
"""
Get a dictionary of contract symbols by expiry.
Parameters
----------
symbol : OptionsSymbols
The underlying symbol to get options for. Default is "btc".
Returns
-------
dict[str, str]
A dictionary of contract symbols by expiry date.
"""View on GitHub (pinned to 3e071fcc2c)
Solutions
- Test the URL directly: curl 'https://www.deribit.com/api/v2/public/get_instruments?currency=BTC'.
- If the class name in the message is a timeout, increase patience or retry; if it's an HTTP error status, check for rate limiting/geo-blocks.
- Configure proxy env vars (HTTP_PROXY/HTTPS_PROXY) in restricted networks.
- Cache or persist instrument lists locally if you call this in a hot loop to avoid rate limits.
Example fix
# before
data = await get_instruments("all", "future") # raises on first network blip
# after
from openbb_core.provider.utils.errors import OpenBBError
try:
data = await get_instruments("all", "future")
except OpenBBError as e:
logger.warning("instruments fetch failed, retrying once: %s", e)
await asyncio.sleep(2)
data = await get_instruments("all", "future") Defensive patterns
Strategy: retry
Try / catch
from openbb_core.provider.utils.errors import OpenBBError
try:
instruments = await get_instruments("all", "future")
except OpenBBError as e:
msg = str(e)
if "Timeout" in msg or "timed out" in msg:
await asyncio.sleep(2); instruments = await get_instruments("all", "future")
else:
raise Prevention
- Read the exception class name embedded in the message to classify network vs API failure.
- Cache instrument lists (the helper's own lru cache only caches successes).
- Set proxy env vars behind corporate firewalls.
When it happens
Trigger: DNS failure, connection timeout, TLS error, or a non-JSON response while GETting /api/v2/public/get_instruments. Raised before any result parsing, so it is purely transport-level.
Common situations: Offline environments, proxy interference, Deribit geo-blocking or rate limiting (HTTP 429/403 surfaces as an exception here), and outages.
Related errors
- Error fetching data: {e}
- Error fetching data: {e}
- Congress.gov API rate limit exceeded. Please wait a moment a
- Failed to get futures curve -> {e.__class__.__name__ if hasa
- There was an error with the request and it was returned empt
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/507b3789ab003576.
Report an issue: GitHub.