[Bug]:[Bug]: Backend process dies silently after SAFE_DELETE_BULK_CONFIRM_REQUIRED — unhandled exception escapes ASGI stack, menus appear frozen
Do you need to file an issue?
- [x] I have searched the existing issues and this bug is not already filed.
- [x] I believe this is a legitimate bug, not just a question or feature request.
Describe the bug
backend WARNING deeptutor.api.main - Failed to initialize LLM client at startup: No active LLM model is configured. Please set it in Settings > Language models. backend INFO: Application startup complete. backend INFO: Uvicorn running on http://0.0.0.0:8001 (Press CTRL+C to quit) ... backend WARNING deeptutor.api.routers.settings - Admin applied catalog; resetting global LLM/embedding clients. In-flight user turns may flip backend client mid-call. backend WARNING deeptutor.api.routers.settings - Admin applied catalog; resetting global LLM/embedding clients. In-flight user turns may flip backend client mid-call. backend [safe-delete][SAFE_DELETE_BULK_CONFIRM_REQUIRED] {"count":50,"threshold":50,"scope":"turn","targets":["...\outputs\.deeptutor-write-probe-1dfdf158e7004805881db8e0adfb5975"],"targetCount":1} backend ERROR: Traceback (most recent call last): backend File ".../Lib/asyncio/runners.py", line 196, in run backend return runner.run(main) backend File ".../Lib/asyncio/base_events.py", line 712, in run_until_complete backend self.run_forever() backend File ".../Lib/asyncio/base_events.py", line 683, in run_forever backend self._run_once() backend File ".../Lib/asyncio/base_events.py", line 2060, in _run_once backend handle._run() backend File ".../Lib/asyncio/events.py", line 89, in _run backend self._context.run(self._callback, *self._args) backend File ".../anyio/_core/_tasks.py", line 327, in _run_coro backend retval = await self._coro backend File ".../starlette/middleware/base.py", line 149, in coro backend await self.app(scope, receive_or_disconnect, send_no_error) backend File ".../deeptutor/services/workspace/activity.py", line 75, in call backend await self.app(scope, receive, send) backend File ".../starlette/middleware/exceptions.py", line 63, in call backend await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) backend File ".../starlette/_exception_handler.py", line 42, in wrapped_app backend await app(scope, receive, sender) backend File ".../fastapi/middleware/asyncexitstack.py", line 18, in call backend await self.app(scope, receive, send) backend File ".../starlette/routing.py", line 683, in call backend await self.middleware_stack(scope, receive, send) backend File ".../fastapi/routing.py", line 2811, in app backend await route.handle(scope, receive, send) backend ... (truncated)
Steps to reproduce
No response
Expected Behavior
No response
Related Module
Dashboard
Configuration Used
No response
Logs and screenshots
No response
Additional Information
- DeepTutor Version:
- Operating System:
- Python Version:
- Node.js Version:
- Browser (if applicable):
- Related Issues:
I reproduced the failed-request part on current dev (60fb3bdfd), but not process termination. This was a real single-worker Uvicorn process on macOS/Python 3.12, with a disposable home and a controlled RuntimeError from Path.unlink only for the workspace write probe; it was not the reporter's Windows/delete-guard environment.
PUT /api/settings/workspacereturns 500 when probe cleanup raises.- Subsequent
/health/liveand/health/readyrequests on a separate connection both return 200, with the same backend PID still alive. Selecting a normal workspace then succeeds. - Applying #2455's service change (
76b59c456) to current dev makes the same cleanup-failure request return 200. A control that failsprobe.touch()still returns 400 before and after.
One regression-test detail for #2455: current dev uses .dt-wp-*, whereas that PR's test intercepts only .deeptutor-write-probe*. Consequently, the original test passes even without the fix on current dev. Matching both prefixes and asserting that the guard actually ran produces the expected fail-before/pass-after result:
if self.name.startswith((".dt-wp-", ".deeptutor-write-probe")):
refused.append(self)
raise _DeleteGuardError("SAFE_DELETE_BULK_CONFIRM_REQUIRED")
# After service.set_workspace(root):
assert refused
With that test adjustment and the service change, the workspace router/content-workspace suites give 37 passed.
For the process-exit part, could you add the final exception lines from the untruncated traceback, how the backend was started, its exit code if available, and whether /health/live still responds after the failure? The controlled exception alone does not explain the reported shutdown.
Fixed on local dev (92a26ae3cc198aaf1ad32420e1b83dbd40f8ddbc). fix(storage): isolate attachment writes and settle document parsing. Validated with targeted regression tests and compatibility checks.
will be fixed in the next releases!