{"record":{"id":"f466d78c48ac45ab","repo":"odysseus-dev/odysseus","slug":"task-is-not-running","errorCode":null,"errorMessage":"Task is not running","messagePattern":"Task is not running","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"routes/task_routes.py","lineNumber":889,"sourceCode":"        if not started:\n            raise HTTPException(409, \"Task is already running\")\n        return {\"ok\": True, \"message\": \"Task triggered\" + (\" in parallel\" if force else \"\")}\n\n    @router.post(\"/{task_id}/stop\")\n    async def stop_task_now(request: Request, task_id: str):\n        user = _owner(request)\n        db = SessionLocal()\n        try:\n            task = db.query(ScheduledTask).filter(ScheduledTask.id == task_id).first()\n            if not task:\n                raise HTTPException(404, \"Task not found\")\n            if user and task.owner != user:\n                raise HTTPException(403, \"Access denied\")\n        finally:\n            db.close()\n        stopped = await task_scheduler.stop_task(task_id)\n        if not stopped:\n            raise HTTPException(404, \"Task is not running\")\n        return {\"ok\": True, \"message\": \"Task stopped\"}\n\n    @router.get(\"/runs/recent\")\n    async def list_recent_runs(request: Request, limit: int = 50, max_result_chars: int = 6000):\n        \"\"\"Recent task runs across ALL tasks for this owner. Drives the Activity view.\"\"\"\n        user = _owner(request)\n        limit = max(1, min(limit, 200))\n        max_result_chars = max(500, min(max_result_chars, 20000))\n        db = SessionLocal()\n        try:\n            q = db.query(TaskRun, ScheduledTask).join(\n                ScheduledTask, TaskRun.task_id == ScheduledTask.id\n            )\n            if user:\n                # Strict owner scope — was previously OR'ing in `owner IS NULL`\n                # rows for \"legacy single-user\" back-compat, but that leaks any\n                # legacy/migrated task's full result text to every authenticated\n                # user. _migrate_assign_legacy_owner runs on startup to claim","sourceCodeStart":871,"sourceCodeEnd":907,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/task_routes.py#L871-L907","documentation":"Error \"Task is not running\" thrown in odysseus-dev/odysseus.","triggerScenarios":"Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.","commonSituations":"See trigger scenarios.","solutions":["Start the task before trying to stop it.","Refresh the task list; its state may have changed."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}