{"record":{"id":"2d47ffec46a2591f","repo":"odysseus-dev/odysseus","slug":"vision-analysis-failed-e","errorCode":null,"errorMessage":"Vision analysis failed: {e}","messagePattern":"Vision analysis failed: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"routes/upload_routes.py","lineNumber":487,"sourceCode":"        import mimetypes as _mt\n        mime = (info or {}).get(\"mime\") or _mt.guess_type(path)[0] or \"\"\n        if not mime.startswith(\"image/\"):\n            raise HTTPException(400, \"Not an image\")\n        cache_path = _vision_cache_path(file_id)\n        if not force and os.path.exists(cache_path):\n            try:\n                with open(cache_path, encoding=\"utf-8\") as f:\n                    cached_text = f.read()\n                _sync_gallery_caption_for_upload(info, file_owner or current_user, cached_text)\n                return {\"text\": cached_text, \"cached\": True}\n            except Exception as e:\n                logger.warning(f\"Vision cache read failed for {file_id}: {e}\")\n        from src.document_processor import analyze_image_with_vl\n        try:\n            text = analyze_image_with_vl(path, owner=current_user) or \"\"\n        except Exception as e:\n            logger.error(f\"Vision analysis failed for {file_id}: {e}\")\n            raise HTTPException(500, f\"Vision analysis failed: {e}\")\n        try:\n            with open(cache_path, \"w\", encoding=\"utf-8\") as f:\n                f.write(text)\n        except Exception as e:\n            logger.warning(f\"Vision cache write failed for {file_id}: {e}\")\n        _sync_gallery_caption_for_upload(info, file_owner or current_user, text)\n        return {\"text\": text, \"cached\": False}\n\n    @router.put(\"/{file_id}/vision\")\n    async def put_vision_text(request: Request, file_id: str):\n        \"\"\"Persist a user-edited vision/OCR text for an attachment. Stored in\n        the same cache file so the chat send picks it up as the override.\"\"\"\n        if not upload_handler.validate_upload_id(file_id):\n            raise HTTPException(400, \"Invalid file ID\")\n        info = _load_upload_info(file_id)\n        if not info:\n            raise HTTPException(404, \"File not found\")\n        auth_mgr = getattr(request.app.state, \"auth_manager\", None)","sourceCodeStart":469,"sourceCodeEnd":505,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/upload_routes.py#L469-L505","documentation":"Error \"Vision analysis failed: {e}\" 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":["Verify a vision-capable model endpoint is configured and reachable.","Check server logs for the vision analysis error and retry."],"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"}