Repository: evidentlyai/evidently
Issue: Trying to delete a snapshot from UI leads to internal server error
Root cause: Validation Gap

I'm running evidenlty 0.7.11 locally (in Docker, for that matter).
On pressing the "delete snapshot" button in the UI I get a 500 error, and the snapshot is not deleted.
I can delete the snapshot files manually from inside the container.
This holds true for both local and S3 storages.

Here are the relevant container logs:
```
/usr/local/lib/python3.11/site-packages/evidently/ui/service/managers/auth.py:208: RuntimeWarning: coroutine 'NoopAuthManager.check_entity_permission' was never awaited
  if not self.check_entity_permission(user_id, entity_type, entity_id, permission):
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
INFO:     10.0.62.1:46542 - "DELETE /api/projects/0197bb8a-1355-7e81-bd53-a7870be1ba6e/0198103e-a46a-7afc-8c6f-4fbfe01895d3 HTTP/1.1" 500 Internal Server Error
```

The warning is raised in these lines:
https://github.com/evidentlyai/evidently/blob/f9d2a6b13f35d9459c394b83567717ba39f0bf2e/src/evidently/ui/service/managers/auth.py#L201-L209

This method definitely needs to be `await`ed, but I don't know if it will solve the issue.


Hi @yupopov ! await is def missing, but i'll need stacktrace to debug the actual error. Can you set `EVIDENTLY_DEBUG` env to any value and try again? Should print error to logs

@mike0sv Did it, here are the full logs (the Python traceback was printed two times, I left just one for clarity):
```
/app/.venv/lib/python3.11/site-packages/evidently/ui/service/managers/auth.py:208: RuntimeWarning: coroutine 'NoopAuthManager.check_entity_permission' was never awaited
  if not self.check_entity_permission(user_id, entity_type, entity_id, permission):
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
2025-07-29T12:39:27Z ERROR    litestar        Uncaught exception (connection_type=http, path=/api/projects/0197bb8a-1355-7e81-bd53-a7870be1ba6e/0198562b-4bae-78a8-882b-03ae4c2f99e5):
Traceback (most recent call last):
  File "/app/.venv/lib/python3.11/site-packages/litestar/middleware/_internal/exceptions/middleware.py", line 158, in __call__
    await self.app(scope, receive, capture_response_started)
  File "/app/.venv/lib/python3.11/site-packages/litestar/routes/http.py", line 81, in handle
    response = await self._get_response_for_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/litestar/routes/http.py", line 133, in _get_response_for_request
    return await self._call_handler_function(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/litestar/routes/http.py", line 181, in _call_handler_function
    else await route_handler.fn(**parsed_kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/evidently/ui/service/api/projects.py", line 323, in delete_snapshot
    await project_manager.delete_snapshot(user_id, project.id, snapshot_id)
  File "/app/.venv/lib/python3.11/site-packages/evidently/ui/service/managers/projects.py", line 175, in delete_snapshot
    await self.project_metadata.delete_snapshot(project_id, snapshot_id)
  File "/app/.venv/lib/python3.11/site-packages/evidently/ui/service/storage/local/base.py", line 210, in delete_snapshot
    del self.state.snapshot_data[project_id][snapshot_id]
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: UUID('0198562b-4bae-78a8-882b-03ae4c2f99e5')
INFO:     10.0.72.1:36984 - "DELETE /api/projects/0197bb8a-1355-7e81-bd53-a7870be1ba6e/0198562b-4bae-78a8-882b-03ae4c2f99e5 HTTP/1.1" 500 Internal Server Error
```

Just in case, the snapshot itself can be accessed from the UI.

Hi @yupopov! This should be fixed in #1679. Can you install from this branch and confirm the fix?

@mike0sv Tried it, seems that everything works fine now with both types of storages. 
Logs: INFO:     `10.0.72.1:43336 - "DELETE /api/projects/0197bb8a-1355-7e81-bd53-a7870be1ba6e/0198537c-d793-7368-acd2-289f0bf8e9c7 HTTP/1.1" 204 No Content`
And the snapshot files are actually deleted.
Thanks! Closing the issue and waiting for the fix release.