New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ErrCode: 6, Reason: 'Could not resolve host: www.amazon.com' #257
Comments
It seems to be DNS issue. Does it work on other network connections? |
The issue appears to be transient, as it previously functioned correctly on the same network. Initially, the system was capable of resolving DNS problems after several attempts. I have implemented a routine in my script to reboot the router and renew the IP address. However, the problem has become more frequent following router restarts. Despite rebuilding the session post-restart, the issue persists. |
Does it start to work immediately once you restart the curl_cffi script? |
If i run the script again, it does work i think. It doesnt work only when i restart the router without stopping the script. |
I see, you were restarting your router so that the ISP will assign you a new IP, but then the scripts you are running are unhappy with the expected network downtime and stops working even after the network is back on. Apprently, there are some caching mechanism for DNS server address and resolutions, which should be the root cause. My suggestion is that either you restart the script after you restart the router, or you can set your DNS to a server like |
Restarting the script is not a viable solution, as it is designed to run continuously for days without interruption. I cannot be present to manually restart the script each time this error occurs. |
If you were restarting the router, of course the request will be timed out. Does setting another DNS work? |
The timeout errors are not related to restarting the router. Once a timeout error occurs, subsequent requests continue to experience this error as well. Typically, these errors are resolved automatically after several attempts, but lately, they have been persistent and continuous.
The above error was for a request that timed out without receiving a single byte. And is there a way to set DNS in curl_cffi? |
You should set your DNS on the OS level. For Linux, it's something like |
Failed to perform, ErrCode: 6, Reason: 'Could not resolve host: www.amazon.com'. This may be a libcurl error, See https://curl.se/libcurl/c/libcurl-errors.html first for more details.
The text was updated successfully, but these errors were encountered: