bad response Forbidden 403

telmox's Avatar

telmox

28 Jan, 2013 05:28 PM

Because of internal firewalls we have to maintain an internal mirror of rubygems. We do this with the rubygems-mirror gem plus some patches from https://github.com/rubygems/rubygems-mirror/pull/11 (I am not even sure this gem it is still maintained). This is then served via apache and it has been working without an issue for over a year.

As of lately we have started getting 403 errors when using gem for our gems mirror AND our internal gems. The issue seems to be the gem command itself. I've tested this in multiple machines:

gem source -a http://atlas-wc-02p.sys.test.net:38253/gems/
Error fetching http://atlas-wc-02p.sys.test.net:38253/gems/:
bad response Forbidden 403 (http://atlas-wc-02p.sys.test.net:38253/gems/specs.4.8.gz)

tcpdump shows that the gem command is not even hitting the server, further more a simple wget works fine:

wget http://atlas-wc-02p.sys.test.net:38253/gems/specs.4.8.gz
--2013-01-28 17:21:14-- http://atlas-wc-02p.sys.test.net:38253/gems/specs.4.8.gz Resolving atlas-wc-02p.sys.test.net... [CENSORED]
Connecting to atlas-wc-02p.sys.test.net|[CENSORED]|:38253... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1156171 (1.1M) [application/x-gzip]
Saving to: “specs.4.8.gz”

100%[============================================================================================================>] 1,156,171 2.11M/s in 0.5s

2013-01-28 17:21:14 (2.11 MB/s) - “specs.4.8.gz” saved [1156171/1156171]

The apache log files shows:

[CENSORED] - - [28/Jan/2013:17:21:17 +0000] "GET /gems/specs.4.8.gz HTTP/1.0" 200 1156171 "-" "Wget/1.12 (linux-gnu)"

I've also tried with RestClient doing a get of the file and it hits the webserver and downloads the file, same with wget but the gem command never even talks to the server anymore.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac