{"record":{"id":"b7265380c3a58be6","repo":"BerriAI/litellm","slug":"failed-to-append-message","errorCode":null,"errorMessage":"Failed to append message","messagePattern":"Failed to append message","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/management_endpoints/workflow_management_endpoints.py","lineNumber":500,"sourceCode":"            return msg\n\n        except Exception as e:\n            if UniqueViolationError is not None and isinstance(e, UniqueViolationError):\n                if attempt == _MAX_SEQUENCE_RETRIES - 1:\n                    verbose_proxy_logger.exception(\n                        \"Sequence number collision after %d retries for run %s\",\n                        _MAX_SEQUENCE_RETRIES,\n                        run_id,\n                    )\n                    raise HTTPException(\n                        status_code=409,\n                        detail=\"Concurrent write conflict — please retry\",\n                    )\n                continue\n            verbose_proxy_logger.exception(\"Error appending workflow message: %s\", e)\n            raise HTTPException(status_code=500, detail=str(e))\n\n    raise HTTPException(status_code=500, detail=\"Failed to append message\")  # pragma: no cover\n\n\n@router.get(\n    \"/v1/workflows/runs/{run_id}/messages\",\n    tags=[\"workflow management\"],\n    dependencies=[Depends(user_api_key_auth)],\n)\nasync def list_workflow_messages(\n    run_id: str,\n    limit: int = Query(100, ge=1, le=500),\n    user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),\n):\n    \"\"\"Fetch conversation history for a run, ordered by sequence_number. Default limit 100, max 500.\"\"\"\n    from litellm.proxy.proxy_server import prisma_client\n\n    if prisma_client is None:\n        raise HTTPException(status_code=500, detail=CommonProxyErrors.db_not_connected_error.value)\n","sourceCodeStart":482,"sourceCodeEnd":518,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/workflow_management_endpoints.py#L482-L518","documentation":"HTTPException raised when appending a workflow message fails for a reason other than the retryable sequence collision — the caught database exception is reported with this generic detail. It indicates the message insert could not be completed for the given run.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/workflow_management_endpoints.py:500 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check proxy logs for the storage failure, then retry appending the message."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}