{"record":{"id":"3830436ba8498e19","repo":"odysseus-dev/odysseus","slug":"integration-not-found","errorCode":null,"errorMessage":"Integration not found","messagePattern":"Integration not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"routes/auth_routes.py","lineNumber":770,"sourceCode":"    async def create_integration(request: Request):\n        \"\"\"Create a new integration (admin only).\"\"\"\n        user = _get_current_user(request)\n        if not user or not auth_manager.is_admin(user):\n            raise HTTPException(403, \"Admin only\")\n        body = await request.json()\n        item = add_integration(body)\n        return {\"ok\": True, \"integration\": mask_integration_secret(item)}\n\n    @router.put(\"/integrations/{integration_id}\")\n    async def update_integration_route(integration_id: str, request: Request):\n        \"\"\"Update an existing integration (admin only).\"\"\"\n        user = _get_current_user(request)\n        if not user or not auth_manager.is_admin(user):\n            raise HTTPException(403, \"Admin only\")\n        body = await request.json()\n        item = update_integration(integration_id, body)\n        if not item:\n            raise HTTPException(404, \"Integration not found\")\n        return {\"ok\": True, \"integration\": mask_integration_secret(item)}\n\n    @router.delete(\"/integrations/{integration_id}\")\n    async def delete_integration_route(integration_id: str, request: Request):\n        \"\"\"Delete an integration (admin only).\"\"\"\n        user = _get_current_user(request)\n        if not user or not auth_manager.is_admin(user):\n            raise HTTPException(403, \"Admin only\")\n        ok = delete_integration(integration_id)\n        if not ok:\n            raise HTTPException(404, \"Integration not found\")\n        return {\"ok\": True}\n\n    @router.post(\"/integrations/{integration_id}/test\")\n    async def test_integration_route(integration_id: str, request: Request):\n        \"\"\"Test connectivity to an integration (admin only).\"\"\"\n        user = _get_current_user(request)\n        if not user or not auth_manager.is_admin(user):","sourceCodeStart":752,"sourceCodeEnd":788,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/auth_routes.py#L752-L788","documentation":"HTTP 404 raised by PUT /integrations/{integration_id} when update_integration(integration_id, body) returns falsy — the store has no integration with that id. Ids are assigned at creation (add_integration) and persisted via load/save of the integrations store.","triggerScenarios":"PUT /integrations/{id} after the integration was deleted in another tab/session; stale id in the UI after a settings file reset; typo or truncated id in the path parameter.","commonSituations":"Two admins editing concurrently — one deletes while the other saves; the integrations store file recreated from scratch (migration or manual edit); client cached an old id list.","solutions":["Re-fetch GET /integrations and use a current id.","If the integration was deleted, re-create it via POST instead of PUT.","Treat 404 on update as a signal to refresh the admin panel state."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"async function integrationExists(id) {\n  const {integrations} = await (await fetch('/integrations')).json();\n  return integrations.some(i => i.id === id);\n}","typeGuard":null,"tryCatchPattern":"try { await updateIntegration(id, body); }\ncatch (e) {\n  if (e.status === 404) { await refreshList(); /* offer re-create */ }\n  else throw e;\n}","preventionTips":["Keep the integrations list as the single source of ids in UI state.","After any delete elsewhere, invalidate cached ids.","On 404, re-fetch and diff instead of blindly retrying."],"tags":["not-found","http-404","integrations","crud","fastapi"],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}