{"record":{"id":"e4499bd4e0233d8e","repo":"hashicorp/nomad","slug":"notes-must-not-be-longer-than-255-characters","errorCode":null,"errorMessage":"notes must not be longer than 255 characters","messagePattern":"notes must not be longer than 255 characters","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/services.go","lineNumber":461,"sourceCode":"\t} else if sc.SuccessBeforePassing > 0 && !slices.Contains(passFailCheckTypes, sc.Type) {\n\t\treturn fmt.Errorf(\"success_before_passing not supported for check of type %q\", sc.Type)\n\t}\n\n\tif sc.FailuresBeforeCritical < 0 {\n\t\treturn fmt.Errorf(\"failures_before_critical must be non-negative\")\n\t} else if sc.FailuresBeforeCritical > 0 && !slices.Contains(passFailCheckTypes, sc.Type) {\n\t\treturn fmt.Errorf(\"failures_before_critical not supported for check of type %q\", sc.Type)\n\t}\n\n\tif sc.FailuresBeforeWarning < 0 {\n\t\treturn fmt.Errorf(\"failures_before_warning must be non-negative\")\n\t} else if sc.FailuresBeforeWarning > 0 && !slices.Contains(passFailCheckTypes, sc.Type) {\n\t\treturn fmt.Errorf(\"failures_before_warning not supported for check of type %q\", sc.Type)\n\t}\n\n\t// Arbitrary value, we could bump it if needed\n\tif len(sc.Notes) > 255 {\n\t\treturn fmt.Errorf(\"notes must not be longer than 255 characters\")\n\t}\n\n\treturn nil\n}\n\n// RequiresPort returns whether the service check requires the task has a port.\nfunc (sc *ServiceCheck) RequiresPort() bool {\n\tswitch sc.Type {\n\tcase ServiceCheckGRPC, ServiceCheckHTTP, ServiceCheckTCP:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\n// TriggersRestarts returns true if this check should be watched and trigger a restart\n// on failure.\nfunc (sc *ServiceCheck) TriggersRestarts() bool {","sourceCodeStart":443,"sourceCodeEnd":479,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/services.go#L443-L479","documentation":"Raised in ServiceCheck.Validate (via validateConsul): the check's free-form Notes field exceeded 255 characters, the maximum length Consul accepts for service check notes.","triggerScenarios":"Providing a check block whose Notes string length exceeds 255 runes and validating the service.","commonSituations":"Pasting long runbook URLs or markdown documentation into check notes; generated notes including large payloads.","solutions":["Shorten the notes to 255 characters or fewer","Move detailed documentation to an external link and reference it briefly","Use a link shortener or config-management reference instead of inline prose"],"exampleFix":"// before\ncheck {\n  notes = \"<a 400-character runbook description>\"\n}\n// after\ncheck {\n  notes = \"See runbook: https://wiki.example.com/checks/svc\"\n}","handlingStrategy":"validation","validationCode":"if len(sc.Notes) > 255 {\n    return fmt.Errorf(\"notes must be <= 255 characters (got %d)\", len(sc.Notes))\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep notes concise; link out to docs","Enforce max length in config generation tooling"],"tags":["nomad","consul","service-check","validation"],"backgroundTag":"invalid-check-configuration","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"}