Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sentry + Raven, HTTP Error 401: UNAUTHORIZED

I have a Sentry application, running correctly on the url: mydomain.com:11011.

I have a project created with the CDN: http://XXX:[email protected]:11011/2

This url is served with HAProxy with this configuration:

listen sentry *:11011
    mode tcp
    server app1 localhost:9005 maxconn 32

The configuration of sentry:

SENTRY_KEY = 'foo'
SENTRY_PUBLIC = True
SENTRY_URL_PREFIX = 'http://mydomain.com:11011'  # No trailing slash!
SENTRY_WEB_HOST = 'localhost'
SENTRY_WEB_PORT = 9005
SENTRY_WEB_OPTIONS = {
    'workers': 1, # the number of gunicorn workers
    'worker_class': 'gevent',
}

But I have a problem with authentication when I try Raven test, from the same server:

$ raven test http://XXX:[email protected]:11011/2
HTTPError: HTTP Error 401: UNAUTHORIZED

Also fails:

$ raven test http://XXX:YYY@localhost:9005/2
HTTPError: HTTP Error 401: UNAUTHORIZED

What could be the problem? Thanks.

like image 548
b3ni Avatar asked May 24 '12 11:05

b3ni


People also ask

What is HTTP error 401-Unauthorized?

It may be represented as 401 Unauthorized, Authorization required, HTTP error 401- Unauthorized. It represents that the request could not be authenticated. It consists of a www-Authenticate header which contains the hint on how to authorize correctly.

How do I fix a 401 error on a website?

Delete your browser's cache. There might be invalid login information stored locally in your browser that's disrupting the login process and throwing the 401 error. Clearing the cache will remove any problems in those files and give the page an opportunity to download fresh files directly from the server. If you're sure the page you're trying ...

What are the Microsoft IIS 401 error codes?

Microsoft IIS 401 Error Codes; Error: Explanation: 401.1: Logon failed. 401.2: Logon failed due to server configuration. 401.3: Unauthorized due to ACL on resource. 401.4: Authorization failed by filter. 401.5: Authorization failed by ISAPI/CGI application. 401.501


1 Answers

The problem was the different versions of raven on the client and server

In the Sentry server:

raven==1.8.4
sentry==4.4.5

In the django application:

raven==1.9.1

To fix this, do the following, in django application.

pip uninstall raven
pip install raven==1.8.4
like image 124
b3ni Avatar answered Oct 16 '22 01:10

b3ni