{"record":{"id":"8198adbbd8fdcc22","repo":"hashicorp/nomad","slug":"ui-description-must-be-under-1000-characters-curr","errorCode":null,"errorMessage":"UI description must be under 1000 characters, currently %d","messagePattern":"UI description must be under 1000 characters, currently (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/structs.go","lineNumber":4814,"sourceCode":"\t}\n\n\tif j.Type == JobTypeSystem {\n\t\tif j.Spreads != nil {\n\t\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"System jobs may not have a spread block\"))\n\t\t}\n\t} else {\n\t\tfor idx, spread := range j.Spreads {\n\t\t\tif err := spread.Validate(); err != nil {\n\t\t\t\touter := fmt.Errorf(\"Spread %d validation failed: %s\", idx+1, err)\n\t\t\t\tmErr.Errors = append(mErr.Errors, outer)\n\t\t\t}\n\t\t}\n\t}\n\n\tconst MaxDescriptionCharacters = 1000\n\tif j.UI != nil {\n\t\tif len(j.UI.Description) > MaxDescriptionCharacters {\n\t\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"UI description must be under 1000 characters, currently %d\", len(j.UI.Description)))\n\t\t}\n\t}\n\n\tif j.VersionTag != nil {\n\t\tif len(j.VersionTag.Description) > MaxDescriptionCharacters {\n\t\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"Tagged version description must be under 1000 characters, currently %d\", len(j.VersionTag.Description)))\n\t\t}\n\t}\n\n\t// Check for duplicate task groups\n\ttaskGroups := make(map[string]int)\n\tfor idx, tg := range j.TaskGroups {\n\t\tif tg.Name == \"\" {\n\t\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"Job task group %d missing name\", idx+1))\n\t\t} else if existing, ok := taskGroups[tg.Name]; ok {\n\t\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"Job task group %d redefines '%s' from group %d\", idx+1, tg.Name, existing+1))\n\t\t} else {\n\t\t\ttaskGroups[tg.Name] = idx","sourceCodeStart":4796,"sourceCodeEnd":4832,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/structs.go#L4796-L4832","documentation":"Job.Validate: the UI block's description exceeds the 1000-character limit (MaxDescriptionCharacters). The current length is included so the overflow can be trimmed precisely.","triggerScenarios":"Submitting a job whose ui block's description string is longer than 1000 characters.","commonSituations":"Machine-generated job specs that paste long release notes or URLs into ui.description, template pipelines embedding commit messages or changelogs into the description.","solutions":["Shorten j.UI.Description to under 1000 characters","Move long notes to an external doc and keep a brief summary in description","Trim the value programmatically before submit (e.g. truncate to 999 chars)","Run 'nomad job validate' to catch the length violation pre-submit"],"exampleFix":"// before\nui {\n  description = \"<1200-char release note text>\"\n}\n// after\nui {\n  description = \"Release 1.4.0; see changelog link in repo docs.\"\n}","handlingStrategy":"validation","validationCode":"const maxDesc = 1000\nif job.UI != nil && len(job.UI.Description) > maxDesc {\n    return fmt.Errorf(\"ui.description is %d chars; max %d\", len(job.UI.Description), maxDesc)\n}\nreturn nil","typeGuard":null,"tryCatchPattern":"if err := job.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"UI description\") {\n        return ErrDescriptionTooLong\n    }\n    return err\n}","preventionTips":["Truncate generated descriptions to <= 999 characters in templating","Keep long notes in external docs, link them instead","Check description length in CI when job specs are generated"],"tags":["nomad","job-validation","ui","description-length"],"backgroundTag":"nomad-job-validation-failed","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}