{"record":{"id":"961afd57d431159a","repo":"OpenBB-finance/OpenBB","slug":"all-requests-were-returned-empty","errorCode":null,"errorMessage":"All requests were returned empty.","messagePattern":"All requests were returned empty\\.","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/imf/openbb_imf/utils/port_watch_helpers.py","lineNumber":229,"sourceCode":"        \"\"\"Get the daily chokepoint data for a specific chokepoint.\"\"\"\n        try:\n            data = await get_daily_chokepoint_data(chokepoint_id, start_date, end_date)\n            chokepoints_data.extend(data)\n        except Exception as e:\n            raise OpenBBError(f\"Failed to fetch data for {chokepoint_id}: {e}\") from e\n\n    try:\n        gather_results = await asyncio.gather(\n            *[_get_one_chokepoint_data(cp) for cp in chokepoints],\n            return_exceptions=True,\n        )\n\n        for result in gather_results:\n            if isinstance(result, (OpenBBError, Exception)):\n                raise result\n\n        if not chokepoints_data:\n            raise OpenBBError(\"All requests were returned empty.\")\n\n        return chokepoints_data\n\n    except Exception as e:\n        raise OpenBBError(\n            f\"Error in fetching chokepoint data: {e} -> {e.args[0]}\"\n        ) from e\n\n\n@alru_cache(maxsize=1)\nasync def get_all_daily_port_activity_data() -> list:\n    \"\"\"Get all port activity data as a bulk download CSV.\n\n    This function fetches a large file containing daily global port activity.\n    Expect the file to be around 800 MB in size.\n\n    Returns\n    -------","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/utils/port_watch_helpers.py#L211-L247","documentation":"Raised after all 24 chokepoint fetches completed without exception but every one returned an empty list, so chokepoints_data is empty. It guards against silently returning [] which callers would mistake for valid no-data; the usual cause is an invalid/unmapped date window for which the service returns 200 with no features.","triggerScenarios":"start_date/end_date outside the Port Watch coverage (e.g. future dates or pre-2019 ranges), dates formatted in an order the query builder misinterprets, or upstream dataset temporarily empty.","commonSituations":"Defaulting start_date far in the past, swapping start/end arguments, timezone-shifted 'today' producing a future-only window.","solutions":["Verify the date window overlaps Port Watch coverage (2019-01-01 to present).","Confirm start_date <= end_date and both are 'YYYY-MM-DD'.","If dates are sane, retry later — the ArcGIS service occasionally returns empty during reindexing."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from datetime import date\nCOVERAGE_START = date(2019, 1, 1)\n\ndef valid_window(start: date, end: date) -> bool:\n    return start <= end and start >= COVERAGE_START and end <= date.today()","typeGuard":null,"tryCatchPattern":"try:\n    data = await get_all_chokepoints_data(start, end)\nexcept OpenBBError as e:\n    if 'All requests were returned empty' in str(e):\n        # date window problem, not an outage: fix inputs, do not blind-retry\n        raise InvalidRange('Adjust dates to Port Watch coverage (2019..today)') from e\n    raise","preventionTips":["Clamp requested date windows to Port Watch coverage before calling.","Validate start <= end at input parsing."],"tags":["imf","port-watch","chokepoints","empty-data","dates"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}