question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Send events without proxy when http_proxy is configured as env variable

See original GitHub issue

Hi, I have problem with configuration of sentry_sdk. My code is behind corporate proxy and http_proxy is configured on machine as env variable (required when I want to install something via pip for example). Also I have env variable no_proxy where I added ip address for host where sentry is working (this ip is inside corporate network). When I try send event to sentry I got return code 403 (proxy refuse request). Probably sentry_sdk automacally fetch proxy from http_proxy env but ignore no_proxy. When I remove http_proxy from env everything is working. How can I configure python_sdk to ignore my http_proxy env variable? My code:

import logging
import sentry_sdk
from sentry_sdk.integrations.logging import LoggingIntegration


sentry_logging = LoggingIntegration(
    level=logging.INFO,       
    event_level=logging.ERROR 
)
sentry_sdk.init(
    dsn="<dsn>",
    integrations=[sentry_logging],
    debug=True,
)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
kennellcommented, Feb 21, 2019

I would propose that we keep the current, simple, stupid proxying behavior, but add a new flag that disables any access to the process environment. Is this an acceptable fix?

The no_proxy env var is widely used. I strongly feel that if an application reads from http_proxy it should also respect the no_proxy variable. Please consider supporting it, thanks.

2reactions
untitakercommented, Feb 3, 2019

To keep this issue updated: We discussed this internally and decided on a hard rule not to use requests. The reason for this is that we would like to explicitly control which behavior we support (since all of the new SDKs share a single piece of documentation describing that behavior, and the behavior across SDKs and across languages should be the same), and requests ideologically is the opposite of that: I for one was unaware that requests reads environment variables like that, even though I’ve been using it for quite a while.

I would propose that we keep the current, simple, stupid proxying behavior, but add a new flag that disables any access to the process environment. Is this an acceptable fix?

Read more comments on GitHub >

github_iconTop Results From Across the Web

We need to talk: Can we standardize NO_PROXY? - GitLab
Today, most Web clients support connection to proxy servers via environment variables: http_proxy / HTTP_PROXY; https_proxy / HTTPS_PROXY ...
Read more >
Working with HTTP Proxies | OpenShift Container Platform 3.11
Configuring Hosts for Proxies Using Ansible. During cluster installations, the NO_PROXY , HTTP_PROXY , and HTTPS_PROXY environment variables can be configured ...
Read more >
Working with Proxies - Chef Software
To configure proxy settings in Windows: Open System Properties. Open Environment Variables. Open System variables. Set http_proxy and ...
Read more >
Configuring Proxy Settings for All Apps | Pivotal Docs
Exclude an App From Global Proxy Settings · Set the proxy environment variables for http_proxy to an empty value by running: cf set-env...
Read more >
Using the cf CLI with a Proxy Server | Cloud Foundry Docs
The https_proxy environment variable holds the hostname or IP address ... cf ssh command for cf CLI v7 does not work through a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found