Skip to content
This repository has been archived by the owner on Jun 11, 2018. It is now read-only.

Problem with proxy, Django and opbeat #102

Open
eliasj opened this issue Feb 23, 2016 · 2 comments
Open

Problem with proxy, Django and opbeat #102

eliasj opened this issue Feb 23, 2016 · 2 comments

Comments

@eliasj
Copy link

eliasj commented Feb 23, 2016

Hi,
I have problem with opbeat reaching the intake server when running opbeat with Django. With Flask I don't have that problem, both running on the same server/environment.

Proxy is set in environment variables. I added so when opbeat/transport/http.py is loaded, it writes the proxies.

try:
    from urllib2 import Request, urlopen, getproxies                            
    print(getproxies())
except ImportError:                                                             
    from urllib.request import Request, urlopen

dev01:~/Proj/inv> ./manage.py opbeat test
{'ftp': 'http://wwwproxy.work.se:808', 'http': 'http://wwwproxy.work.se:808', 'https': 'http://wwwproxy.work.se:808'}

                          .o8                               .
                         "888                             .o8
     .ooooo.  oo.ooooo.   888oooo.   .ooooo.   .oooo.   .o888oo
    d88' `88b  888' `88b  d88' `88b d88' `88b `P  )88b    888
    888   888  888   888  888   888 888ooo888  .oP"888    888
    888   888  888   888  888   888 888    .o d8(  888    888 .
    `Y8bod8P'  888bod8P'  `Y8bod8P' `Y8bod8P' `Y888""8o   "888"
               888
              o888o

Trying to send a test error to Opbeat using these settings:

ORGANIZATION_ID: [....]
APP_ID: [....]
SECRET_TOKEN: [....]
SERVERS: https://intake.opbeat.com

ERROR Unable to reach Opbeat server: (url: https://intake.opbeat.com/api/v1/organizations/[....]/apps/[....]/errors/) None
ERROR Failed to submit message: u'OpbeatTestException: Hi there!'

Is there anything I need to configure or missed to test?

@beniwohli
Copy link
Member

Hi Elias

This sounds like a bug. Thanks for reporting, we'll investigate! In the meantime (and if your proxy server supports it), could you check if it helps to set the HTTPS_PROXY environment variable to https://wwwproxy.work.se:808 (probably a different port)?

@smaniotto
Copy link

smaniotto commented Dec 15, 2017

Not sure if it's related, but I'm having this error message when sending a test exception:

ERROR HTTP 400:  
ERROR Failed to submit message: 'OpbeatTestException: Hi there!' 

python manage.py opbeat check returns everything ok:

Organization, app and secret token are set, good job!

DEBUG mode is disabled! Looking good!

Opbeat APM middleware not set!

Add it to your MIDDLEWARE_CLASSES like this:

    MIDDLEWARE_CLASSES = (
        "opbeat.contrib.django.middleware.OpbeatAPMMiddleware",
        # your other middleware classes
    )

Looks like everything should be ready!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants