SDK Connection Error
Use this page when the Python SDK cannot reach the Custodian Labs API.
Symptoms
You may see:
APIConnectionErrorRequest failed after retries- Timeout errors
- DNS or network errors
- Connection refused errors
Likely Causes
Common causes include:
- The machine has no internet access.
- A firewall, proxy, or VPN is blocking requests.
CUSTODIAN_SDK_BASE_URLis incorrect.- The backend environment is temporarily unavailable.
- The request timed out before the API responded.
How to Check
- Confirm your internet connection works.
- Confirm the SDK base URL is correct.
- Check whether a proxy or VPN is required.
- Try the same request from another network.
- Restart the Python process after changing environment variables.
You can print the environment variables used by your app:
import os
print(os.getenv("CUSTODIAN_SDK_BASE_URL"))
print(bool(os.getenv("CUSTODIAN_SDK_API_KEY")))
Do not print the full API key value.
How to Fix
- Set
CUSTODIAN_SDK_BASE_URLto the correct API base URL. - Set
CUSTODIAN_SDK_API_KEY. - Restart your Python process.
- Retry after confirming network access.
- Contact support if the API appears unavailable from multiple networks.