OpenBB-finance/OpenBB · error · OpenBBError
Error requesting dates. Please try again later.
Error message
Error requesting dates. Please try again later.
What it means
OpenBBError from SomaHoldings.get_as_of_dates: the NY Fed SOMA 'list_as_of' endpoint responded, but the expected soma.asOfDates array was missing or empty. Since this list is the prerequisite for picking a valid as-of date, an empty payload is treated as a transient service error ('try again later') rather than a data condition.
Source
Thrown at openbb_platform/providers/federal_reserve/openbb_federal_reserve/utils/ny_fed_api.py:364
>>> mbs = await soma.get_agency_holdings(holding_type = "mbs")
>>> monthly_holdings = await soma.get_treasury_holdings(monthly = True)
"""
def __init__(self) -> None:
"""Initialize the SomaHoldings class."""
def __repr__(self) -> str:
"""Replace original repr with docstring."""
return str(self.__doc__)
async def get_as_of_dates(self) -> list:
"""Get all valid as-of dates for SOMA operations."""
dates_url = _get_endpoints()["soma_holdings"]["list_as_of"]
dates_response = await fetch_data(dates_url)
dates = dates_response.get("soma", {}).get("asOfDates", [])
if not dates:
raise OpenBBError("Error requesting dates. Please try again later.")
return dates
async def get_release_log(
self,
treasury: bool = False,
) -> list[dict]:
"""Return the last three months Agency Release and as-of dates.
Parameters
----------
treasury: bool
If True, returns the last three months of Treasury release and as-of dates.
Returns
-------
List[Dict]: Dictionary of the release date and as-of dates.
ExampleView on GitHub (pinned to 3e071fcc2c)
Solutions
- Retry after a short delay — the message frames this as transient.
- If persistent, curl the list_as_of endpoint and verify the soma.asOfDates key still exists; if renamed, update the provider.
- Pass an explicit as_of date to holdings calls to bypass the asOfDates lookup.
Example fix
// before holdings = await SomaHoldings().get_agency_holdings() # fetches as-of dates internally // after holdings = await SomaHoldings().get_agency_holdings(as_of='2024-06-05')
Defensive patterns
Strategy: retry
Try / catch
from openbb_core.app.model.abstract.error import OpenBBError
for attempt in range(3):
try:
dates = await SomaHoldings().get_as_of_dates()
break
except OpenBBError:
if attempt == 2:
raise
await asyncio.sleep(2 ** attempt) Prevention
- Pass explicit as_of dates from a cached list to avoid this lookup
- Add exponential backoff around NY Fed metadata calls
When it happens
Trigger: Any SOMA holdings call that needs the default latest date (as_of=None) fetches this list first; NY Fed API returning an error body, a schema change renaming asOfDates, or intermittent empty responses under load.
Common situations: Bursty polling of SOMA endpoints hitting rate limits that return empty 200s; NY Fed deploying schema changes; corporate proxies returning stub responses.
Related errors
- No data found. Try again later.
- There was an error with the request and was returned empty.
- Invalid choice. Choose from: ['all', 'agency debts', 'mbs',
- No results found. Try adjusting the query parameters.
- Invalid choice. Choose from: {', '.join(TREASURY_HOLDING_TYP
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/3d6f646ade6170ba.
Report an issue: GitHub.