wget: error getting response: Connection reset by peer
If I run the command again, it works????
If I wait for several minutes, and try again, the first call fails again.
The URL works properly when you open it in a browser and if I replace the URL at my site with something like google.ca, the call works the first time but I'm still testing that.
I'm chasing my ISP to see if the problems are at their end.
Any suggestions on how to check whether the problem might be occurring elsewhere along the route?
Joined: 24 Jan 2016 Posts: 130 Location: Midwest, US
Posted: Mon Jun 13, 2016 0:28 Post subject:
2 thoughts here:
- try without the "-q" option in order to get more meaningful output that may reveal the actual error message. It could be http 500 internal server error for example. Busybox version of wget unfortunately does not have the -S option which prints the http headers for troubleshooting purposes.
- Any reason for using this specific user-agent? It is possible the web server is looking for certain browsers or user-agents. _________________ Buffalo WZR‑600DHP (WZR-HP-AG300H)
- try without the "-q" option in order to get more meaningful output that may reveal the actual error message. It could be http 500 internal server error for example. Busybox version of wget unfortunately does not have the -S option which prints the http headers for troubleshooting purposes.
- Any reason for using this specific user-agent? It is possible the web server is looking for certain browsers or user-agents.
Thanks for the suggestions.
Removing the `q` flag shows that it is getting bounced at the IP address for my site.
Removing the user agent did not help either.
I wrote the PHP page that the call requests. There is no logic on the page that checks the User Agent.
What is particularly intersting is that the first call fails but then the next ones do not (until you wait for several minutes and then the pattern repeats)
Joined: 24 Jan 2016 Posts: 130 Location: Midwest, US
Posted: Mon Jun 13, 2016 20:03 Post subject:
If the error shows the ip address of the webserver, then there is something not quite right.
I captured http headers while browsing the url by the ip address, then by the fqdn.
It seems that this is shared hosting webserver, and that the redirects are not working correctly with wget, only the browser works. (the shared hosting is running nginx, which reverse proxy to the apache webserver)
You may want to check with the webhost provider to see if they can help investigate. Though, my hunch is that the issue is with wget, not the webserver.