Tremulous Forum

General => Troubleshooting => Topic started by: danmal on October 21, 2008, 12:12:46 pm

Title: Error 406 with http download
Post by: danmal on October 21, 2008, 12:12:46 pm
I've been having trouble with getting auto http downloads working on a Tremulous server. Players used to be able to connect and if they didn't have the correct map then they would automatically download the map from our map repository. In the last few days players have been receiving a http error code 406 when they attempt to download a map. This error does not occur when they download the map using a web browser or using the tremfusion client.

Here's the relevant part from our server.cfg:

Code: [Select]
set sv_wwwDownload 1
set sv_wwwBaseURL "http://anarchy-vengeance.com/tremulous/maps"
set sv_dlURL "http://anarchy-vengeance.com/tremulous/maps"
set sv_wwwDLDisconnected "1"

And our autogen.cfg:
Code: [Select]
seta sv_wwwDownload "1"
seta sv_wwwBaseURL "http://anarchy-vengeance.com/tremulous/maps"

The access logs from the apache server:
Code: [Select]
220.245.134.43 - - [21/Oct/2008:21:36:41 +1100] "GET /base/map-DSArena.pk3 HTTP/1.1" 404 - "ioQ3://127.0.0.1:32123" "tremulous 1.1.0 libcurl/7.15.5"
220.245.134.43 - - [21/Oct/2008:21:43:25 +1100] "GET /base/map-DSArena.pk3 HTTP/1.1" 200 4222530 "0" "0"
220.245.134.43 - - [21/Oct/2008:21:43:45 +1100] "GET /base/map-DSArena.pk3 HTTP/1.1" 404 - "ioQ3://127.0.0.1:32123" "tremulous 1.1.0 libcurl/7.15.5"

The first and last requests are from TJW's client while the second request is from the tremfusion client.

I'm fairly sure this is a problem with the webserver as using a different map repository seems to work fine. I have no idea how to correct the issue or what could be causing the issue however. Sorry if this should have gone in the server section.

EDIT: forgot to mention that the test server is running on windows xp home with TJW's tremded and qvm. The main server is running under Linux and both servers experience the same problem.
Title: Re: Error 406 with http download
Post by: David on October 21, 2008, 02:13:19 pm
406 is "Not Acceptable" and means the web server doesn't like your request.
TremFusion changed the download code, not sure how but at one point it was sending me people's GUID's so I wouldn't be too sure its working right.
As for why, I would guess either mod_security has had some of its more pedantic shit enabled and doesn't like the referrer / UA, or someone changed something else.
Contact the host and ask them what changed?
You can also point to the MG map repo if you want.
Title: Re: Error 406 with http download
Post by: danmal on October 21, 2008, 08:23:17 pm
Unfortunately we run some custom maps that aren't hosted on the MG map repository. I'll contact my webhosting and see if they've changed any settings recently. Thanks for the help.
Title: Re: Error 406 with http download
Post by: kevlarman on October 22, 2008, 01:39:23 am
Unfortunately we run some custom maps that aren't hosted on the MG map repository. I'll contact my webhosting and see if they've changed any settings recently. Thanks for the help.
that's mostly because it's impossible for us to keep track of every single map that gets released, we'll be glad to mirror any maps that are missing as long as they don't try to replace any 1.1 data.
Title: Re: Error 406 with http download
Post by: danmal on October 22, 2008, 05:54:27 am
Most of these maps haven't been released yet and are still being updated very frequently. It wouldn't really be feasible to use a third party map repository. I might see about switching over to the MG map repo until we manage to fix this error.
Title: Re: Error 406 with http download
Post by: Lava Croft on October 22, 2008, 04:02:44 pm
Be independent and keep your own repo up and running!
Title: Re: Error 406 with http download
Post by: danmal on October 22, 2008, 09:48:44 pm
I do plan to. It might take a little bit longer as now my webhosting is claiming that it's a 3rd party application issue. How it can be a third party issue when I've tested the server setup on the MG map repo and tested it on a map repo that's hosted by the same company is beyond me. Apparently they haven't changed anything in mod_security however.
Title: Re: Error 406 with http download
Post by: danmal on October 23, 2008, 07:30:04 am
I've found the reason for the error. If the client has 'curl' within it's user-agent then it receives a 406 error message.

Thanks for telling me about that change Mr Webhosters. Hopefully they'll fix this problem.
Title: Re: Error 406 with http download
Post by: khalsa on October 23, 2008, 03:05:32 pm
If I had to guess, your webhost has a modsecurity rule like this:
Code: [Select]
SecFilterSelective "HTTP_USER_AGENT|HTTP_HOST" "^$"
You should ask them to add an exception for you, or remove this rule as it's mostly useless imo.


Khalsa
Title: Re: Error 406 with http download
Post by: danmal on October 24, 2008, 09:56:33 am
The problem has been fixed. Seems like it was a problem with mod_security. Thanks for everyones help.

If I'm reading that code correctly Khalsa (probably not as I know nothing about mod_security) then it will reject all clients that don't have a user_agent. The problem was that the clients would be rejected if they had curl in their user-agent.