Author Topic: Error 406 with http download  (Read 6122 times)

danmal

  • Posts: 244
  • Turrets: +21/-6
Error 406 with http download
« 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.
« Last Edit: October 21, 2008, 12:19:19 pm by danmal »

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: Error 406 with http download
« Reply #1 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.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

danmal

  • Posts: 244
  • Turrets: +21/-6
Re: Error 406 with http download
« Reply #2 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.

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: Error 406 with http download
« Reply #3 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.
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

danmal

  • Posts: 244
  • Turrets: +21/-6
Re: Error 406 with http download
« Reply #4 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.

Lava Croft

  • Guest
Re: Error 406 with http download
« Reply #5 on: October 22, 2008, 04:02:44 pm »
Be independent and keep your own repo up and running!

danmal

  • Posts: 244
  • Turrets: +21/-6
Re: Error 406 with http download
« Reply #6 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.

danmal

  • Posts: 244
  • Turrets: +21/-6
Re: Error 406 with http download
« Reply #7 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.

khalsa

  • Administrator
  • Posts: 597
  • Turrets: +187/-132
    • http://www.mercenariesguild.net
Re: Error 406 with http download
« Reply #8 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
}MG{ Mercenariesguild
ਮਨੁ ਜੀਤੇ ਜਗੁ ਜੀਤਿਆ

danmal

  • Posts: 244
  • Turrets: +21/-6
Re: Error 406 with http download
« Reply #9 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.