{"record":{"id":"906d0733d8021888","repo":"influxdata/influxdb","slug":"role-description-cannot-be-empty","errorCode":null,"errorMessage":"role description cannot be empty","messagePattern":"role description cannot be empty","errorType":"validation","errorClass":"NewRoleDescriptionError","httpStatus":null,"severity":"error","filePath":"influxdb3_authz/src/role/role.rs","lineNumber":136,"sourceCode":"                format_allowed_chars(ROLE_DESCRIPTION_ALLOWED_SPECIAL_CHARS),\n            ));\n        }\n\n        Ok(Self(description.to_string()))\n    }\n\n    pub fn into_inner(self) -> String {\n        self.0\n    }\n\n    pub fn new_unchecked(description: String) -> Self {\n        Self(description)\n    }\n}\n\n#[derive(Debug, Clone, Error)]\npub enum NewRoleDescriptionError {\n    #[error(\"role description cannot be empty\")]\n    Empty,\n    #[error(\"role description exceeds maximum length of {ROLE_DESCRIPTION_MAX_LENGTH} characters\")]\n    TooLong,\n    #[error(\n        \"role description contains invalid characters: only alphanumeric and [{0}] are allowed\"\n    )]\n    InvalidCharacters(String),\n}\n\nfn format_allowed_chars(chars: &[char]) -> String {\n    chars\n        .iter()\n        .map(|c| format!(\"'{c}'\"))\n        .collect::<Vec<_>>()\n        .join(\", \")\n}\n","sourceCodeStart":118,"sourceCodeEnd":153,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_authz/src/role/role.rs#L118-L153","documentation":"NewRoleDescriptionError::Empty is returned when a role description is supplied as an empty string. The library requires a non-empty description when constructing RoleDescription so every role carries meaningful human-readable context.","triggerScenarios":"Creating or updating a role with description = \"\" via the role management API or RoleDescription::try_from/new.","commonSituations":"UI forms that allow submitting a blank description field, or API clients that default description to an empty string instead of omitting or providing real text.","solutions":["Provide a non-empty description string when creating/updating the role","If the description is truly optional, supply a placeholder such as \"(no description)\" if the schema mandates a value","Validate with !description.trim().is_empty() before calling the API"],"exampleFix":"// before\nlet desc = \"\"; // rejected\n// after\nlet desc = \"Grants read access to telemetry buckets\";","handlingStrategy":"validation","validationCode":"fn valid_role_description(desc: &str) -> bool {\n    !desc.trim().is_empty()\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make description a required, non-blank field in forms and API clients","Reject whitespace-only descriptions before submission","Provide sensible default descriptions for automated role creation"],"tags":["validation","role-management","rust"],"backgroundTag":"empty-required-field","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}