OpenBB-finance/OpenBB · error · OpenBBError

There was an error with the HTTP request

Error message

There was an error with the HTTP request

What it means

EconDbPortVolumeFetcher.aextract_data wraps any exception from amake_request of the static asset https://www.econdb.com/static/openbb/shipping.json into OpenBBError('There was an error with the HTTP request'). The blanket except means any transport failure — DNS, timeout, TLS, connection reset, 5xx mapped to an exception — surfaces as this message.

Source

Thrown at openbb_platform/providers/econdb/openbb_econdb/models/port_volume.py:86

        """Transform the query."""
        return EconDbPortVolumeQueryParams(**params)

    @staticmethod
    async def aextract_data(
        query: EconDbPortVolumeQueryParams,
        credentials: dict[str, str] | None,
        **kwargs: Any,
    ) -> dict:
        """Extract the raw data."""
        # pylint: disable=import-outside-toplevel
        from openbb_core.provider.utils.helpers import amake_request

        url = "https://www.econdb.com/static/openbb/shipping.json"

        try:
            response = await amake_request(url)
        except Exception as e:
            raise OpenBBError("There was an error with the HTTP request") from e

        if isinstance(response, dict):
            return response
        raise OpenBBError(
            f"Unexpected format of the response. -> Expected dict, got {str(response.__class__.__name__)}"
        )

    @staticmethod
    def transform_data(
        query: EconDbPortVolumeQueryParams,
        data: dict,
        **kwargs: Any,
    ) -> list[EconDbPortVolumeData]:
        """Transform the data."""
        # pylint: disable=import-outside-toplevel
        from openbb_econdb.utils.helpers import COUNTRY_MAP
        from pandas import DataFrame, concat, to_datetime

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Verify connectivity: curl -I https://www.econdb.com/static/openbb/shipping.json.
  2. Retry — transient timeouts and resets are the most common cause.
  3. Configure proxy environment variables (HTTP_PROXY/HTTPS_PROXY) if behind a corporate proxy.
  4. If the URL now 404s or the host is down, wait for EconDB to restore it; there is no parameter change that fixes a transport failure.
Defensive patterns

Strategy: retry

Validate before calling

import socket, httpx
assert socket.gethostbyname('www.econdb.com'), 'DNS resolves'
# optional connectivity probe
# httpx.head('https://www.econdb.com/static/openbb/shipping.json', timeout=5)

Try / catch

from openbb_core.app.model.obbject import OpenBBError
import asyncio
for attempt in range(3):
    try:
        res = obb.economy.port_volume(provider='econdb')
        break
    except OpenBBError as e:
        if 'HTTP request' in str(e) and attempt < 2:
            await asyncio.sleep(2 ** attempt)
            continue
        raise

Prevention

When it happens

Trigger: Any economy.port_volume(provider='econdb') call while the client cannot fetch shipping.json: no internet, firewall/proxy blocking econdb.com, read timeout, or the server dropping the connection.

Common situations: Offline/CI environments without network access; corporate proxies; transient EconDB downtime; egress-restricted containers.

Related errors


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