mass-project / mass_server

Malware Analysis and Storage System - Server repository
https://mass-project.github.io/
MIT License
12 stars 4 forks source link

Log exceptions occuring on server #112

Open Silberschleier opened 6 years ago

Silberschleier commented 6 years ago

@Arne-He I just stumbled upon an exception which might explain, why sentry isn't working:

[pid: 11|app: 0|req: 4/14] 10.233.64.0 () {52 vars in 1334 bytes} [Thu Mar 29 12:55:38 2018] GET /api/analysis_system_instance/53fdca91-0f6b-4756-96e4-93e46ec95b26/scheduled_analyses/ => generated 291 bytes in 403 msecs (HTTP/1.1 500) 2 headers in 84 bytes (1 switches on core 0)
Sentry responded with an error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)> (url: https://sentry.hive.cs.uni-bonn.de/api/2/store/)
Traceback (most recent call last):
  File "/usr/lib/python3.6/urllib/request.py", line 1318, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/usr/lib/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/lib/python3.6/http/client.py", line 964, in send
    self.connect()
  File "/usr/lib/python3.6/site-packages/raven/utils/http.py", line 38, in connect
    sock, ca_certs=ca_certs, cert_reqs=ssl.CERT_REQUIRED)
  File "/usr/lib/python3.6/ssl.py", line 1149, in wrap_socket
    ciphers=ciphers)
  File "/usr/lib/python3.6/ssl.py", line 814, in __init__
    self.do_handshake()
  File "/usr/lib/python3.6/ssl.py", line 1068, in do_handshake
    self._sslobj.do_handshake()
  File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/raven/transport/threaded.py", line 165, in send_sync
    super(ThreadedHTTPTransport, self).send(url, data, headers)
  File "/usr/lib/python3.6/site-packages/raven/transport/http.py", line 43, in send
    ca_certs=self.ca_certs,
  File "/usr/lib/python3.6/site-packages/raven/utils/http.py", line 66, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/usr/lib/python3.6/urllib/request.py", line 544, in _open
    '_open', req)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/site-packages/raven/utils/http.py", line 46, in https_open
    return self.do_open(ValidHTTPSConnection, req)
  File "/usr/lib/python3.6/urllib/request.py", line 1320, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)>
["BuildError: Could not build url for endpoint 'api.analysis_system_instance_namespace_element_analyses' with values ['page']. Did you forget to specify values ['uuid']?", '  File "flask/app.py", line 1982, in wsgi_app', '  File "flask/app.py", line 1614, in full_dispatch_request', '  File "flask/app.py", line 1517, in handle_user_exception', '  File "flask/_compat.py", line 33, in reraise', '  File "flask/app.py", line 1612, in full_dispatch_request', '  File "flask/app.py", line 1598, in dispatch_request', '  File "flask_modular_auth/utils.py", line 33, in wrapped', '  File "flask_slimrest/decorators.py", line 219, in wrapper', '  File "flask_slimrest/decorators.py", line 150, in wrapper', '  File "flask_slimrest/decorators.py", line 90, in wrapper', '  File "flask_slimrest/decorators.py", line 175, in wrapper', '  File "mass_server/api/utils.py", line 30, in pagination_helper', '  File "mass_server/api/utils.py", line 9, in _get_page_link', '  File "flask/helpers.py", line 333, in url_for', '  File "flask/app.py", line 1805, in handle_url_build_error', '  File "flask/_compat.py", line 33, in reraise', '  File "flask/helpers.py", line 323, in url_for', '  File "werkzeug/routing.py", line 1768, in build']

Looks like it might be related to getsentry/raven-python#523 and this: https://community.letsencrypt.org/t/problems-with-sentry-and-letsencrypt/19948/2

Arne-He commented 6 years ago

Thanks! This was the issue, now it seems to work.