{"record":{"id":"8eb68d5320837514","repo":"odysseus-dev/odysseus","slug":"task-is-already-running","errorCode":null,"errorMessage":"Task is already running","messagePattern":"Task is already running","errorType":"http","errorClass":"HTTPException","httpStatus":409,"severity":"error","filePath":"routes/task_routes.py","lineNumber":872,"sourceCode":"        finally:\n            db.close()\n\n    @router.post(\"/{task_id}/run\")\n    async def run_task_now(request: Request, task_id: str, force: bool = False):\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            _require_admin_for_task_action(user, task.task_type, task.action)\n        finally:\n            db.close()\n        started = await task_scheduler.run_task_now(task_id, force=force)\n        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\"}","sourceCodeStart":854,"sourceCodeEnd":890,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/task_routes.py#L854-L890","documentation":"Error \"Task is already 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":["Wait for the current run to finish before starting again.","Stop the running task first if a restart is needed."],"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"}