{"record":{"id":"a2fb35a661c3ce61","repo":"OpenBB-finance/OpenBB","slug":"no-content-returned-from-the-request","errorCode":null,"errorMessage":"No content returned from the request.","messagePattern":"No content returned from the request\\.","errorType":"http","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/imf/openbb_imf/utils/port_watch_helpers.py","lineNumber":271,"sourceCode":"    from openbb_core.app.model.abstract.error import OpenBBError\n    from openbb_core.provider.utils.helpers import get_async_requests_session\n    from pandas import read_csv, to_datetime\n\n    url = (\n        \"https://hub.arcgis.com/api/v3/datasets/959214444157458aad969389b3ebe1a0_0/\"\n        + \"downloads/data?format=csv&spatialRefId=4326&where=1%3D1\"\n    )\n    content = \"\"\n    try:\n        async with await get_async_requests_session(\n            timeout=120\n        ) as session, await session.get(url) as response:\n            if response.status != 200:\n                raise OpenBBError(\n                    f\"Failed to fetch port activity data: {response.status} - {response.reason}\"\n                )\n            if response.content is None:\n                raise OpenBBError(\"No content returned from the request.\")\n            content = await response.text()\n\n        df = read_csv(StringIO(content))\n        df.date = to_datetime(df.date).dt.date\n        df = df.drop(\n            columns=[\n                d\n                for d in [\"ObjectId\", \"GlobalID\", \"year\", \"month\", \"day\"]\n                if d in df.columns\n            ]\n        )\n\n        return df.to_dict(orient=\"records\")\n\n    except Exception as e:\n        raise OpenBBError(f\"Error fetching port activity data: {e} -> {e.args}\") from e\n\n","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/utils/port_watch_helpers.py#L253-L289","documentation":"Raised in the same bulk port-activity downloader when the response returned 200 but response.content is None — i.e. a successful status with an empty body from the ArcGIS hub download endpoint. Subsequent parsing (read_csv) would fail, so the helper aborts early with this explicit message.","triggerScenarios":"ArcGIS returning an empty 200 for the CSV download (server-side glitch, redirect body not followed, or proxy stripping the body).","commonSituations":"Flaky CDN edge nodes serving empty bodies on very large files; middleware (anti-virus/proxy) consuming the response body.","solutions":["Retry the bulk download — empty 200s are typically transient.","If persistent, download the URL manually to confirm the endpoint serves bytes; if not, report the dataset id.","Bypass intermediate proxies when fetching the ~800 MB payload."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    records = await get_all_daily_port_activity_data()\nexcept OpenBBError as e:\n    if 'No content returned' in str(e):\n        raise Retryable(str(e)) from e  # empty 200: transient, retry once or twice\n    raise","preventionTips":["Bypass proxies/AV middleware for the large ArcGIS download.","Cache successful bulk results so transient emptiness does not trigger repeated 800 MB pulls."],"tags":["imf","port-watch","empty-response","bulk-download","arcgis"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}