Aider Fails with NameResolutionError When DNS is Down: Unable to Fetch Model Data from raw.githubusercontent.com
When my DNS resolution is down, and I run aider, it hangs for a few seconds and then the following error prints before the usual Aider information. Error:
HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /BerriAI/litellm/main/model_prices_and_context_window.json (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7fb871e85060>: Failed to resolve 'raw.githubusercontent.com' ([Errno -3] Temporary failure in name resolution)"))
Recommendations:
-
Improve Error Messaging: Aider should provide clearer error messages when DNS resolution fails, guiding users to check their internet connection or DNS settings.
-
Cache Last Known Data: Aider could store the last known version of the required files locally, allowing it to continue functioning during network issues and refresh the cache once connectivity is restored. Could be useful if model access was still working, but github access was down.
System information:
Aider version: 0.56.0 Python version: 3.10.12 Platform: Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 Python implementation: CPython Virtual environment: Yes OS: Linux 5.15.153.1-microsoft-standard-WSL2 (64bit) Git version: git version 2.34.1
Aider v0.56.0 Main model: claude-3-5-sonnet-20240620 with diff edit format, prompt cache, infinite output Weak model: claude-3-haiku-20240307 Git repo: .git with 29 files Repo-map: using 1024 tokens, files refresh
Thank you for filing this issue.
Actual connections to LLM endpoints and other low level networking stuff gets handled by LiteLLM.
aider requires a stable network connection. If your local internet connection is too flaky for continued usage, I'd recommend to run aider on a remote server (1) with a stable connection inside a terminal multiplexer like tmux, which assures that aider continues to run, even if your local connection fails and your controlling terminal/ssh loses connection.
(1) the smallest/cheapest remote server offering from OVH/hetzner/etc (~$4/mo) is more than enough for this
Thanks for trying aider and filing this issue.
The fix is available in the main branch. You can get it by installing the latest version from github:
aider --install-main-branch
# or...
python -m pip install --upgrade git+https://github.com/paul-gauthier/aider.git
If you have a chance to try it, let me know if it works better for you. I'm going to close this issue for now, but feel free to add a comment here and I will re-open. Or feel free to file a new issue any time.