Hi,
I’m trying to start up a brand new Sentry on-premise instance. Doing it with docker image is straightforward, and I have full Sentry instance running in couple minutes. Using web interface runs without any problems. Great!
…until I want to send something to Sentry from django with raven.
Running raven test
returns HTTP error 403 Forbidden on url http://sentry/api/2/store/
.
Here’s full error log:
$ docker-compose run --rm django raven test
Client configuration:
base_url : http://sentry
project : 2
public_key : af08418afb1d4e999cc0cf40bbac44ed
secret_key : 24c21d9bc3fd4b7199ecbd3a258dd14f
Sending a test message... Event ID was '397c5c7132f9440486d856e2cc70ccf1'
[2017-01-20 13:04:08,990] [ERROR ] [sentry.errors] Sentry responded with an error: HTTP Error 403: Forbidden (url: http://sentry/api/2/store/)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/raven/transport/threaded.py", line 174, in send_sync
super(ThreadedHTTPTransport, self).send(data, headers)
File "/usr/local/lib/python2.7/dist-packages/raven/transport/http.py", line 47, in send
ca_certs=self.ca_certs,
File "/usr/local/lib/python2.7/dist-packages/raven/utils/http.py", line 66, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 475, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden
Sentry responded with an error: HTTP Error 403: Forbidden (url: http://sentry/api/2/store/)
[2017-01-20 13:04:08,992] [ERROR ] [sentry.errors.uncaught] [u'This is a test message generated using ``raven test``']
[u'This is a test message generated using ``raven test``']
Here’s my setup:
#docker-compose.yml
version: '2'
services:
sentry:
image: sentry
container_name: sentry
restart: always
env_file:
- local.env
ports:
- "9000:9000"
depends_on:
- db
- redis
cron:
image: sentry
container_name: sentry_cron
command: run cron
restart: always
env_file:
- local.env
worker:
image: sentry
container_name: sentry_worker
command: run worker
restart: always
env_file:
- local.env
redis:
image: redis
container_name: sentry_redis
restart: always
db:
image: postgres
container_name: sentry_db
restart: always
# local.env
SENTRY_SECRET_KEY=&am60&z+!(u^3d*!f-f1pw603yj-rv4g2(gm4^u1c&2bfx841u
SENTRY_POSTGRES_HOST=sentry_db
SENTRY_REDIS_HOST=sentry_redis
# django settings.py
...
# Raven
RAVEN_CONFIG = {
'dsn': 'http://af08418afb1d4e999cc0cf40bbac44ed:24c21d9bc3fd4b7199ecbd3a258dd14f@sentry/2',
}
...
And given DSN from web interface is http://af08418afb1d4e999cc0cf40bbac44ed:24c21d9bc3fd4b7199ecbd3a258dd14f@sentry/2
.
Sentry version: 8.12.0
Raven version 5.32.0
(both server and client)
I tried everything but I can’t make raven work. I can’t find anything useful in web either.
Any ideas?