wget not working on one machine: 404 Not Found

1

I am trying to use wget to debug and issue I am having. I have a remote machine from one server trying to reach query.json and it works fine, connects and downloads fine. I have another remote machine trying to reach the same location and I get this:

[root@test ~]# wget http://testsite.com/query.json
--20:49:55--  http://testsite.com/query.json
Resolving testsite.com... aaa.bbb.ccc.ddd
Connecting to testsite.com|aaa.bbb.ccc.ddd|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
20:49:55 ERROR 404: Not Found.

I have turned off the firewall temporary and that does not help. It looks like it is connecting to the machine (I have verified with traceroute that both machines are making it to the server), it just cant find the file, but I am sure it is there because it works with my other remote machine. Anyone know what could be causing this?

Thanks.

yellavon

Posted 2012-08-01T21:39:28.473

Reputation: 316

1Silly question: If you open that url in a browser, do you get a 404? – James T Snell – 2012-08-01T22:10:31.117

Answers

0

Check the HTTP server error logs - these often give more detail. Compare successful and unsuccessful entries in the HTTP server access logs.

RedGrittyBrick

Posted 2012-08-01T21:39:28.473

Reputation: 70 632

The error log does not show any new logs. The access log shows a POST every time it is contacted by the working machine. Nothing shows up in the log when contacted by the non-working machine. – yellavon – 2012-08-07T22:26:27.500

Even though the logs did not show an error, the access log allowed me to see it wasn't even hitting the machine. I found out in /etc/hosts I was resolving an incorrect hostname to the IP. Even though the message was sent to the correct IP, I guess the DNS did not like the incorrect hostname that may have been in the headers. – yellavon – 2012-08-08T21:23:19.657

0

Thanks to RedGrittyBrick, the access log allowed me to see it wasn't even hitting the machine.

I found out in /etc/hosts I was resolving an incorrect hostname to the IP. Even though the message was sent to the correct IP, I guess the DNS did not like the incorrect hostname that may have been in the headers.

kenorb

Posted 2012-08-01T21:39:28.473

Reputation: 16 795