OpenBB-finance/OpenBB · warning · OpenBBError

The response was returned empty with no error message.

Error message

The response was returned empty with no error message.

What it means

Raised after all per-chokepoint fetch tasks complete without exception but `results` is still empty: every `get_daily_chokepoint_data` returned falsy (typically an empty list) for the requested window. Distinguishes 'API succeeded but no rows' from transport errors in the multi-chokepoint path.

Source

Thrown at openbb_platform/providers/imf/openbb_imf/models/maritime_chokepoint_volume.py:339

            ):
                chokepoint_ids.append(chokepoint)
            else:
                raise OpenBBError(
                    f"Invalid chokepoint name: {chokepoint}. Expected one of {list(CHOKEPOINTS_NAME_TO_ID.keys())}."
                )

        tasks = [
            get_one(chokepoint_id) for chokepoint_id in chokepoint_ids if chokepoint_id
        ]

        task_results = await asyncio.gather(*tasks, return_exceptions=True)

        for task_result in task_results:
            if isinstance(task_result, Exception):
                raise OpenBBError(task_result)

        if not results:
            raise OpenBBError("The response was returned empty with no error message.")

        return results

    @staticmethod
    def transform_data(
        query: ImfMaritimeChokePointVolumeQueryParams,
        data: list,
        **kwargs: Any,
    ) -> list[ImfMaritimeChokePointVolumeData]:
        """Validate and transform the raw data into the model."""
        return [ImfMaritimeChokePointVolumeData(**r) for r in data]

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Set start_date/end_date within PortWatch daily coverage (roughly 2019-present).
  2. Widen the window and confirm data exists with a broad single request first.
  3. Check date format expectations (YYYY-MM-DD).

Example fix

# before
maritime_chokepoint_volume(chokepoint='Suez Canal', start_date='2015-01-01', end_date='2015-12-31')

# after
maritime_chokepoint_volume(chokepoint='Suez Canal', start_date='2024-01-01', end_date='2024-12-31')
Defensive patterns

Strategy: validation

Validate before calling

from datetime import date
PORTWATCH_MIN = date(2019, 1, 1)  # daily coverage start
if start_date and date.fromisoformat(start_date) < PORTWATCH_MIN:
    start_date = PORTWATCH_MIN.isoformat()  # or reject with a clear message

Try / catch

except OpenBBError as e:
    if 'returned empty' in str(e):
        data = await fetch(start_date=None, end_date=None)  # then slice locally
    else:
        raise

Prevention

When it happens

Trigger: Requesting a start_date/end_date range with no observed activity data (too far in past/future), or chokepoint/date combos the PortWatch daily dataset does not cover (the daily series starts around 2019-2020).

Common situations: Backtesting pipelines requesting pre-2019 dates; requesting future dates; date format confusion causing an out-of-range window.

Related errors


AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14). Data as JSON: /api/errors/61eae7dd4a991c3f. Report an issue: GitHub.