{"record":{"id":"80bfe90fc61c9921","repo":"BerriAI/litellm","slug":"message-must-be-non-empty-when-the-banner-is-enabl","errorCode":null,"errorMessage":"message must be non-empty when the banner is enabled","messagePattern":"message must be non-empty when the banner is enabled","errorType":"validation","errorClass":"ValueError","httpStatus":422,"severity":"error","filePath":"litellm/proxy/ui_crud_endpoints/user_banner_endpoints.py","lineNumber":38,"sourceCode":"class UserBannerUpdate(BaseModel):\n    enabled: bool = Field(\n        default=False,\n        description=\"If true, the banner is shown to all authenticated dashboard users.\",\n    )\n    message: str = Field(\n        default=\"\",\n        max_length=USER_BANNER_MAX_MESSAGE_LENGTH,\n        description=\"Banner text shown to dashboard users. Markdown is supported.\",\n    )\n    severity: UserBannerSeverity = Field(\n        default=\"info\",\n        description=\"Visual style of the banner.\",\n    )\n\n    @model_validator(mode=\"after\")\n    def _require_message_when_enabled(self) -> \"UserBannerUpdate\":\n        if self.enabled and not self.message.strip():\n            raise ValueError(\"message must be non-empty when the banner is enabled\")\n        return self\n\n\nclass UserBanner(UserBannerUpdate):\n    revision: str = Field(\n        default=\"\",\n        description=(\n            \"Server-stamped opaque publish identity; a fresh value is generated on every \"\n            \"update so clients re-surface dismissed banners on republish.\"\n        ),\n    )\n\n\nclass UpdateUserBannerResponse(BaseModel):\n    message: str\n    banner: UserBanner\n\n","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/ui_crud_endpoints/user_banner_endpoints.py#L20-L56","documentation":"Pydantic model_validator on UserBannerUpdate: the request sets enabled=true but leaves message empty. A visible banner with no text is meaningless for the dashboard, so the whole payload is rejected at validation time; either supply non-empty message text or set enabled=false.","triggerScenarios":"Thrown at litellm/proxy/ui_crud_endpoints/user_banner_endpoints.py:38 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-empty message when enabling the banner, or disable the banner."],"exampleFix":null,"handlingStrategy":"validation","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"}