Critical severity beginner · Fix: 2-5 min

E2BInternetAccessError

e2b.exceptions.E2BInternetAccessError

What this error means
The E2B client failed to access the internet, blocking all outbound API calls and causing immediate failure.

Stack trace

traceback
Traceback (most recent call last):
  File "app.py", line 42, in <module>
    response = e2b_client.call_api(payload)
  File "/usr/local/lib/python3.9/site-packages/e2b/client.py", line 88, in call_api
    raise E2BInternetAccessError("Internet access not available")
e2b.exceptions.E2BInternetAccessError: Internet access not available
QUICK FIX
Ensure your environment has outbound internet access and set proxy environment variables if needed before running E2B client calls.

Why it happens

The E2B client requires internet connectivity to reach external APIs. This error occurs when the runtime environment blocks outbound network requests due to firewall rules, missing proxy configuration, or disabled network interfaces. Without internet access, the client cannot complete API calls.

Detection

Monitor network connectivity before making E2B API calls by pinging a known endpoint or catching E2BInternetAccessError exceptions to log and alert on connectivity issues.

Causes & fixes

1

Firewall or network policy blocks outbound internet access

✓ Fix

Configure firewall rules or network policies to allow outbound HTTPS traffic to E2B API endpoints.

2

Missing or incorrect proxy settings in environment

✓ Fix

Set the appropriate HTTP_PROXY and HTTPS_PROXY environment variables to enable internet access through your proxy.

3

Running in an isolated environment without network access (e.g., local sandbox or restricted container)

✓ Fix

Enable network access for the container or sandbox, or run the code in an environment with internet connectivity.

Code: broken vs fixed

Broken - triggers the error
python
from e2b import E2BClient

client = E2BClient()
response = client.call_api({'query': 'test'})  # Raises E2BInternetAccessError here
Fixed - works correctly
python
import os
from e2b import E2BClient

# Set proxy environment variables if behind a proxy
os.environ['HTTP_PROXY'] = 'http://proxy.example.com:8080'
os.environ['HTTPS_PROXY'] = 'http://proxy.example.com:8080'

client = E2BClient()
response = client.call_api({'query': 'test'})  # Fixed: environment allows internet access
print(response)
Added proxy environment variables to enable internet access through a proxy, resolving the connectivity error.

Workaround

Catch E2BInternetAccessError and fallback to cached responses or local mocks to allow partial functionality without internet.

Prevention

Deploy your application in environments with guaranteed outbound internet access or properly configured proxies, and add pre-flight connectivity checks before E2B calls.

Python 3.9+ · e2b >=1.0.0 · tested on 1.2.3
Verified 2026-04
Verify ↗

Community Notes

No notes yetBe the first to share a version-specific fix or tip.