OpenBB-finance/OpenBB · warning · RuntimeError

OBBject Extension Error -> An OBBject extension that acts

Error message

OBBject Extension Error -> 

An OBBject extension that acts on command output is installed but has not been enabled in `system_settings.json`.

Set `allow_on_command_output` to True to enable it.
Or, set the environment variable `OPENBB_ALLOW_ON_COMMAND_OUTPUT` to True.

Proceed with caution as this may have security implications.

Ensure the extension is installed from a trusted source.

What it means

Raised in the DOT fetcher's `transform_data` when the IMF response contains a `data` list that is empty. The request parsed and executed fine, but no trade records came back — typically a valid country pair with no published bilateral trade, or a date window outside coverage. Uses `EmptyDataError`, so OpenBB downstream handles it as 'no data' rather than a crash.

Source

Thrown at openbb_platform/core/openbb_core/app/model/extension.py:71

        self.results_only = results_only

        # This must be explicitly enabled.
        if self.on_command_output is False and (
            self.command_output_paths
            or self.results_only is True
            or self.immutable is False
        ):
            raise ValueError(
                "OBBject Extension Error -> 'on_command_output' must be set as True when"
                + " 'command_output_paths', 'results_only' or 'immutable' is set.",
            )

        # The user must explicitly enable OBBject extensions that act on command output.
        if (
            self.on_command_output
            and not SystemService().system_settings.allow_on_command_output
        ):
            raise RuntimeError(
                "OBBject Extension Error -> \n\n"
                + "An OBBject extension that acts on command output is installed "
                + "but has not been enabled in `system_settings.json`.\n\n"
                + "Set `allow_on_command_output` to True to enable it.\n"
                + "Or, set the environment variable `OPENBB_ALLOW_ON_COMMAND_OUTPUT` to True."
                + "\n\nProceed with caution as this may have security implications.\n\n"
                + "Ensure the extension is installed from a trusted source.\n\n",
            )

        # The user must explicitly enable OBBject extensions that modify output.
        if (
            self.on_command_output
            and self.immutable is False
            and not SystemService().system_settings.allow_mutable_extensions
        ):
            raise RuntimeError(
                "OBBject Extension Error -> \n\n"
                + "An OBBject extension that modifies the output is installed "

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Widen the date range or drop date filters to see if the pair has any history at all.
  2. For batch jobs, catch `EmptyDataError` and record the pair as 'no data' instead of failing the run.
  3. Try the world aggregate (`counterpart='W00'`) to confirm the reporter itself has data.
  4. Retry once to rule out a transient empty IMF response.

Example fix

# before
res = obb.economy.direction_of_trade(provider='imf', country='USA', counterpart='ATA', start_date='2024-01-01')

# after
res = obb.economy.direction_of_trade(provider='imf', country='USA', counterpart='W00')
Defensive patterns

Strategy: try-catch

Try / catch

from openbb_core.app.model.empty_data import EmptyDataError

try:
    res = obb.economy.direction_of_trade(provider='imf', country=c, counterpart=cp, start_date=sd)
except EmptyDataError:
    res = None  # pair has no reported bilateral trade; record and continue the batch

Prevention

When it happens

Trigger: Requesting trade between two countries that don't report bilateral flows to each other (e.g. small economy pairs); a `start_date`/`end_date` window before DOT series begin; `limit=0`-style degenerate parameter combos; IMF publication lag for recent periods.

Common situations: Batch loops over many country pairs where a minority of pairs have no data; very recent date ranges hitting publication lag; historical windows earlier than the DOT series start (commonly 1980s).

Related errors


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