"Deposit.DoesNotExist: Deposit matching query does not exist" ??
Sentry Issue: SWH-DEPOSIT-3J
It's not sure what to do with this error:
Deposit.DoesNotExist: Deposit matching query does not exist.
(8 additional frame(s) were not displayed)
...
File "/opt/swh/.local/lib/python3.10/site-packages/swh/deposit/api/common.py", line 1149, in post
status, iri_key, receipt = self.process_post(
File "/opt/swh/.local/lib/python3.10/site-packages/swh/deposit/api/collection.py", line 140, in process_post
receipt = self._atom_entry(req, headers, collection_name, deposit)
File "/opt/swh/.local/lib/python3.10/site-packages/swh/deposit/api/common.py", line 862, in _atom_entry
self._set_deposit_origin_from_metadata(deposit, metadata_tree, headers)
File "/opt/swh/.local/lib/python3.10/site-packages/swh/deposit/api/common.py", line 958, in _set_deposit_origin_from_metadata
.get()
File "django/db/models/query.py", line 649, in get
raise self.model.DoesNotExist(
Error in the rpc service:
2024-10-18T08:47:26.670127220Z deposit {"asctime": "2024-10-18 08:47:26,668", "levelname": "ERROR", "processName": "MainProcess", "process": 7, "threadName": "ThreadPoolExecutor-1_0", "pathname": "/opt/swh/.local/lib/python3.10/site-packages/django/utils/log.py", "lineno": 248, "funcName": "log_response", "name": "django.request", "message": "Internal Server Error: /1/inveniordm/", "exc_info": "Traceback (most recent call last):\n File \"/opt/swh/.local/lib/python3.10/site
-packages/django/core/handlers/exception.py\", line 55, in inner\n response = get_response(request)\n File \"/opt/swh/.local/lib/python3.10/site-packages/django/core/handlers/base.py\", line 197, in _get_response\n response = wrapped_callback(request, *callback_args, **callback_kwargs)\n File \"/opt/swh/.local/lib/python3.10/site-packages/sentry_sdk/integrations/django/views.py\", line 90, in sentry_wrapped_callback\n return callback(request, *args, **kwargs)\n
File \"/opt/swh/.local/lib/python3.10/site-packages/django/views/decorators/csrf.py\", line 65, in _view_wrapper\n return view_func(request, *args, **kwargs)\n File \"/opt/swh/.local/lib/python3.10/site-packages/django/views/generic/base.py\", line 104, in view\n return self.dispatch(request, *args, **kwargs)\n File \"/opt/swh/.local/lib/python3.10/site-packages/rest_framework/views.py\", line 509, in dispatch\n response = self.handle_exception(exc)\n File \"/op
t/swh/.local/lib/python3.10/site-packages/rest_framework/views.py\", line 469, in handle_exception\n self.raise_uncaught_exception(exc)\n File \"/opt/swh/.local/lib/python3.10/site-packages/rest_framework/views.py\", line 480, in raise_uncaught_exception\n raise exc\n File \"/opt/swh/.local/lib/python3.10/site-packages/rest_framework/views.py\", line 506, in dispatch\n response = handler(request, *args, **kwargs)\n File \"/opt/swh/.local/lib/python3.10/site-pack
ages/swh/deposit/api/common.py\", line 1149, in post\n status, iri_key, receipt = self.process_post(\n File \"/opt/swh/.local/lib/python3.10/site-packages/swh/deposit/api/collection.py\", line 140, in process_post\n receipt = self._atom_entry(req, headers, collection_name, deposit)\n File \"/opt/swh/.local/lib/python3.10/site-packages/swh/deposit/api/common.py\", line 862, in _atom_entry\n self._set_deposit_origin_from_metadata(deposit, metadata_tree, headers)\n
File \"/opt/swh/.local/lib/python3.10/site-packages/swh/deposit/api/common.py\", line 958, in _set_deposit_origin_from_metadata\n .get()\n File \"/opt/swh/.local/lib/python3.10/site-packages/django/db/models/query.py\", line 649, in get\n raise self.model.DoesNotExist(\nswh.deposit.models.Deposit.DoesNotExist: Deposit matching query does not exist.", "status_code": 500, "request": "<WSGIRequest: POST '/1/inveniordm/'>"}
- If it's a deposit file content error, it should be properly managed as it triggers an 500 error which raises a monitoring alert
<swhprombot> Alert WARNING firing - production/archive-production-rke2 - Ingress_Errors_In_Production - Ingress swh-cassandra/deposit-ingress-default has 20.00% errors within the last 5 minutes.
The user experience is probably not optimal too.
- if it's an internal error, some logs should be added to help to diagnose the issue
Edited by Vincent Sellier