{"record":{"id":"3d6f646ade6170ba","repo":"OpenBB-finance/OpenBB","slug":"error-requesting-dates-please-try-again-later","errorCode":null,"errorMessage":"Error requesting dates. Please try again later.","messagePattern":"Error requesting dates\\. Please try again later\\.","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/federal_reserve/openbb_federal_reserve/utils/ny_fed_api.py","lineNumber":364,"sourceCode":"    >>> mbs = await soma.get_agency_holdings(holding_type = \"mbs\")\n\n    >>> monthly_holdings = await soma.get_treasury_holdings(monthly = True)\n    \"\"\"\n\n    def __init__(self) -> None:\n        \"\"\"Initialize the SomaHoldings class.\"\"\"\n\n    def __repr__(self) -> str:\n        \"\"\"Replace original repr with docstring.\"\"\"\n        return str(self.__doc__)\n\n    async def get_as_of_dates(self) -> list:\n        \"\"\"Get all valid as-of dates for SOMA operations.\"\"\"\n        dates_url = _get_endpoints()[\"soma_holdings\"][\"list_as_of\"]\n        dates_response = await fetch_data(dates_url)\n        dates = dates_response.get(\"soma\", {}).get(\"asOfDates\", [])\n        if not dates:\n            raise OpenBBError(\"Error requesting dates. Please try again later.\")\n        return dates\n\n    async def get_release_log(\n        self,\n        treasury: bool = False,\n    ) -> list[dict]:\n        \"\"\"Return the last three months Agency Release and as-of dates.\n\n        Parameters\n        ----------\n        treasury: bool\n            If True, returns the last three months of Treasury release and as-of dates.\n\n        Returns\n        -------\n        List[Dict]: Dictionary of the release date and as-of dates.\n\n        Example","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/federal_reserve/openbb_federal_reserve/utils/ny_fed_api.py#L346-L382","documentation":"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.","triggerScenarios":"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.","commonSituations":"Bursty polling of SOMA endpoints hitting rate limits that return empty 200s; NY Fed deploying schema changes; corporate proxies returning stub responses.","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."],"exampleFix":"// before\nholdings = await SomaHoldings().get_agency_holdings()  # fetches as-of dates internally\n// after\nholdings = await SomaHoldings().get_agency_holdings(as_of='2024-06-05')","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"from openbb_core.app.model.abstract.error import OpenBBError\nfor attempt in range(3):\n    try:\n        dates = await SomaHoldings().get_as_of_dates()\n        break\n    except OpenBBError:\n        if attempt == 2:\n            raise\n        await asyncio.sleep(2 ** attempt)","preventionTips":["Pass explicit as_of dates from a cached list to avoid this lookup","Add exponential backoff around NY Fed metadata calls"],"tags":["openbb","ny-fed","soma","transient"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}