{"record":{"id":"3e08cba97432487b","repo":"hashicorp/nomad","slug":"q-is-invalid-metadata-keys-must-be-valid-dotted","errorCode":null,"errorMessage":"%q is invalid; metadata keys must be valid dotted hcl identifiers","messagePattern":"%q is invalid; metadata keys must be valid dotted hcl identifiers","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/node.go","lineNumber":508,"sourceCode":"\t// from Node.Meta as nil values are used to unset Node.Meta keys.\n\tMeta map[string]*string\n}\n\nfunc (n *NodeMetaApplyRequest) Validate() error {\n\tif len(n.Meta) == 0 {\n\t\treturn fmt.Errorf(\"missing required Meta object\")\n\t}\n\tfor k := range n.Meta {\n\t\tif k == \"\" {\n\t\t\treturn fmt.Errorf(\"metadata keys must not be empty\")\n\t\t}\n\n\t\t// Validate keys are dotted identifiers since their primary use case is in\n\t\t// constraints as interpolated hcl variables.\n\t\t// https://github.com/hashicorp/hcl/blob/v2.16.0/hclsyntax/spec.md#identifiers\n\t\tfor part := range strings.SplitSeq(k, \".\") {\n\t\t\tif !hclsyntax.ValidIdentifier(part) {\n\t\t\t\treturn fmt.Errorf(\"%q is invalid; metadata keys must be valid dotted hcl identifiers\", k)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// NodeMetaResponse is used to read Node metadata directly from Client agents.\ntype NodeMetaResponse struct {\n\t// Meta is the merged static + dynamic Node metadata\n\tMeta map[string]string\n\n\t// Dynamic is the dynamic Node metadata (set via API)\n\tDynamic map[string]*string\n\n\t// Static is the static Node metadata (set via agent configuration)\n\tStatic map[string]string\n}","sourceCodeStart":490,"sourceCodeEnd":526,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/node.go#L490-L526","documentation":"NodeMetaApplyRequest.Validate found a metadata key that is not a valid dotted HCL identifier (each dot-separated part must match hclsyntax identifier rules); keys are interpolated as HCL variables in constraints.","triggerScenarios":"Thrown at nomad/structs/node.go:508 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use only letters, digits, hyphens, underscores and dots in metadata keys","Remove invalid characters or leading/trailing dots from the key"],"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"}