{"record":{"id":"010676a5a824a924","repo":"odysseus-dev/odysseus","slug":"object-mask-failed-exc","errorCode":null,"errorMessage":"Object mask failed: {exc}","messagePattern":"Object mask failed: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"routes/gallery/gallery_routes.py","lineNumber":205,"sourceCode":"        if boxes is None or scores is None or len(boxes) == 0:\n            raise HTTPException(404, f\"No visible object matched '{query}'\")\n        idx = int(torch.argmax(scores).item())\n        box = [float(v) for v in boxes[idx].detach().cpu().tolist()]\n        label_idx = int(labels_idx[idx].detach().cpu().item()) if labels_idx is not None and len(labels_idx) else 0\n        label = labels[min(label_idx, len(labels) - 1)]\n        if text_labels and len(text_labels) > idx:\n            label = str(text_labels[idx])\n        return {\n            \"box\": box,\n            \"score\": float(scores[idx].detach().cpu().item()),\n            \"label\": label,\n            \"model\": backend[\"model_id\"],\n        }\n    except HTTPException:\n        raise\n    except Exception as exc:\n        logger.exception(\"ground_text_to_box failed\")\n        raise HTTPException(500, f\"Object mask failed: {exc}\") from exc\n\n\ndef _current_user_is_admin(request: Request, user: str | None) -> bool:\n    if not user:\n        return False\n    auth_mgr = getattr(request.app.state, \"auth_manager\", None)\n    is_admin = getattr(auth_mgr, \"is_admin\", None)\n    if not callable(is_admin):\n        return False\n    try:\n        return bool(is_admin(user))\n    except Exception:\n        return False\n\n\ndef _sanitize_gallery_filename(filename: str) -> str:\n    \"\"\"Return a local filename safe to join under generated_images.\"\"\"\n    safe_name = re.sub(r\"[^A-Za-z0-9._-]\", \"_\", Path(str(filename or \"\")).name)[:128]","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/gallery/gallery_routes.py#L187-L223","documentation":"Error \"Object mask failed: {exc}\" 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":["Retry with a clearer object description or a different image.","Check server logs for the underlying mask generation error."],"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-15T22:17:37.221Z"}