{"record":{"id":"794f6167e21037cd","repo":"hashicorp/nomad","slug":"custom-plugin-provider-s-cannot-use-the-config-bl","errorCode":null,"errorMessage":"custom plugin provider %s cannot use the config block","messagePattern":"custom plugin provider (.+?) cannot use the config block","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/structs.go","lineNumber":10652,"sourceCode":"\tif !validSecretName.MatchString(s.Name) {\n\t\t_ = multierror.Append(&mErr, fmt.Errorf(\"secret name must match regex %s\", validSecretName))\n\t}\n\n\tif s.Provider == \"\" {\n\t\t_ = multierror.Append(&mErr, errors.New(\"secret provider cannot be empty\"))\n\t}\n\n\tif s.Path == \"\" {\n\t\t_ = multierror.Append(&mErr, errors.New(\"secret path cannot be empty\"))\n\t}\n\n\tif s.Provider == \"nomad\" || s.Provider == \"vault\" {\n\t\tif len(s.Env) > 0 {\n\t\t\t_ = multierror.Append(&mErr, fmt.Errorf(\"%s provider cannot use the env block\", s.Provider))\n\t\t}\n\t} else {\n\t\tif len(s.Config) > 0 {\n\t\t\t_ = multierror.Append(&mErr, fmt.Errorf(\"custom plugin provider %s cannot use the config block\", s.Provider))\n\t\t}\n\t}\n\n\treturn mErr.ErrorOrNil()\n}\n\nfunc (s *Secret) Canonicalize() {\n\tif s == nil {\n\t\treturn\n\t}\n\n\tif len(s.Config) == 0 {\n\t\ts.Config = nil\n\t}\n}\n\n// RescheduleTracker encapsulates previous reschedule events\ntype RescheduleTracker struct {","sourceCodeStart":10634,"sourceCodeEnd":10670,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/structs.go#L10634-L10670","documentation":"Secret block validation error: a custom plugin provider is configured with a config block. The config map is only meaningful for the built-in nomad/vault providers; plugin secrets take no inline config.","triggerScenarios":"Thrown at nomad/structs/structs.go:10652 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the config block from the secret stanza","Move provider-specific settings into the plugin's own configuration"],"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"}