{"record":{"id":"31093ed635e7ad96","repo":"hashicorp/nomad","slug":"invalid-name-q-must-match-regex-s-31093e","errorCode":null,"errorMessage":"invalid name %q, must match regex %s","messagePattern":"invalid name %q, must match regex (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/node_pool.go","lineNumber":47,"sourceCode":"\t// maxNodePoolDescriptionLength is the maximum length allowed for a node\n\t// pool description.\n\tmaxNodePoolDescriptionLength = 256\n\n\t// DefaultNodePoolNodeIdentityTTL is the default TTL for node identities\n\t// when the operator does not specify this as part of the node pool\n\t// specification.\n\tDefaultNodePoolNodeIdentityTTL = 24 * time.Hour\n)\n\nvar (\n\t// validNodePoolName is the rule used to validate a node pool name.\n\tvalidNodePoolName = regexp.MustCompile(\"^[a-zA-Z0-9-_]{1,128}$\")\n)\n\n// ValidateNodePoolName returns an error if a node pool name is invalid.\nfunc ValidateNodePoolName(pool string) error {\n\tif !validNodePoolName.MatchString(pool) {\n\t\treturn fmt.Errorf(\"invalid name %q, must match regex %s\", pool, validNodePoolName)\n\t}\n\treturn nil\n}\n\n// NodePool allows partitioning infrastructure\ntype NodePool struct {\n\t// Name is the node pool name. It must be unique.\n\tName string\n\n\t// Description is the human-friendly description of the node pool.\n\tDescription string\n\n\t// Meta is a set of user-provided metadata for the node pool.\n\tMeta map[string]string\n\n\t// SchedulerConfiguration is the scheduler configuration specific to the\n\t// node pool.\n\tSchedulerConfiguration *NodePoolSchedulerConfiguration","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/node_pool.go#L29-L65","documentation":"ValidateNodePoolName rejected the name because it does not match ^[a-zA-Z0-9-_]{1,128}$; node pool names are restricted to letters, digits, hyphens and underscores with length 1-128.","triggerScenarios":"Thrown at nomad/structs/node_pool.go:47 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the pool using only [a-zA-Z0-9-_]","Shorten the name to at most 128 characters"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}