Stack Exchange
Sentry error - Temporary failure in name resolution
I got an error on my server.
DEBUG 2019-01-20 08:38:01,498 base 32461 140474717611392 Sending message of length 7076 to https://sentry.theinvaders.pro/api/30/store/
    ERROR 2019-01-20 08:38:01,505 base 32461 140474190894848 Sentry responded with an error: <urlopen error [Errno -3] Temporary failure in name resolution> (url: https://sentry.theinvaders.pro/api/30/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 "/var/www/mass/var/venv/lib/python3.6/site-packages/raven/utils/http.py", line 31, in connect
        timeout=self.timeout,
      File "/usr/lib/python3.6/socket.py", line 704, in create_connection
        for res in getaddrinfo(host, port, 0, SOCK_STREAM):
      File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo
        for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
    socket.gaierror: [Errno -3] Temporary failure in name resolution

  >During handling of the above exception, another exception occurred:

   >Traceback (most recent call last):
      File "/var/www/mass/var/venv/lib/python3.6/site-packages/raven/transport/threaded.py", line 165, in send_sync
        super(ThreadedHTTPTransport, self).send(url, data, headers)
      File "/var/www/mass/var/venv/lib/python3.6/site-packages/raven/transport/http.py", line 43, in send
        ca_certs=self.ca_certs,
      File "/var/www/mass/var/venv/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 "/var/www/mass/var/venv/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 [Errno -3] Temporary failure in name resolution>
    ERROR 2019-01-20 08:38:01,509 base 32461 140474190894848 ['OperationalError: could not translate host name "localhost" to address: Temporary failure in name resolution\n', '  File "django/core/handlers/exception.py", line 34, in inner', '  File "django/core/handlers/base.py", line 126, in _get_response', '  File "django/core/handlers/base.py", line 124, in _get_response', '  File "django/views/decorators/csrf.py", line 54, in wrapped_view', '  File "django/views/generic/base.py", line 68, in view', '  File "rest_framework/views.py", line 483, in dispatch', '  File "rest_framework/views.py", line 443, in handle_exception', '  File "rest_framework/views.py", line 480, in dispatch', '  File "rest_framework/decorators.py", line 53, in handler', '  File "mass/api/version1/candidate/views.py", line 66, in search_candidate', '  File "django/db/transaction.py", line 147, in __enter__', '  File "django/db/backends/base/base.py", line 378, in get_autocommit', '  File "django/db/backends/base/base.py", line 216, in ensure_connection', '  File "django/db/utils.py", line 89, in __exit__', '  File "django/db/backends/base/base.py", line 216, in ensure_connection', '  File "django/db/backends/base/base.py", line 194, in connect', '  File "django/db/backends/postgresql/base.py", line 178, in get_new_connection', '  File "psycopg2/__init__.py", line 130, in connect']

This lasted for 2 hours. Then the server rebooted. And everything began to work normally.
Please tell me what could be the cause of this.

The hosting provider had an error a DNS server.
