newrelic: Curling for java agent is returning a 404
curl for the java agent is returning a 404 but I get a 200 in a browser.
$ curl -I http://download.newrelic.com/newrelic/java-agent/newrelic-agent/current/
HTTP/1.1 404 Not Found
Last-Modified: Tue, 20 Sep 2016 22:13:40 GMT
x-amz-version-id: NLCnxJuorRTx5WOnoeySmdST9dAqQyv1
ETag: "a33b4d0f06bf8a8f61a6898e363bdbdb"
x-amz-error-code: NoSuchKey
x-amz-error-message: The specified key does not exist.
x-amz-error-detail-Key: newrelic/java-agent/newrelic-agent/current/index.html
x-amz-request-id: AE3A9E8C693EF743
x-amz-id-2: nrhCfQK6C74mH2f9pqlkw0PX2L54HrseJcvvVQd729sVlXQnKyRPKFoDKcW6iMplAXzdCrb+QDI=
Content-Type: text/html
Server: AmazonS3
Content-Length: 8129
Accept-Ranges: bytes
Date: Thu, 22 Sep 2016 18:44:17 GMT
Via: 1.1 varnish
Age: 2461
Connection: keep-alive
X-Served-By: cache-ord1728-ORD
X-Cache: HIT
X-Cache-Hits: 2
X-Timer: S1474569857.467308,VS0,VE0```
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 19 (7 by maintainers)
I resolved the issue by specifying the version of the Java agent.
The problem as pointed out by @drewglass is here: https://github.com/djoos-cookbooks/newrelic/blob/master/providers/agent_java.rb#L46
It is better to avoid parsing that page, just download directly: https://download.newrelic.com/newrelic/java-agent/newrelic-agent/#{version}/newrelic-java.zip And then unzip only newrelic.jar from the zip. Something like this (not tested):
Would be great if the download URL in the cookbook was an attribute so we could easily override it. Not just to work around this but to also have a more localized location to download from.
That said it seems the current issue might be because https://download.newrelic.com/newrelic/java-agent/newrelic-agent/current/ is actually responding with a 404, but most browsers will render the page so you can still see the file list.