{"record":{"id":"13130f0fe9653f87","repo":"odysseus-dev/odysseus","slug":"no-image-generation-endpoint-configured-serve-a-d","errorCode":null,"errorMessage":"No image generation endpoint configured. Serve a diffusion model via Cookbook first.","messagePattern":"No image generation endpoint configured\\. Serve a diffusion model via Cookbook first\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"routes/gallery/gallery_routes.py","lineNumber":1285,"sourceCode":"        requested_base = (body.pop(\"_endpoint\", \"\") or \"\").rstrip(\"/\")\n        # SSRF hardening: validate a client-supplied endpoint before any\n        # outbound request (mirrors routes/embedding_routes.py).\n        if requested_base:\n            from src.url_safety import check_outbound_url\n            ok, reason = check_outbound_url(\n                requested_base,\n                block_private=os.getenv(\"IMAGE_BLOCK_PRIVATE_IPS\", \"false\").lower() == \"true\",\n            )\n            if not ok:\n                raise HTTPException(400, f\"Rejected endpoint URL: {reason}\")\n        chosen_model = (body.pop(\"_model\", \"\") or \"\").strip()\n        api_key = None\n        if not requested_base:\n            db = SessionLocal()\n            try:\n                ep = _first_visible_image_endpoint(db, user)\n                if not ep:\n                    raise HTTPException(400, \"No image generation endpoint configured. Serve a diffusion model via Cookbook first.\")\n                base = ep.base_url.rstrip(\"/\")\n                api_key = ep.api_key\n            finally:\n                db.close()\n        else:\n            # Resolve the client-supplied base to a registered visible endpoint.\n            # Admins are not exempted — gallery proxy routes must use a DB row\n            # so the outbound URL never depends directly on request-body input.\n            db = SessionLocal()\n            try:\n                ep = _visible_image_endpoint_for_base(db, requested_base, user)\n                if not ep:\n                    raise HTTPException(403, \"Choose a registered image endpoint\")\n                base = ep.base_url.rstrip(\"/\")\n                api_key = ep.api_key\n            finally:\n                db.close()\n","sourceCodeStart":1267,"sourceCodeEnd":1303,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/gallery/gallery_routes.py#L1267-L1303","documentation":"Error \"No image generation endpoint configured. Serve a diffusion model via Cookbook first.\" 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":["Serve a diffusion model via Cookbook, then select it as the image endpoint.","Register an image generation endpoint in Settings → Add Models."],"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"}