{"record":{"id":"cfd6cf151f89970d","repo":"OpenBB-finance/OpenBB","slug":"failed-to-fetch-data-response-status-cfd6cf","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/port_info.py","lineNumber":260,"sourceCode":"                async with await session.get(all_ports_url) as response:\n                    if response.status != 200:\n                        raise OpenBBError(\n                            f\"Failed to fetch data: {response.status} -> {response.reason}\"\n                        )\n\n                    data = await response.json()\n\n                if \"features\" in data:\n                    output.extend(data[\"features\"])\n\n                    if \"exceededTransferLimit\" in data:\n                        while data.get(\"exceededTransferLimit\"):\n                            offset = len(output)\n                            url = f\"{all_ports_url}&resultOffset={offset}\"\n\n                            async with await session.get(url) as response:\n                                if response.status != 200:\n                                    raise OpenBBError(\n                                        f\"Failed to fetch data: {response.status}\"\n                                    )\n\n                                data = await response.json()\n                                if \"features\" in data:\n                                    output.extend(data[\"features\"])\n\n            return sorted(\n                output,\n                key=lambda x: x[\"attributes\"][\"vessel_count_total\"],\n                reverse=True,\n            )\n\n        except Exception as e:\n            raise OpenBBError(e) from e\n\n    @staticmethod\n    def transform_data(","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/models/port_info.py#L242-L278","documentation":"Raised during paginated fetching of the ports database: when `exceededTransferLimit` forces follow-up requests with `resultOffset`, any paginated request returning non-200 aborts with this status-only error. The full ports table exceeds one ArcGIS transfer, so this path runs on essentially every successful initial fetch.","triggerScenarios":"The initial all-ports query succeeds but a later page request fails mid-pagination: throttling kicked in between pages (429), transient 5xx on page 2+, or the service dropped the session. The work done so far is discarded.","commonSituations":"Repeated full-table pulls in quick succession hitting ArcGIS limits; slow networks where multi-page fetches are more likely to hit an intermittent failure.","solutions":["Retry the call — a fresh run restarts pagination from offset 0.","Space out full-table requests or cache the result locally instead of re-pulling.","Filter server-side where possible (country/port_code filters reduce pages needed in transform, though fetch still pulls all).","If persistent, check ArcGIS status and provider updates."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    ports = await obb.economy.imf.port_info()\nexcept OpenBBError as e:\n    if 'Failed to fetch data' in str(e):\n        await asyncio.sleep(10)\n        ports = await obb.economy.imf.port_info()  # restarts pagination from 0\n    else:\n        raise","preventionTips":["Persist port_info results to avoid repeated multi-page pulls","Space out scheduled pulls of the full ports table"],"tags":["imf","portwatch","arcgis","pagination","network"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}