{"record":{"id":"8588dcfab55637be","repo":"OpenBB-finance/OpenBB","slug":"failed-to-fetch-data-response-status","errorCode":null,"errorMessage":"Failed to fetch data: {response.status}","messagePattern":"Failed to fetch data: (.+?)","errorType":"http","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/imf/openbb_imf/models/maritime_chokepoint_info.py","lineNumber":164,"sourceCode":"        query: ImfMaritimeChokePointInfoQueryParams,\n        credentials: dict[str, str] | None,\n        **kwargs: Any,\n    ) -> dict:\n        \"\"\"Extract the raw data from the IMF Port Watch API.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from openbb_core.provider.utils.helpers import get_async_requests_session\n\n        url = (\n            \"https://services9.arcgis.com/weJ1QsnbMYJlCHdG/arcgis/rest/services/\"\n            \"PortWatch_chokepoints_database/FeatureServer/0/query?outFields=*&where=1%3D1&f=geojson\"\n        )\n\n        try:\n            async with await get_async_requests_session() as session, await session.get(\n                url\n            ) as response:\n                if response.status != 200:\n                    raise OpenBBError(f\"Failed to fetch data: {response.status}\")\n\n                return await response.json()\n\n        except Exception as e:\n            raise OpenBBError(e) from e\n\n    @staticmethod\n    def transform_data(\n        query: ImfMaritimeChokePointInfoQueryParams,\n        data: dict,\n        **kwargs: Any,\n    ) -> list[ImfMaritimeChokePointInfoData]:\n        \"\"\"Transform the raw data into a list of ImfMaritimeChokePointInfoData.\"\"\"\n        if not data or \"features\" not in data:\n            raise OpenBBError(\"No data found in the response.\")\n\n        return [\n            ImfMaritimeChokePointInfoData(**feature[\"properties\"])","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/models/maritime_chokepoint_info.py#L146-L182","documentation":"Raised in `afetch_data` of the IMF maritime chokepoint info fetcher when the ArcGIS FeatureServer behind IMF PortWatch returns a non-200 HTTP status for the chokepoints GeoJSON query. Any transport-layer problem surfaces as this single status-code error; the surrounding `except` re-wraps non-OpenBB exceptions into `OpenBBError` as well.","triggerScenarios":"GET to services9.arcgis.com PortWatch_chokepoints_database FeatureServer returning 4xx/5xx: ArcGIS outage or maintenance, rate limiting (HTTP 429), or a changed/retired service URL after an ArcGIS redesign.","commonSituations":"Esri ArcGIS Online incidents; corporate proxies or firewalls blocking services9.arcgis.com; the FeatureServer layer ID changing; bursts of requests tripping ArcGIS throttling.","solutions":["Retry after a short delay — transient ArcGIS 5xx/429 responses usually clear.","Verify the URL still resolves: open the FeatureServer query in a browser or curl and check the JSON envelope.","Check ArcGIS Online health / IMF PortWatch status pages for outages.","If behind a proxy, ensure aiohttp session honors your proxy env vars and the host is allow-listed."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"for attempt in range(3):\n    try:\n        info = await obb.economy.imf.maritime_chokepoint_info()\n        break\n    except OpenBBError as e:\n        if 'Failed to fetch data' in str(e) and attempt < 2:\n            await asyncio.sleep(2 ** attempt)\n            continue\n        raise","preventionTips":["Cache chokepoint info — it is near-static reference data","Add exponential backoff around ArcGIS-backed endpoints","Monitor services9.arcgis.com availability in dashboards that depend on it"],"tags":["imf","portwatch","arcgis","network","http-status"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}