{"record":{"id":"a29e10c6225bfd21","repo":"hashicorp/nomad","slug":"errmultiplenamespaces","errorCode":"ErrMultipleNamespaces","errorMessage":"multiple Vault namespaces requires Nomad Enterprise","messagePattern":"multiple Vault namespaces requires Nomad Enterprise","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/job_endpoint.go","lineNumber":38,"sourceCode":"\t\"github.com/hashicorp/go-set/v3\"\n\t\"github.com/hashicorp/nomad/acl\"\n\t\"github.com/hashicorp/nomad/helper\"\n\t\"github.com/hashicorp/nomad/helper/uuid\"\n\t\"github.com/hashicorp/nomad/nomad/state\"\n\t\"github.com/hashicorp/nomad/nomad/state/paginator\"\n\t\"github.com/hashicorp/nomad/nomad/structs\"\n\t\"github.com/hashicorp/nomad/scheduler\"\n\tsstructs \"github.com/hashicorp/nomad/scheduler/structs\"\n)\n\nconst (\n\t// DispatchPayloadSizeLimit is the maximum size of the uncompressed input\n\t// data payload.\n\tDispatchPayloadSizeLimit = 16 * 1024\n)\n\n// ErrMultipleNamespaces is send when multiple namespaces are used in the OSS setup\nvar ErrMultipleNamespaces = errors.New(\"multiple Vault namespaces requires Nomad Enterprise\")\n\nvar (\n\t// allowRescheduleTransition is the transition that allows failed\n\t// allocations to be force rescheduled. We create a one off\n\t// variable to avoid creating a new object for every request.\n\tallowForceRescheduleTransition = &structs.DesiredTransition{\n\t\tForceReschedule: new(true),\n\t}\n)\n\n// Job endpoint is used for job interactions\ntype Job struct {\n\tsrv    *Server\n\tctx    *RPCContext\n\tlogger hclog.Logger\n\n\t// builtin admission controllers\n\tmutators   []jobMutator","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/job_endpoint.go#L20-L56","documentation":"ErrMultipleNamespaces is a sentinel indicating the job uses more than one Vault namespace, a Nomad Enterprise feature. In OSS builds, the job_endpoint Vault hook (validateNamespaces / job_endpoint_hook_vault_ce.go) rejects the job registration with this error, wrapping the list of offending namespaces in the message.","triggerScenarios":"Registering a job whose Vault blocks specify multiple distinct namespaces (vault.namespace in several task/template groups) on an OSS Nomad server; the CE hook calls validateNamespaces and len(requestedNamespaces) > 0 after reducing to the extra namespaces.","commonSituations":"Jobs migrated from an Enterprise cluster to OSS; multi-namespace Vault setups (one namespace per team) attempting to run on free Nomad; typo'd duplicated namespace values accidentally creating a set of >0 extra namespaces.","solutions":["Upgrade to Nomad Enterprise which supports multiple Vault namespaces","Use a single Vault namespace for all tasks in the job (set one vault.namespace)","Register separate jobs, each pinned to a single Vault namespace, if isolation is the goal","Note the RPC can break error wrapping (as the tests show) — match on the message text, not errors.Is, when scripting against OSS"],"exampleFix":"// before (OSS)\nvault { namespace = \"team-a\" }\n...\nvault { namespace = \"team-b\" }\n// after: single namespace per job (OSS)\nvault { namespace = \"team-a\" }","handlingStrategy":"validation","validationCode":"// shell: detect multi-namespace jobs before submitting to OSS\nns=$(hcl2json job.nomad | jq -r '[.. | objects | select(has(\"namespace\")) | .namespace] | unique | length')\n[ \"$ns\" -le 1 ] || { echo 'multiple Vault namespaces needs Nomad Enterprise'; exit 1; }","typeGuard":null,"tryCatchPattern":"// Go — note: RPC may break error wrapping, so match message text\nif err := client.Jobs().Register(job, nil); err != nil {\n    if strings.Contains(err.Error(), \"multiple Vault namespaces requires Nomad Enterprise\") {\n        return upgradeToEnterpriseOrSplitJob()\n    }\n    return err\n}","preventionTips":["Keep one Vault namespace per job on OSS clusters","Check Nomad edition/features before migrating jobs between clusters","Split multi-team Vault jobs into per-namespace jobs on OSS","Detect the error by message text, not errors.Is, per upstream tests"],"tags":["nomad","vault","enterprise","job-registration"],"backgroundTag":"feature-requires-enterprise","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"}