Skip to content

fix: replace curl HEAD with GET request for proxy compatibility in RHEL recipe#1321

Draft
Nandu-pns wants to merge 1 commit intomainfrom
pns/fix-rhel-proxy-installation-failure
Draft

fix: replace curl HEAD with GET request for proxy compatibility in RHEL recipe#1321
Nandu-pns wants to merge 1 commit intomainfrom
pns/fix-rhel-proxy-installation-failure

Conversation

@Nandu-pns
Copy link
Contributor

@Nandu-pns Nandu-pns commented Feb 9, 2026

Infrastructure agent installation fails on RHEL/CentOS 7+ systems when using HTTP proxies, with the error:

there is no newrelic infrastructure agent available for the distribution '7'.

Root Cause

The recipe's prerequisite check here uses curl -Is (HEAD request) to verify the availability of the New Relic repository:

curl -Is {{.NEW_RELIC_DOWNLOAD_URL}}infrastructure_agent/linux/yum/el/{{.DISTRO_VERSION}}/x86_64/newrelic-infra.repo

Issue

Many corporate proxies block or mishandle HEAD requests, causing this check to fail even though:

  • The repository is accessible
  • The CLI successfully connects to New Relic APIs (api.newrelic.com, insights-collector.newrelic.com) through the same proxy
  • The HTTPS_PROXY environment variable is properly set

Solution

Changed the curl command to use a GET request instead:

curl -s -o /dev/null -w "%{http_code}" {{.NEW_RELIC_DOWNLOAD_URL}}infrastructure_agent/linux/yum/el/{{.DISTRO_VERSION}}/x86_64/newrelic-infra.repo
### Changes:

  • -s = silent mode (no progress bar)
  • -o /dev/null = discard response body
  • -w "%{http_code}" = output only HTTP status code
  • Improved regex pattern: grep -E "^2[0-9][0-9]$" for more reliable status code matching

✅ GET requests are universally supported by corporate proxies
✅ More reliable HTTP status code parsing
✅ No functional change - still validates repository availability
✅ Maintains backward compatibility with non-proxy environments

@CLAassistant
Copy link

CLAassistant commented Feb 9, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants