{"record":{"id":"f645bb51d9b9d09c","repo":"OpenBB-finance/OpenBB","slug":"there-was-an-error-with-the-http-request","errorCode":null,"errorMessage":"There was an error with the HTTP request","messagePattern":"There was an error with the HTTP request","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/econdb/openbb_econdb/models/port_volume.py","lineNumber":86,"sourceCode":"        \"\"\"Transform the query.\"\"\"\n        return EconDbPortVolumeQueryParams(**params)\n\n    @staticmethod\n    async def aextract_data(\n        query: EconDbPortVolumeQueryParams,\n        credentials: dict[str, str] | None,\n        **kwargs: Any,\n    ) -> dict:\n        \"\"\"Extract the raw data.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from openbb_core.provider.utils.helpers import amake_request\n\n        url = \"https://www.econdb.com/static/openbb/shipping.json\"\n\n        try:\n            response = await amake_request(url)\n        except Exception as e:\n            raise OpenBBError(\"There was an error with the HTTP request\") from e\n\n        if isinstance(response, dict):\n            return response\n        raise OpenBBError(\n            f\"Unexpected format of the response. -> Expected dict, got {str(response.__class__.__name__)}\"\n        )\n\n    @staticmethod\n    def transform_data(\n        query: EconDbPortVolumeQueryParams,\n        data: dict,\n        **kwargs: Any,\n    ) -> list[EconDbPortVolumeData]:\n        \"\"\"Transform the data.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from openbb_econdb.utils.helpers import COUNTRY_MAP\n        from pandas import DataFrame, concat, to_datetime\n","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/econdb/openbb_econdb/models/port_volume.py#L68-L104","documentation":"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.","triggerScenarios":"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.","commonSituations":"Offline/CI environments without network access; corporate proxies; transient EconDB downtime; egress-restricted containers.","solutions":["Verify connectivity: curl -I https://www.econdb.com/static/openbb/shipping.json.","Retry — transient timeouts and resets are the most common cause.","Configure proxy environment variables (HTTP_PROXY/HTTPS_PROXY) if behind a corporate proxy.","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."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"import socket, httpx\nassert socket.gethostbyname('www.econdb.com'), 'DNS resolves'\n# optional connectivity probe\n# httpx.head('https://www.econdb.com/static/openbb/shipping.json', timeout=5)","typeGuard":null,"tryCatchPattern":"from openbb_core.app.model.obbject import OpenBBError\nimport asyncio\nfor attempt in range(3):\n    try:\n        res = obb.economy.port_volume(provider='econdb')\n        break\n    except OpenBBError as e:\n        if 'HTTP request' in str(e) and attempt < 2:\n            await asyncio.sleep(2 ** attempt)\n            continue\n        raise","preventionTips":["Probe econdb.com reachability in environment health checks.","Configure proxy env vars for restricted networks.","Use exponential-backoff retry for transient transport errors."],"tags":["network","port-volume","econdb","http"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}