{"record":{"id":"6ee9cd907e38e900","repo":"OpenBB-finance/OpenBB","slug":"there-was-an-error-with-the-request-and-it-was-ret","errorCode":null,"errorMessage":"There was an error with the request and it was returned empty.","messagePattern":"There was an error with the request and it was returned empty\\.","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/deribit/openbb_deribit/models/futures_instruments.py","lineNumber":120,"sourceCode":"        \"\"\"Transform the query.\"\"\"\n        return DeribitFuturesInstrumentsQueryParams(**params)\n\n    @staticmethod\n    async def aextract_data(\n        query: DeribitFuturesInstrumentsQueryParams,\n        credentials: dict[str, str] | None,\n        **kwargs: Any,\n    ) -> list:\n        \"\"\"Extract data from Deribit API.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from openbb_deribit.utils.helpers import get_instruments\n\n        try:\n            data = await get_instruments(\"all\", \"future\")\n        except Exception as e:  # pylint: disable=broad-except\n            raise OpenBBError(f\"Error fetching data: {e}\") from e\n        if not data:\n            raise OpenBBError(\n                \"There was an error with the request and it was returned empty.\"\n            )\n\n        return data\n\n    @staticmethod\n    def transform_data(\n        query: DeribitFuturesInstrumentsQueryParams,\n        data: list,\n        **kwargs: Any,\n    ) -> list[DeribitFuturesInstrumentData]:\n        \"\"\"Transform the data.\"\"\"\n        return [DeribitFuturesInstrumentData.model_validate(d) for d in data]\n","sourceCodeStart":102,"sourceCodeEnd":134,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/deribit/openbb_deribit/models/futures_instruments.py#L102-L134","documentation":"OpenBBError raised when the Deribit get_instruments call for futures succeeded (HTTP 200, no exception) but the response's 'result' field was missing or an empty list, so there is nothing to return. It guards against silently returning [] which downstream consumers would misread as 'no futures exist'.","triggerScenarios":"Deribit returning a 200 response with an error body or empty result (e.g. malformed currency/kind combination slipped through, or an API-side incident returning empty payloads). Extremely rare in practice since get_instruments('all','future') normally returns hundreds of rows.","commonSituations":"Deribit API incidents/maintenance, intermediate proxies returning empty 200s, or a changed response schema after an API revision.","solutions":["Retry after a minute — an empty 200 from this endpoint almost always means a transient Deribit-side issue.","Hit the URL directly to confirm Deribit currently returns data: /api/v2/public/get_instruments?currency=any&kind=future.","Check Deribit status page (status.deribit.com) for incidents.","If it persists, compare the raw response shape against the expected {'result': [...]} structure for schema changes."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"from openbb_core.provider.utils.errors import OpenBBError\nfor attempt in range(2):\n    try:\n        data = obb.derivatives.futures.instruments(provider=\"deribit\")\n        break\n    except OpenBBError as e:\n        if \"returned empty\" not in str(e) or attempt:\n            raise\n        time.sleep(30)  # empty 200 from Deribit is almost always transient","preventionTips":["Check status.deribit.com when this endpoint returns empty bodies.","Alert on repeated empty responses rather than silently treating them as 'no data'."],"tags":["deribit","empty-response","instruments","api-change"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}