divide_zero = { "level": "error", "exception": { "values": [ { "module": None, "type": "ZeroDivisionError", "value": "division by zero", "mechanism": {"type": "django", "handled": False}, "stacktrace": { "frames": [ { "filename": "django/core/handlers/exception.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", "function": "inner", "module": "django.core.handlers.exception", "lineno": 34, "pre_context": [ " can rely on getting a response instead of an exception.", ' """', " @wraps(get_response)", " def inner(request):", " try:", ], "context_line": " response = get_response(request)", "post_context": [ " except Exception as exc:", " response = response_for_exception(request, exc)", " return response", " return inner", "", ], "vars": { "request": "", "exc": "ZeroDivisionError('division by zero')", "get_response": ">", }, "in_app": True, }, { "filename": "django/core/handlers/base.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", "function": "_get_response", "module": "django.core.handlers.base", "lineno": 115, "pre_context": [ " if response is None:", " wrapped_callback = self.make_view_atomic(callback)", " try:", " response = wrapped_callback(request, *callback_args, **callback_kwargs)", " except Exception as e:", ], "context_line": " response = self.process_exception_by_middleware(e, request)", "post_context": [ "", " # Complain if the view returned None (a common error).", " if response is None:", " if isinstance(callback, types.FunctionType): # FBV", " view_name = callback.__name__", ], "vars": { "self": "", "request": "", "response": "None", "resolver": "", "resolver_match": "ResolverMatch(func=errors.views.DivideZeroView, args=(), kwargs={}, url_name=divide_zero, app_names=[], namespaces=[], route=divide-zero/)", "callback": "", "callback_args": [], "callback_kwargs": {}, "middleware_method": "", "wrapped_callback": "", }, "in_app": True, }, { "filename": "django/core/handlers/base.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", "function": "_get_response", "module": "django.core.handlers.base", "lineno": 113, "pre_context": [ " break", "", " if response is None:", " wrapped_callback = self.make_view_atomic(callback)", " try:", ], "context_line": " response = wrapped_callback(request, *callback_args, **callback_kwargs)", "post_context": [ " except Exception as e:", " response = self.process_exception_by_middleware(e, request)", "", " # Complain if the view returned None (a common error).", " if response is None:", ], "vars": { "self": "", "request": "", "response": "None", "resolver": "", "resolver_match": "ResolverMatch(func=errors.views.DivideZeroView, args=(), kwargs={}, url_name=divide_zero, app_names=[], namespaces=[], route=divide-zero/)", "callback": "", "callback_args": [], "callback_kwargs": {}, "middleware_method": "", "wrapped_callback": "", }, "in_app": True, }, { "filename": "django/views/generic/base.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/views/generic/base.py", "function": "view", "module": "django.views.generic.base", "lineno": 71, "pre_context": [ " if not hasattr(self, 'request'):", " raise AttributeError(", " \"%s instance has no 'request' attribute. Did you override \"", ' "setup() and forget to call super()?" % cls.__name__', " )", ], "context_line": " return self.dispatch(request, *args, **kwargs)", "post_context": [ " view.view_class = cls", " view.view_initkwargs = initkwargs", "", " # take name and docstring from class", " update_wrapper(view, cls, updated=())", ], "vars": { "request": "", "args": [], "kwargs": {}, "self": "", "cls": "", "initkwargs": {}, }, "in_app": True, }, { "filename": "django/views/generic/base.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/views/generic/base.py", "function": "dispatch", "module": "django.views.generic.base", "lineno": 97, "pre_context": [ " # request method isn't on the approved list.", " if request.method.lower() in self.http_method_names:", " handler = getattr(self, request.method.lower(), self.http_method_not_allowed)", " else:", " handler = self.http_method_not_allowed", ], "context_line": " return handler(request, *args, **kwargs)", "post_context": [ "", " def http_method_not_allowed(self, request, *args, **kwargs):", " logger.warning(", " 'Method Not Allowed (%s): %s', request.method, request.path,", " extra={'status_code': 405, 'request': request}", ], "vars": { "self": "", "request": "", "args": [], "kwargs": {}, "handler": ">", }, "in_app": True, }, { "filename": "errors/views.py", "abs_path": "/code/errors/views.py", "function": "get", "module": "errors.views", "lineno": 12, "pre_context": [ ' template_name = "home.html"', "", "", "class DivideZeroView(View):", " def get(self, request, *args, **kwargs):", ], "context_line": " 0/0", "post_context": [ "", "", "class DatabaseErrorView(View):", " def get(self, request, *args, **kwargs):", ' User.objects.get(id="9999999")', ], "vars": { "self": "", "request": "", "args": [], "kwargs": {}, }, "in_app": True, }, ] }, } ] }, "event_id": "3eb248c5287a4c2fbaa427da654c3795", "timestamp": "2020-01-10T20:21:46.434385Z", "breadcrumbs": [], "transaction": "/divide-zero/", "contexts": { "trace": { "trace_id": "fd41c870fbd44f76ad9f051b488b88bc", "span_id": "9bb4230421b756c2", "parent_span_id": "a0637603c584f464", "op": "django.middleware", "description": "django.middleware.clickjacking.XFrameOptionsMiddleware.__call__", }, "runtime": { "name": "CPython", "version": "3.8.1", "build": "3.8.1 (default, Jan 3 2020, 22:55:55) \n[GCC 8.3.0]", }, }, "modules": { "wheel": "0.33.6", "webencodings": "0.5.1", "wcwidth": "0.1.8", "urllib3": "1.25.7", "typed-ast": "1.4.0", "traitlets": "4.3.3", "tomlkit": "0.5.8", "toml": "0.10.0", "sqlparse": "0.3.0", "six": "1.13.0", "shellingham": "1.3.1", "setuptools": "44.0.0", "sentry-sdk": "0.14.0", "secretstorage": "3.1.1", "requests": "2.22.0", "requests-toolbelt": "0.8.0", "regex": "2020.1.8", "pytz": "2019.3", "pyrsistent": "0.14.11", "pyparsing": "2.4.6", "pylev": "1.3.0", "pygments": "2.5.2", "pycparser": "2.19", "ptyprocess": "0.6.0", "prompt-toolkit": "3.0.2", "poetry": "1.0.0", "pkginfo": "1.5.0.1", "pip": "19.3.1", "pickleshare": "0.7.5", "pexpect": "4.7.0", "pathspec": "0.7.0", "pastel": "0.1.1", "parso": "0.5.2", "msgpack": "0.6.2", "lockfile": "0.12.2", "keyring": "19.3.0", "jsonschema": "3.2.0", "jeepney": "0.4.2", "jedi": "0.15.2", "ipython": "7.11.1", "ipython-genutils": "0.2.0", "ipdb": "0.12.3", "idna": "2.8", "html5lib": "1.0.1", "django": "3.0.2", "decorator": "4.4.1", "cryptography": "2.8", "clikit": "0.4.1", "click": "7.0", "cleo": "0.7.6", "chardet": "3.0.4", "cffi": "1.13.2", "certifi": "2019.11.28", "cachy": "0.3.0", "cachecontrol": "0.12.6", "black": "19.10b0", "backcall": "0.1.0", "attrs": "19.3.0", "asgiref": "3.2.3", "appdirs": "1.4.3", }, "extra": {"sys.argv": ["./manage.py", "runserver", "0.0.0.0:8001"]}, "request": { "url": "http://localhost:8001/divide-zero/", "query_string": "", "method": "GET", "env": {"SERVER_NAME": "210ecca56d59", "SERVER_PORT": "8001"}, "headers": { "Content-Length": "", "Content-Type": "text/plain", "Host": "localhost:8001", "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "Accept-Language": "en-US,en;q=0.5", "Accept-Encoding": "gzip, deflate", "Referer": "http://localhost:8001/", "Connection": "keep-alive", "Upgrade-Insecure-Requests": "1", "Dnt": "1", }, }, "server_name": "210ecca56d59", "sdk": { "name": "sentry.python", "version": "0.14.0", "packages": [{"name": "pypi:sentry-sdk", "version": "0.14.0"}], "integrations": [ "argv", "atexit", "dedupe", "django", "excepthook", "logging", "modules", "stdlib", "threading", ], }, "platform": "python", "_meta": { "request": {"headers": {"Cookie": {"": {"rem": [["!config", "x", 0, 315]]}}}} }, } database_error = { "level": "error", "exception": { "values": [ { "module": "django.contrib.auth.models", "type": "User.DoesNotExist", "value": "User matching query does not exist.", "mechanism": {"type": "django", "handled": False}, "stacktrace": { "frames": [ { "filename": "django/core/handlers/exception.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", "function": "inner", "module": "django.core.handlers.exception", "lineno": 34, "pre_context": [ " can rely on getting a response instead of an exception.", ' """', " @wraps(get_response)", " def inner(request):", " try:", ], "context_line": " response = get_response(request)", "post_context": [ " except Exception as exc:", " response = response_for_exception(request, exc)", " return response", " return inner", "", ], "vars": { "request": "", "exc": "DoesNotExist('User matching query does not exist.')", "get_response": ">", }, "in_app": True, }, { "filename": "django/core/handlers/base.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", "function": "_get_response", "module": "django.core.handlers.base", "lineno": 115, "pre_context": [ " if response is None:", " wrapped_callback = self.make_view_atomic(callback)", " try:", " response = wrapped_callback(request, *callback_args, **callback_kwargs)", " except Exception as e:", ], "context_line": " response = self.process_exception_by_middleware(e, request)", "post_context": [ "", " # Complain if the view returned None (a common error).", " if response is None:", " if isinstance(callback, types.FunctionType): # FBV", " view_name = callback.__name__", ], "vars": { "self": "", "request": "", "response": "None", "resolver": "", "resolver_match": "ResolverMatch(func=errors.views.DatabaseErrorView, args=(), kwargs={}, url_name=database_error, app_names=[], namespaces=[], route=database-error/)", "callback": "", "callback_args": [], "callback_kwargs": {}, "middleware_method": "", "wrapped_callback": "", }, "in_app": True, }, { "filename": "django/core/handlers/base.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", "function": "_get_response", "module": "django.core.handlers.base", "lineno": 113, "pre_context": [ " break", "", " if response is None:", " wrapped_callback = self.make_view_atomic(callback)", " try:", ], "context_line": " response = wrapped_callback(request, *callback_args, **callback_kwargs)", "post_context": [ " except Exception as e:", " response = self.process_exception_by_middleware(e, request)", "", " # Complain if the view returned None (a common error).", " if response is None:", ], "vars": { "self": "", "request": "", "response": "None", "resolver": "", "resolver_match": "ResolverMatch(func=errors.views.DatabaseErrorView, args=(), kwargs={}, url_name=database_error, app_names=[], namespaces=[], route=database-error/)", "callback": "", "callback_args": [], "callback_kwargs": {}, "middleware_method": "", "wrapped_callback": "", }, "in_app": True, }, { "filename": "django/views/generic/base.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/views/generic/base.py", "function": "view", "module": "django.views.generic.base", "lineno": 71, "pre_context": [ " if not hasattr(self, 'request'):", " raise AttributeError(", " \"%s instance has no 'request' attribute. Did you override \"", ' "setup() and forget to call super()?" % cls.__name__', " )", ], "context_line": " return self.dispatch(request, *args, **kwargs)", "post_context": [ " view.view_class = cls", " view.view_initkwargs = initkwargs", "", " # take name and docstring from class", " update_wrapper(view, cls, updated=())", ], "vars": { "request": "", "args": [], "kwargs": {}, "self": "", "cls": "", "initkwargs": {}, }, "in_app": True, }, { "filename": "django/views/generic/base.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/views/generic/base.py", "function": "dispatch", "module": "django.views.generic.base", "lineno": 97, "pre_context": [ " # request method isn't on the approved list.", " if request.method.lower() in self.http_method_names:", " handler = getattr(self, request.method.lower(), self.http_method_not_allowed)", " else:", " handler = self.http_method_not_allowed", ], "context_line": " return handler(request, *args, **kwargs)", "post_context": [ "", " def http_method_not_allowed(self, request, *args, **kwargs):", " logger.warning(", " 'Method Not Allowed (%s): %s', request.method, request.path,", " extra={'status_code': 405, 'request': request}", ], "vars": { "self": "", "request": "", "args": [], "kwargs": {}, "handler": ">", }, "in_app": True, }, { "filename": "errors/views.py", "abs_path": "/code/errors/views.py", "function": "get", "module": "errors.views", "lineno": 17, "pre_context": [ " 0/0", "", "", "class DatabaseErrorView(View):", " def get(self, request, *args, **kwargs):", ], "context_line": ' User.objects.get(id="9999999")', "post_context": [ "", "", "class PostErrorView(View):", " def post(self, request, *args, **kwargs):", ' request.POST["nope"]', ], "vars": { "self": "", "request": "", "args": [], "kwargs": {}, }, "in_app": True, }, { "filename": "django/db/models/manager.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/db/models/manager.py", "function": "manager_method", "module": "django.db.models.manager", "lineno": 82, "pre_context": [ "", " @classmethod", " def _get_queryset_methods(cls, queryset_class):", " def create_method(name, method):", " def manager_method(self, *args, **kwargs):", ], "context_line": " return getattr(self.get_queryset(), name)(*args, **kwargs)", "post_context": [ " manager_method.__name__ = method.__name__", " manager_method.__doc__ = method.__doc__", " return manager_method", "", " new_methods = {}", ], "vars": { "self": "", "args": [], "kwargs": {"id": "'9999999'"}, "name": "'get'", }, "in_app": True, }, { "filename": "django/db/models/query.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/db/models/query.py", "function": "get", "module": "django.db.models.query", "lineno": 415, "pre_context": [ " clone.query.set_limits(high=limit)", " num = len(clone)", " if num == 1:", " return clone._result_cache[0]", " if not num:", ], "context_line": " raise self.model.DoesNotExist(", "post_context": [ ' "%s matching query does not exist." %', " self.model._meta.object_name", " )", " raise self.model.MultipleObjectsReturned(", " 'get() returned more than one %s -- it returned %s!' % (", ], "vars": { "self": "", "args": [], "kwargs": {"id": "'9999999'"}, "clone": "", "limit": "21", "num": "0", }, "in_app": True, }, ] }, } ] }, "event_id": "f84f7731ece04760a43fe1d777734fef", "timestamp": "2020-01-10T20:23:23.513387Z", "breadcrumbs": [ { "message": 'SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login", "auth_user"."is_superuser", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."date_joined" FROM "auth_user" WHERE "auth_user"."id" = %s LIMIT 21', "category": "query", "data": {}, "timestamp": "2020-01-10T20:23:23.508243Z", "type": "default", } ], "transaction": "/database-error/", "contexts": { "trace": { "trace_id": "b56f4a334dbb4409bed0055b1c51d70a", "span_id": "bceca618ab73060c", "parent_span_id": "995f271d2ef32861", "op": "django.middleware", "description": "django.middleware.clickjacking.XFrameOptionsMiddleware.__call__", }, "runtime": { "name": "CPython", "version": "3.8.1", "build": "3.8.1 (default, Jan 3 2020, 22:55:55) \n[GCC 8.3.0]", }, }, "modules": { "wheel": "0.33.6", "webencodings": "0.5.1", "wcwidth": "0.1.8", "urllib3": "1.25.7", "typed-ast": "1.4.0", "traitlets": "4.3.3", "tomlkit": "0.5.8", "toml": "0.10.0", "sqlparse": "0.3.0", "six": "1.13.0", "shellingham": "1.3.1", "setuptools": "44.0.0", "sentry-sdk": "0.14.0", "secretstorage": "3.1.1", "requests": "2.22.0", "requests-toolbelt": "0.8.0", "regex": "2020.1.8", "pytz": "2019.3", "pyrsistent": "0.14.11", "pyparsing": "2.4.6", "pylev": "1.3.0", "pygments": "2.5.2", "pycparser": "2.19", "ptyprocess": "0.6.0", "prompt-toolkit": "3.0.2", "poetry": "1.0.0", "pkginfo": "1.5.0.1", "pip": "19.3.1", "pickleshare": "0.7.5", "pexpect": "4.7.0", "pathspec": "0.7.0", "pastel": "0.1.1", "parso": "0.5.2", "msgpack": "0.6.2", "lockfile": "0.12.2", "keyring": "19.3.0", "jsonschema": "3.2.0", "jeepney": "0.4.2", "jedi": "0.15.2", "ipython": "7.11.1", "ipython-genutils": "0.2.0", "ipdb": "0.12.3", "idna": "2.8", "html5lib": "1.0.1", "django": "3.0.2", "decorator": "4.4.1", "cryptography": "2.8", "clikit": "0.4.1", "click": "7.0", "cleo": "0.7.6", "chardet": "3.0.4", "cffi": "1.13.2", "certifi": "2019.11.28", "cachy": "0.3.0", "cachecontrol": "0.12.6", "black": "19.10b0", "backcall": "0.1.0", "attrs": "19.3.0", "asgiref": "3.2.3", "appdirs": "1.4.3", }, "extra": {"sys.argv": ["./manage.py", "runserver", "0.0.0.0:8001"]}, "request": { "url": "http://localhost:8001/database-error/", "query_string": "", "method": "GET", "env": {"SERVER_NAME": "210ecca56d59", "SERVER_PORT": "8001"}, "headers": { "Content-Length": "", "Content-Type": "text/plain", "Host": "localhost:8001", "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "Accept-Language": "en-US,en;q=0.5", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", "Referer": "http://localhost:8001/", "Cookie": "", "Upgrade-Insecure-Requests": "1", "Dnt": "1", }, }, "server_name": "210ecca56d59", "sdk": { "name": "sentry.python", "version": "0.14.0", "packages": [{"name": "pypi:sentry-sdk", "version": "0.14.0"}], "integrations": [ "argv", "atexit", "dedupe", "django", "excepthook", "logging", "modules", "stdlib", "threading", ], }, "platform": "python", "_meta": { "request": {"headers": {"Cookie": {"": {"rem": [["!config", "x", 0, 315]]}}}} }, } post_error = { "level": "error", "exception": { "values": [ { "module": None, "type": "KeyError", "value": "'nope'", "mechanism": {"type": "django", "handled": False}, "stacktrace": { "frames": [ { "filename": "django/utils/datastructures.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/utils/datastructures.py", "function": "__getitem__", "module": "django.utils.datastructures", "lineno": 76, "pre_context": [ ' """', " Return the last data value for this key, or [] if it's an empty list;", " raise KeyError if not found.", ' """', " try:", ], "context_line": " list_ = super().__getitem__(key)", "post_context": [ " except KeyError:", " raise MultiValueDictKeyError(key)", " try:", " return list_[-1]", " except IndexError:", ], "vars": { "self": { "csrfmiddlewaretoken": "'G1Cfr5bnrZz4ICfiDwPdGMY865fvWB1RN1RZD2vJCYxaEJsQfFX1QUdlKEwNfELr'", "param1": "'val'", }, "key": "'nope'", "__class__": "", }, "in_app": True, } ] }, }, { "module": "django.utils.datastructures", "type": "MultiValueDictKeyError", "value": "'nope'", "mechanism": {"type": "django", "handled": False}, "stacktrace": { "frames": [ { "filename": "django/core/handlers/exception.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", "function": "inner", "module": "django.core.handlers.exception", "lineno": 34, "pre_context": [ " can rely on getting a response instead of an exception.", ' """', " @wraps(get_response)", " def inner(request):", " try:", ], "context_line": " response = get_response(request)", "post_context": [ " except Exception as exc:", " response = response_for_exception(request, exc)", " return response", " return inner", "", ], "vars": { "request": "", "exc": "MultiValueDictKeyError('nope')", "get_response": ">", }, "in_app": True, }, { "filename": "django/core/handlers/base.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", "function": "_get_response", "module": "django.core.handlers.base", "lineno": 115, "pre_context": [ " if response is None:", " wrapped_callback = self.make_view_atomic(callback)", " try:", " response = wrapped_callback(request, *callback_args, **callback_kwargs)", " except Exception as e:", ], "context_line": " response = self.process_exception_by_middleware(e, request)", "post_context": [ "", " # Complain if the view returned None (a common error).", " if response is None:", " if isinstance(callback, types.FunctionType): # FBV", " view_name = callback.__name__", ], "vars": { "self": "", "request": "", "response": "None", "resolver": "", "resolver_match": "ResolverMatch(func=errors.views.PostErrorView, args=(), kwargs={}, url_name=post_error, app_names=[], namespaces=[], route=post-error/)", "callback": "", "callback_args": [], "callback_kwargs": {}, "middleware_method": "", "wrapped_callback": "", }, "in_app": True, }, { "filename": "django/core/handlers/base.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", "function": "_get_response", "module": "django.core.handlers.base", "lineno": 113, "pre_context": [ " break", "", " if response is None:", " wrapped_callback = self.make_view_atomic(callback)", " try:", ], "context_line": " response = wrapped_callback(request, *callback_args, **callback_kwargs)", "post_context": [ " except Exception as e:", " response = self.process_exception_by_middleware(e, request)", "", " # Complain if the view returned None (a common error).", " if response is None:", ], "vars": { "self": "", "request": "", "response": "None", "resolver": "", "resolver_match": "ResolverMatch(func=errors.views.PostErrorView, args=(), kwargs={}, url_name=post_error, app_names=[], namespaces=[], route=post-error/)", "callback": "", "callback_args": [], "callback_kwargs": {}, "middleware_method": "", "wrapped_callback": "", }, "in_app": True, }, { "filename": "django/views/generic/base.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/views/generic/base.py", "function": "view", "module": "django.views.generic.base", "lineno": 71, "pre_context": [ " if not hasattr(self, 'request'):", " raise AttributeError(", " \"%s instance has no 'request' attribute. Did you override \"", ' "setup() and forget to call super()?" % cls.__name__', " )", ], "context_line": " return self.dispatch(request, *args, **kwargs)", "post_context": [ " view.view_class = cls", " view.view_initkwargs = initkwargs", "", " # take name and docstring from class", " update_wrapper(view, cls, updated=())", ], "vars": { "request": "", "args": [], "kwargs": {}, "self": "", "cls": "", "initkwargs": {}, }, "in_app": True, }, { "filename": "django/views/generic/base.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/views/generic/base.py", "function": "dispatch", "module": "django.views.generic.base", "lineno": 97, "pre_context": [ " # request method isn't on the approved list.", " if request.method.lower() in self.http_method_names:", " handler = getattr(self, request.method.lower(), self.http_method_not_allowed)", " else:", " handler = self.http_method_not_allowed", ], "context_line": " return handler(request, *args, **kwargs)", "post_context": [ "", " def http_method_not_allowed(self, request, *args, **kwargs):", " logger.warning(", " 'Method Not Allowed (%s): %s', request.method, request.path,", " extra={'status_code': 405, 'request': request}", ], "vars": { "self": "", "request": "", "args": [], "kwargs": {}, "handler": ">", }, "in_app": True, }, { "filename": "errors/views.py", "abs_path": "/code/errors/views.py", "function": "post", "module": "errors.views", "lineno": 22, "pre_context": [ ' User.objects.get(id="9999999")', "", "", "class PostErrorView(View):", " def post(self, request, *args, **kwargs):", ], "context_line": ' request.POST["nope"]', "post_context": [ "", "", "class DatabaseStackErrorView(View):", " def get(self, request, *args, **kwargs):", " users = User.objects.all()", ], "vars": { "self": "", "request": "", "args": [], "kwargs": {}, }, "in_app": True, }, { "filename": "django/utils/datastructures.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/utils/datastructures.py", "function": "__getitem__", "module": "django.utils.datastructures", "lineno": 78, "pre_context": [ " raise KeyError if not found.", ' """', " try:", " list_ = super().__getitem__(key)", " except KeyError:", ], "context_line": " raise MultiValueDictKeyError(key)", "post_context": [ " try:", " return list_[-1]", " except IndexError:", " return []", "", ], "vars": { "self": { "csrfmiddlewaretoken": "'G1Cfr5bnrZz4ICfiDwPdGMY865fvWB1RN1RZD2vJCYxaEJsQfFX1QUdlKEwNfELr'", "param1": "'val'", }, "key": "'nope'", "__class__": "", }, "in_app": True, }, ] }, }, ] }, "event_id": "33338bdfb1024cffa7a023c22e36436c", "timestamp": "2020-01-10T20:24:16.721470Z", "breadcrumbs": [], "transaction": "/post-error/", "contexts": { "trace": { "trace_id": "ac1605c393434f16834cffc98eb81240", "span_id": "8c46c105c38431d3", "parent_span_id": "8b01678e63255c9c", "op": "django.middleware", "description": "django.middleware.clickjacking.XFrameOptionsMiddleware.__call__", }, "runtime": { "name": "CPython", "version": "3.8.1", "build": "3.8.1 (default, Jan 3 2020, 22:55:55) \n[GCC 8.3.0]", }, }, "modules": { "wheel": "0.33.6", "webencodings": "0.5.1", "wcwidth": "0.1.8", "urllib3": "1.25.7", "typed-ast": "1.4.0", "traitlets": "4.3.3", "tomlkit": "0.5.8", "toml": "0.10.0", "sqlparse": "0.3.0", "six": "1.13.0", "shellingham": "1.3.1", "setuptools": "44.0.0", "sentry-sdk": "0.14.0", "secretstorage": "3.1.1", "requests": "2.22.0", "requests-toolbelt": "0.8.0", "regex": "2020.1.8", "pytz": "2019.3", "pyrsistent": "0.14.11", "pyparsing": "2.4.6", "pylev": "1.3.0", "pygments": "2.5.2", "pycparser": "2.19", "ptyprocess": "0.6.0", "prompt-toolkit": "3.0.2", "poetry": "1.0.0", "pkginfo": "1.5.0.1", "pip": "19.3.1", "pickleshare": "0.7.5", "pexpect": "4.7.0", "pathspec": "0.7.0", "pastel": "0.1.1", "parso": "0.5.2", "msgpack": "0.6.2", "lockfile": "0.12.2", "keyring": "19.3.0", "jsonschema": "3.2.0", "jeepney": "0.4.2", "jedi": "0.15.2", "ipython": "7.11.1", "ipython-genutils": "0.2.0", "ipdb": "0.12.3", "idna": "2.8", "html5lib": "1.0.1", "django": "3.0.2", "decorator": "4.4.1", "cryptography": "2.8", "clikit": "0.4.1", "click": "7.0", "cleo": "0.7.6", "chardet": "3.0.4", "cffi": "1.13.2", "certifi": "2019.11.28", "cachy": "0.3.0", "cachecontrol": "0.12.6", "black": "19.10b0", "backcall": "0.1.0", "attrs": "19.3.0", "asgiref": "3.2.3", "appdirs": "1.4.3", }, "extra": {"sys.argv": ["./manage.py", "runserver", "0.0.0.0:8001"]}, "request": { "url": "http://localhost:8001/post-error/", "query_string": "", "method": "POST", "env": {"SERVER_NAME": "210ecca56d59", "SERVER_PORT": "8001"}, "headers": { "Content-Length": "95", "Content-Type": "application/x-www-form-urlencoded", "Host": "localhost:8001", "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "Accept-Language": "en-US,en;q=0.5", "Accept-Encoding": "gzip, deflate", "Origin": "http://localhost:8001", "Connection": "keep-alive", "Referer": "http://localhost:8001/", "Cookie": "", "Upgrade-Insecure-Requests": "1", "Dnt": "1", }, "data": { "csrfmiddlewaretoken": "G1Cfr5bnrZz4ICfiDwPdGMY865fvWB1RN1RZD2vJCYxaEJsQfFX1QUdlKEwNfELr", "param1": "val", }, }, "server_name": "210ecca56d59", "sdk": { "name": "sentry.python", "version": "0.14.0", "packages": [{"name": "pypi:sentry-sdk", "version": "0.14.0"}], "integrations": [ "argv", "atexit", "dedupe", "django", "excepthook", "logging", "modules", "stdlib", "threading", ], }, "platform": "python", "_meta": { "request": {"headers": {"Cookie": {"": {"rem": [["!config", "x", 0, 315]]}}}} }, } database_stack_error = { "level": "error", "exception": { "values": [ { "module": "django.contrib.auth.models", "type": "User.DoesNotExist", "value": "User matching query does not exist.", "mechanism": {"type": "django", "handled": False}, "stacktrace": { "frames": [ { "filename": "django/core/handlers/exception.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", "function": "inner", "module": "django.core.handlers.exception", "lineno": 34, "pre_context": [ " can rely on getting a response instead of an exception.", ' """', " @wraps(get_response)", " def inner(request):", " try:", ], "context_line": " response = get_response(request)", "post_context": [ " except Exception as exc:", " response = response_for_exception(request, exc)", " return response", " return inner", "", ], "vars": { "request": "", "exc": "DoesNotExist('User matching query does not exist.')", "get_response": ">", }, "in_app": True, }, { "filename": "django/core/handlers/base.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", "function": "_get_response", "module": "django.core.handlers.base", "lineno": 115, "pre_context": [ " if response is None:", " wrapped_callback = self.make_view_atomic(callback)", " try:", " response = wrapped_callback(request, *callback_args, **callback_kwargs)", " except Exception as e:", ], "context_line": " response = self.process_exception_by_middleware(e, request)", "post_context": [ "", " # Complain if the view returned None (a common error).", " if response is None:", " if isinstance(callback, types.FunctionType): # FBV", " view_name = callback.__name__", ], "vars": { "self": "", "request": "", "response": "None", "resolver": "", "resolver_match": "ResolverMatch(func=errors.views.DatabaseStackErrorView, args=(), kwargs={}, url_name=database_stack_error, app_names=[], namespaces=[], route=database-stack-error/)", "callback": "", "callback_args": [], "callback_kwargs": {}, "middleware_method": "", "wrapped_callback": "", }, "in_app": True, }, { "filename": "django/core/handlers/base.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", "function": "_get_response", "module": "django.core.handlers.base", "lineno": 113, "pre_context": [ " break", "", " if response is None:", " wrapped_callback = self.make_view_atomic(callback)", " try:", ], "context_line": " response = wrapped_callback(request, *callback_args, **callback_kwargs)", "post_context": [ " except Exception as e:", " response = self.process_exception_by_middleware(e, request)", "", " # Complain if the view returned None (a common error).", " if response is None:", ], "vars": { "self": "", "request": "", "response": "None", "resolver": "", "resolver_match": "ResolverMatch(func=errors.views.DatabaseStackErrorView, args=(), kwargs={}, url_name=database_stack_error, app_names=[], namespaces=[], route=database-stack-error/)", "callback": "", "callback_args": [], "callback_kwargs": {}, "middleware_method": "", "wrapped_callback": "", }, "in_app": True, }, { "filename": "django/views/generic/base.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/views/generic/base.py", "function": "view", "module": "django.views.generic.base", "lineno": 71, "pre_context": [ " if not hasattr(self, 'request'):", " raise AttributeError(", " \"%s instance has no 'request' attribute. Did you override \"", ' "setup() and forget to call super()?" % cls.__name__', " )", ], "context_line": " return self.dispatch(request, *args, **kwargs)", "post_context": [ " view.view_class = cls", " view.view_initkwargs = initkwargs", "", " # take name and docstring from class", " update_wrapper(view, cls, updated=())", ], "vars": { "request": "", "args": [], "kwargs": {}, "self": "", "cls": "", "initkwargs": {}, }, "in_app": True, }, { "filename": "django/views/generic/base.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/views/generic/base.py", "function": "dispatch", "module": "django.views.generic.base", "lineno": 97, "pre_context": [ " # request method isn't on the approved list.", " if request.method.lower() in self.http_method_names:", " handler = getattr(self, request.method.lower(), self.http_method_not_allowed)", " else:", " handler = self.http_method_not_allowed", ], "context_line": " return handler(request, *args, **kwargs)", "post_context": [ "", " def http_method_not_allowed(self, request, *args, **kwargs):", " logger.warning(", " 'Method Not Allowed (%s): %s', request.method, request.path,", " extra={'status_code': 405, 'request': request}", ], "vars": { "self": "", "request": "", "args": [], "kwargs": {}, "handler": ">", }, "in_app": True, }, { "filename": "errors/views.py", "abs_path": "/code/errors/views.py", "function": "get", "module": "errors.views", "lineno": 28, "pre_context": [ "", "", "class DatabaseStackErrorView(View):", " def get(self, request, *args, **kwargs):", " users = User.objects.all()", ], "context_line": " self.make_error(users)", "post_context": [ "", " def make_error(self, users):", " User.objects.get(id=users.count() + 10000)", "", "", ], "vars": { "self": "", "request": "", "args": [], "kwargs": {}, "users": "", }, "in_app": True, }, { "filename": "errors/views.py", "abs_path": "/code/errors/views.py", "function": "make_error", "module": "errors.views", "lineno": 31, "pre_context": [ " def get(self, request, *args, **kwargs):", " users = User.objects.all()", " self.make_error(users)", "", " def make_error(self, users):", ], "context_line": " User.objects.get(id=users.count() + 10000)", "post_context": [ "", "", "class TemplateErrorView(TemplateView):", ' template_name = "template_error.html"', "", ], "vars": { "self": "", "users": "", }, "in_app": True, }, { "filename": "django/db/models/manager.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/db/models/manager.py", "function": "manager_method", "module": "django.db.models.manager", "lineno": 82, "pre_context": [ "", " @classmethod", " def _get_queryset_methods(cls, queryset_class):", " def create_method(name, method):", " def manager_method(self, *args, **kwargs):", ], "context_line": " return getattr(self.get_queryset(), name)(*args, **kwargs)", "post_context": [ " manager_method.__name__ = method.__name__", " manager_method.__doc__ = method.__doc__", " return manager_method", "", " new_methods = {}", ], "vars": { "self": "", "args": [], "kwargs": {"id": "10000"}, "name": "'get'", }, "in_app": True, }, { "filename": "django/db/models/query.py", "abs_path": "/usr/local/lib/python3.8/site-packages/django/db/models/query.py", "function": "get", "module": "django.db.models.query", "lineno": 415, "pre_context": [ " clone.query.set_limits(high=limit)", " num = len(clone)", " if num == 1:", " return clone._result_cache[0]", " if not num:", ], "context_line": " raise self.model.DoesNotExist(", "post_context": [ ' "%s matching query does not exist." %', " self.model._meta.object_name", " )", " raise self.model.MultipleObjectsReturned(", " 'get() returned more than one %s -- it returned %s!' % (", ], "vars": { "self": "", "args": [], "kwargs": {"id": "10000"}, "clone": "", "limit": "21", "num": "0", }, "in_app": True, }, ] }, } ] }, "event_id": "5cdb58a7463f4cd8b7c57d3372fb5ae9", "timestamp": "2020-01-10T20:24:52.681701Z", "breadcrumbs": [ { "message": 'SELECT COUNT(*) AS "__count" FROM "auth_user"', "category": "query", "data": {}, "timestamp": "2020-01-10T20:24:52.674131Z", "type": "default", }, { "message": 'SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login", "auth_user"."is_superuser", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."date_joined" FROM "auth_user" WHERE "auth_user"."id" = %s LIMIT 21', "category": "query", "data": {}, "timestamp": "2020-01-10T20:24:52.677030Z", "type": "default", }, ], "transaction": "/database-stack-error/", "contexts": { "trace": { "trace_id": "8d5aef32be9f475baded433af937cd3a", "span_id": "a6d8e8401c38eb7e", "parent_span_id": "aa5ecbdf2bf83338", "op": "django.middleware", "description": "django.middleware.clickjacking.XFrameOptionsMiddleware.__call__", }, "runtime": { "name": "CPython", "version": "3.8.1", "build": "3.8.1 (default, Jan 3 2020, 22:55:55) \n[GCC 8.3.0]", }, }, "modules": { "wheel": "0.33.6", "webencodings": "0.5.1", "wcwidth": "0.1.8", "urllib3": "1.25.7", "typed-ast": "1.4.0", "traitlets": "4.3.3", "tomlkit": "0.5.8", "toml": "0.10.0", "sqlparse": "0.3.0", "six": "1.13.0", "shellingham": "1.3.1", "setuptools": "44.0.0", "sentry-sdk": "0.14.0", "secretstorage": "3.1.1", "requests": "2.22.0", "requests-toolbelt": "0.8.0", "regex": "2020.1.8", "pytz": "2019.3", "pyrsistent": "0.14.11", "pyparsing": "2.4.6", "pylev": "1.3.0", "pygments": "2.5.2", "pycparser": "2.19", "ptyprocess": "0.6.0", "prompt-toolkit": "3.0.2", "poetry": "1.0.0", "pkginfo": "1.5.0.1", "pip": "19.3.1", "pickleshare": "0.7.5", "pexpect": "4.7.0", "pathspec": "0.7.0", "pastel": "0.1.1", "parso": "0.5.2", "msgpack": "0.6.2", "lockfile": "0.12.2", "keyring": "19.3.0", "jsonschema": "3.2.0", "jeepney": "0.4.2", "jedi": "0.15.2", "ipython": "7.11.1", "ipython-genutils": "0.2.0", "ipdb": "0.12.3", "idna": "2.8", "html5lib": "1.0.1", "django": "3.0.2", "decorator": "4.4.1", "cryptography": "2.8", "clikit": "0.4.1", "click": "7.0", "cleo": "0.7.6", "chardet": "3.0.4", "cffi": "1.13.2", "certifi": "2019.11.28", "cachy": "0.3.0", "cachecontrol": "0.12.6", "black": "19.10b0", "backcall": "0.1.0", "attrs": "19.3.0", "asgiref": "3.2.3", "appdirs": "1.4.3", }, "extra": {"sys.argv": ["./manage.py", "runserver", "0.0.0.0:8001"]}, "request": { "url": "http://localhost:8001/database-stack-error/", "query_string": "", "method": "GET", "env": {"SERVER_NAME": "210ecca56d59", "SERVER_PORT": "8001"}, "headers": { "Content-Length": "", "Content-Type": "text/plain", "Host": "localhost:8001", "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "Accept-Language": "en-US,en;q=0.5", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", "Referer": "http://localhost:8001/", "Cookie": "", "Upgrade-Insecure-Requests": "1", "Dnt": "1", }, }, "server_name": "210ecca56d59", "sdk": { "name": "sentry.python", "version": "0.14.0", "packages": [{"name": "pypi:sentry-sdk", "version": "0.14.0"}], "integrations": [ "argv", "atexit", "dedupe", "django", "excepthook", "logging", "modules", "stdlib", "threading", ], }, "platform": "python", "_meta": { "request": {"headers": {"Cookie": {"": {"rem": [["!config", "x", 0, 315]]}}}} }, } message = { "message": "Page not found!", "level": "info", "event_id": "a5c440e008bd4384b7a905572aea46b5", "timestamp": "2020-03-08T16:16:31.703477Z", "breadcrumbs": [], "transaction": "/message/", "contexts": { "trace": { "trace_id": "5df0789e0e1843efb71d0cab07d71a15", "span_id": "ab2451dbd2b9e97e", "parent_span_id": "b77c0e1230fd1252", "op": "django.middleware", "description": "django.middleware.clickjacking.XFrameOptionsMiddleware.__call__", }, "runtime": { "name": "CPython", "version": "3.8.2", "build": "3.8.2 (default, Feb 26 2020, 15:09:34) \n[GCC 8.3.0]", }, }, "modules": { "wheel": "0.34.2", "webencodings": "0.5.1", "wcwidth": "0.1.8", "urllib3": "1.25.8", "typed-ast": "1.4.1", "traitlets": "4.3.3", "tomlkit": "0.5.11", "toml": "0.10.0", "sqlparse": "0.3.1", "six": "1.14.0", "shellingham": "1.3.2", "setuptools": "45.2.0", "sentry-sdk": "0.14.2", "secretstorage": "3.1.2", "requests": "2.23.0", "requests-toolbelt": "0.8.0", "regex": "2020.2.20", "pytz": "2019.3", "pyrsistent": "0.14.11", "pyparsing": "2.4.6", "pylev": "1.3.0", "pygments": "2.6.1", "pycparser": "2.20", "ptyprocess": "0.6.0", "prompt-toolkit": "3.0.3", "poetry": "1.0.0", "pkginfo": "1.5.0.1", "pip": "20.0.2", "pickleshare": "0.7.5", "pexpect": "4.8.0", "pathspec": "0.7.0", "pastel": "0.2.0", "parso": "0.6.2", "msgpack": "1.0.0", "lockfile": "0.12.2", "keyring": "19.3.0", "jsonschema": "3.2.0", "jeepney": "0.4.3", "jedi": "0.16.0", "ipython": "7.13.0", "ipython-genutils": "0.2.0", "ipdb": "0.12.3", "idna": "2.9", "html5lib": "1.0.1", "django": "3.0.4", "decorator": "4.4.2", "cryptography": "2.8", "clikit": "0.4.2", "click": "7.0", "cleo": "0.7.6", "chardet": "3.0.4", "cffi": "1.14.0", "certifi": "2019.11.28", "cachy": "0.3.0", "cachecontrol": "0.12.6", "black": "19.10b0", "backcall": "0.1.0", "attrs": "19.3.0", "asgiref": "3.2.3", "appdirs": "1.4.3", }, "extra": {"sys.argv": ["./manage.py", "runserver", "0.0.0.0:8001"]}, "request": { "url": "http://localhost:8001/message/", "query_string": "", "method": "GET", "env": {"SERVER_NAME": "6dbd4da42f28", "SERVER_PORT": "8001"}, "headers": { "Content-Length": "", "Content-Type": "text/plain", "Host": "localhost:8001", "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "Accept-Language": "en-US,en;q=0.5", "Accept-Encoding": "gzip, deflate", "Referer": "http://localhost:8001/", "Connection": "keep-alive", "Cookie": "", "Upgrade-Insecure-Requests": "1", "Dnt": "1", "Cache-Control": "max-age=0", }, }, "server_name": "6dbd4da42f28", "sdk": { "name": "sentry.python", "version": "0.14.2", "packages": [{"name": "pypi:sentry-sdk", "version": "0.14.2"}], "integrations": [ "argv", "atexit", "dedupe", "django", "excepthook", "logging", "modules", "stdlib", "threading", ], }, "platform": "python", "_meta": { "request": {"headers": {"Cookie": {"": {"rem": [["!config", "x", 0, 324]]}}}} }, } all_django_events = [ divide_zero, database_error, post_error, database_stack_error, message, ]