sentry-extensions / cyclops

Cyclops is meant to be a high performance barrier in front of Sentry (http://getsentry.com).
http://sentry-extensions.github.io/cyclops/
164 stars 15 forks source link

Cyclops always return 404 when posting an error? Why ? #13

Open antonbabenko opened 9 years ago

antonbabenko commented 9 years ago

I am trying to integrate Cyclops installed locally on autoscaling instances to proxy requests to sentry.

I have tried to have Cyclops running with and without nginx (according to documentation), also tried with and without mysql access to sentry set in cyclops.conf. No difference. Same error... scroll further.

Relevant part of cyclops.conf:

SENTRY_BASE_URL = 'sentry.myhost.com' # tried with http:// prefix also
PROJECT_KEYS = [(3, '1c0521e44ea943d5b6cd4cd465746337', '260a53dc6441420985ae34f14b63b567')]

Since I am using https://github.com/getsentry/raven-php to log errors I specify such endpoint: http://user:pass@127.0.0.1:9100/3 , which looks correct (user:pass are required by the library).

This is the error:

$ sudo cyclops -p 9100 -b 127.0.0.1 -c /etc/cyclops.conf -d -vv
2014-11-17 18:51:33,551 - root - INFO - Loading configuration file at /etc/cyclops.conf...
2014-11-17 18:51:33,551 - root - INFO - Using configuration file at /etc/cyclops.conf.
2014-11-17 18:51:33,552 - root - INFO - Connecting to db on None:3306 on database sentry with user root
2014-11-17 18:51:33,562 - root - INFO - -- Cyclops started listening in 127.0.0.1:9100 --
2014-11-17 18:51:38,210 - tornado.access - WARNING - 404 POST /api/store/ (127.0.0.1) 0.53ms
2014-11-17 18:53:05,676 - tornado.access - INFO - 200 GET /count (127.0.0.1) 0.35ms
2014-11-17 18:53:13,682 - tornado.access - INFO - 200 GET /healthcheck (127.0.0.1) 0.34ms
2014-11-17 18:53:31,478 - tornado.access - WARNING - 404 POST /api/store (127.0.0.1) 0.91ms

Cyplops version 1.1.0 Python 2.6 RHEL 6 / Amazon Linux

antonbabenko commented 9 years ago

anyone ? /cc @heynemann maybe you know where to dig ?

WheresWardy commented 9 years ago

I've run into a similar issue (except with the Python client) and found that it always 404's for the first call after the Client class is instantiated, and then for random (but not all) calls after that. Also notice that the first call returns both a Sentry UUID AND a 404 from Cyclops. Think this may be async issues?

>>> from raven import Client
>>> client = Client('http://xxx:xxx@127.0.0.1:9000/2')
>>> client.captureMessage('hello world!')
('0aa65ffeeafb465ebe01f45ddaa9f67e',)
>>> Unable to reach Sentry log server: HTTP Error 404: Not Found (url: http://127.0.0.1:9000/api/2/store/, body: )
Traceback (most recent call last):
  File "/cyclops/.venv/lib/python2.7/site-packages/raven/transport/threaded.py", line 159, in send_sync
    super(ThreadedHTTPTransport, self).send(data, headers)
  File "/cyclops/.venv/lib/python2.7/site-packages/raven/transport/http.py", line 49, in send
    ca_certs=self.ca_certs,
  File "/cyclops/.venv/lib/python2.7/site-packages/raven/utils/http.py", line 62, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/python2.7/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/opt/python2.7/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/opt/python2.7/lib/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/opt/python2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/opt/python2.7/lib/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found
Failed to submit message: u'hello world!'

>>> client.captureMessage('hello world!')
('8ad5e07a509e474aa1c7a142f4950fd5',)
>>> Unable to reach Sentry log server: HTTP Error 404: Not Found (url: http://127.0.0.1:9000/api/2/store/, body: )
Traceback (most recent call last):
  File "/cyclops/.venv/lib/python2.7/site-packages/raven/transport/threaded.py", line 159, in send_sync
    super(ThreadedHTTPTransport, self).send(data, headers)
  File "/cyclops/.venv/lib/python2.7/site-packages/raven/transport/http.py", line 49, in send
    ca_certs=self.ca_certs,
  File "/cyclops/.venv/lib/python2.7/site-packages/raven/utils/http.py", line 62, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/python2.7/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/opt/python2.7/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/opt/python2.7/lib/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/opt/python2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/opt/python2.7/lib/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found
Failed to submit message: u'hello world!'

>>> client.captureMessage('hello world!')
hello world!
('482598bdf0c84840849bdb874a4539b4',)
>>> client.captureMessage('hello world!')
hello world!
('bd9362a895a74a48933956729585c093',)
>>> client.captureMessage('hello world!')
hello world!
('2590ac9d3b2e4d8486c008bf785e8266',)
>>> client.captureMessage('hello world!')
hello world!
('d0fc42b8d4564fdcb6ad8e8c0b2313d6',)
>>> client.captureMessage('hello world!')
('488654ade63247e4bc32b6ad306f0562',)
>>> Unable to reach Sentry log server: HTTP Error 404: Not Found (url: http://127.0.0.1:9000/api/2/store/, body: )
Traceback (most recent call last):
  File "/cyclops/.venv/lib/python2.7/site-packages/raven/transport/threaded.py", line 159, in send_sync
    super(ThreadedHTTPTransport, self).send(data, headers)
  File "/cyclops/.venv/lib/python2.7/site-packages/raven/transport/http.py", line 49, in send
    ca_certs=self.ca_certs,
  File "/cyclops/.venv/lib/python2.7/site-packages/raven/utils/http.py", line 62, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/python2.7/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/opt/python2.7/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/opt/python2.7/lib/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/opt/python2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/opt/python2.7/lib/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found
Failed to submit message: u'hello world!'
ghost commented 7 years ago

I have the same issue too :/ Did you find a workaround for that one ?