{"record":{"id":"b0f0d726c9e258cf","repo":"hashicorp/nomad","slug":"invalid-vault-configuration-v","errorCode":null,"errorMessage":"invalid vault configuration: %v","messagePattern":"invalid vault configuration: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/structs.go","lineNumber":5681,"sourceCode":"\t\terr := fmt.Errorf(\"description longer than %d\", maxNamespaceDescriptionLength)\n\t\tmErr.Errors = append(mErr.Errors, err)\n\t}\n\n\terr := n.NodePoolConfiguration.Validate()\n\tswitch e := err.(type) {\n\tcase *multierror.Error:\n\t\tfor _, npErr := range e.Errors {\n\t\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"invalid node pool configuration: %v\", npErr))\n\t\t}\n\tcase error:\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"invalid node pool configuration: %v\", e))\n\t}\n\n\terr = n.VaultConfiguration.Validate()\n\tswitch e := err.(type) {\n\tcase *multierror.Error:\n\t\tfor _, vErr := range e.Errors {\n\t\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"invalid vault configuration: %v\", vErr))\n\t\t}\n\tcase error:\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"invalid vault configuration: %v\", e))\n\t}\n\n\terr = n.ConsulConfiguration.Validate()\n\tswitch e := err.(type) {\n\tcase *multierror.Error:\n\t\tfor _, cErr := range e.Errors {\n\t\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"invalid consul configuration: %v\", cErr))\n\t\t}\n\tcase error:\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"invalid consul configuration: %v\", e))\n\t}\n\n\treturn mErr.ErrorOrNil()\n}\n","sourceCodeStart":5663,"sourceCodeEnd":5699,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/structs.go#L5663-L5699","documentation":"Wrapper error from Namespace.Validate() for the multierror branch: when VaultConfiguration.Validate() returns a *multierror.Error, each sub-error is re-wrapped as 'invalid vault configuration: %v' and added to the namespace's validation result.","triggerScenarios":"Namespace create/update where the namespace's Vault configuration block (default cluster/namespace or Vault task config defaults) fails validation, e.g. invalid cluster name format.","commonSituations":"Setting namespace.VaultConfiguration with an invalid DefaultCluster or empty required fields; Nomad Enterprise namespace-scoped Vault config mistakes; integrating Vault with Nomad for the first time.","solutions":["Read the inner message after the prefix for the actual failing field","Fix the VaultConfiguration field (e.g. valid DefaultCluster name, matching regex)","Validate the Vault configuration independently before submitting the namespace","Verify Nomad/Vault integration docs for the version in use"],"exampleFix":"// before\nns.VaultConfiguration = &structs.VaultConfiguration{DefaultCluster: \"vault/primary\"} // invalid chars\n// after\nns.VaultConfiguration = &structs.VaultConfiguration{DefaultCluster: \"vault-primary\"}","handlingStrategy":"validation","validationCode":"if err := ns.VaultConfiguration.Validate(); err != nil {\n    return fmt.Errorf(\"namespace vault config invalid: %w\", err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify Vault cluster names against the allowed regex before submission","Test Vault/Nomad integration config in dev before prod","Check Nomad version docs for supported VaultConfiguration fields","Render configs from templates with strict field allowlists"],"tags":["nomad","validation","vault"],"backgroundTag":"nested-config-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"}