ConnectionError
requests.exceptions.ConnectionError
Stack trace
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='storage.runpod.io', port=443): Max retries exceeded with url: /mount (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f8c1a2b3d30>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) Why it happens
RunPod's network storage connection error occurs when the client cannot reach the storage endpoint due to DNS resolution failures, network outages, or incorrect storage mount configurations. This prevents the application from accessing required persistent storage volumes.
Detection
Monitor connection attempts to RunPod storage endpoints and catch requests.exceptions.ConnectionError exceptions to log unreachable storage or DNS failures before the app crashes.
Causes & fixes
DNS resolution failure for RunPod storage endpoint
Verify network DNS settings and ensure the host 'storage.runpod.io' resolves correctly from your environment.
Network firewall or security group blocking outbound HTTPS to RunPod storage
Allow outbound HTTPS (port 443) traffic to RunPod storage IP ranges in your firewall or cloud security groups.
Incorrect or missing storage mount credentials or configuration
Check and update your RunPod storage mount configuration and credentials to ensure proper authentication and access.
Temporary network outage or intermittent connectivity issues
Implement retry logic with exponential backoff around storage connection attempts to handle transient network failures.
Code: broken vs fixed
import requests
response = requests.get('https://storage.runpod.io/mount') # This line triggers ConnectionError
print(response.content) import os
import requests
import time
# Added retry logic and environment-based config
storage_url = 'https://storage.runpod.io/mount'
max_retries = 3
for attempt in range(max_retries):
try:
response = requests.get(storage_url)
response.raise_for_status()
print(response.content)
break
except requests.exceptions.ConnectionError as e:
print(f'Connection failed on attempt {attempt + 1}: {e}')
if attempt < max_retries - 1:
time.sleep(2 ** attempt) # exponential backoff
else:
raise # re-raise after max retries Workaround
Wrap storage connection calls in try/except ConnectionError, log the failure, and fallback to local cache or degraded mode until connectivity is restored.
Prevention
Use robust network monitoring and alerting for storage endpoint availability, configure retries with backoff, and validate storage credentials and DNS settings during deployment.