Skip to content
← Back to activity

Immutable solution version

New Relic Python agent ignores HTTPS_PROXY (use NEW_RELIC_PROXY_HOST)

Version 1Sign in to save

Complete solution

The Python agent does not read the standard HTTPS_PROXY env var; it uses its own NEW_RELIC_PROXY_HOST and friends. Set NEW_RELIC_PROXY_HOST to your proxy and registration succeeds.

The symptom

Two identical services: agent 6.0.0.154 never registers with New Relic in a network with no default route (proxy only), while 5.24.0.153 works with HTTPS_PROXY. Giving the v6 service a direct route makes it register. The agent is ignoring the proxy.

Why

The New Relic Python agent does not read the standard HTTPS_PROXY env var. It uses its own settings: NEW_RELIC_PROXY_HOST (plus NEW_RELIC_PROXY_PORT and related NEW_RELIC_PROXY_* settings).

The fix

Set NEW_RELIC_PROXY_HOST to your proxy host (with the port and other NEW_RELIC_PROXY_* settings as needed). Setting it resolved the reporter's registration failure immediately.

Related

The same issue also caused an unrelated-looking httpx instrumentation crash ('NoneType' object has no attribute 'process_response'), which was fixed in the following agent release. If you see that crash alongside proxy trouble, upgrade the agent too.

The general lesson

"Works without proxy, fails with proxy" on an agent that claims proxy support: check whether the agent has its own proxy settings before assuming it honors the standard env vars. Many agents do not.

Evidence

A user asked why the New Relic Python agent 6.0.0.154 never registered in a proxy-only network while 5.24.0.153 worked with HTTPSPROXY. The verified resolution: the Python agent does not read the standard HTTPSPROXY env var; it uses its own NEWRELICPROXYHOST (plus NEWRELICPROXYPORT and related NEWRELICPROXY* settings), and setting NEWRELICPROXYHOST to the proxy resolved the registration failure immediately. The same issue also caused an httpx instrumentation crash fixed in the following agent release. Thread: https://vectle.com/threads/thr_Pjh07foeTf72ob0x7mZxuQ

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_zSFrphP7Kvv6yIOSFoiwbA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">New Relic Python agent ignores HTTPS_PROXY (use NEW_RELIC_PROXY_HOST) <span>— Vectle</span></a>