{"record":{"id":"1801bd66527be4fe","repo":"hashicorp/nomad","slug":"service-registration-provider-nomad-not-enabled","errorCode":null,"errorMessage":"service registration provider \"nomad\" not enabled","messagePattern":"service registration provider \"nomad\" not enabled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/serviceregistration/nsd/nsd.go","lineNumber":121,"sourceCode":"\t\ts.backoffInitial = 100 * time.Millisecond\n\t}\n\tif s.backoffMax == 0 {\n\t\ts.backoffMax = time.Second\n\t}\n\treturn s\n}\n\n// SetNodeIdentityToken fulfills the NodeIdentityHandler interface, allowing\n// the client to update the node identity token used for RPC calls when it is\n// renewed.\nfunc (s *ServiceRegistrationHandler) SetNodeIdentityToken(token string) { s.nodeAuthToken.Store(token) }\n\nfunc (s *ServiceRegistrationHandler) RegisterWorkload(workload *serviceregistration.WorkloadServices) error {\n\t// Check whether we are enabled or not first. Hitting this likely means\n\t// there is a bug within the implicit constraint, or process using it, as\n\t// that should guard ever placing an allocation on this client.\n\tif !s.registrationEnabled {\n\t\treturn errors.New(`service registration provider \"nomad\" not enabled`)\n\t}\n\n\t// Collect all errors generating service registrations.\n\tvar mErr multierror.Error\n\n\tregistrations := make([]*structs.ServiceRegistration, len(workload.Services))\n\n\t// Iterate over the services and generate a hydrated registration object for\n\t// each. All services are part of a single allocation, therefore we cannot\n\t// have one failure without all becoming a failure.\n\tfor i, serviceSpec := range workload.Services {\n\t\tserviceRegistration, err := s.generateNomadServiceRegistration(serviceSpec, workload)\n\t\tif err != nil {\n\t\t\tmErr.Errors = append(mErr.Errors, err)\n\t\t} else if mErr.ErrorOrNil() == nil {\n\t\t\tregistrations[i] = serviceRegistration\n\t\t}\n\t}","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/serviceregistration/nsd/nsd.go#L103-L139","documentation":"The Nomad-native service registration handler returns this error when RegisterWorkload is invoked while the handler's registrationEnabled flag is false. The comment notes that hitting it likely indicates a bug in the implicit constraint or the process using it, since that constraint should prevent allocations landing on clients without the provider enabled.","triggerScenarios":"Calling ServiceRegistrationHandler.RegisterWorkload on a client where the nomad service registration provider is disabled (client config service_registration{ enabled = false } or default off).","commonSituations":"Misconfigured client config that disables the nomad provider while jobs still request native service discovery; a bug where the implicit placement constraint failed to exclude the client.","solutions":["Enable the nomad service registration provider in the client config (service_registration { enabled = true })","Check that the implicit constraint is correctly excluding clients with the provider disabled","Remove/adjust job service blocks if native service discovery is not intended on this cluster","Upgrade Nomad if a known bug in the constraint is the cause"],"exampleFix":"// before (client.hcl)\nservice_registration { enabled = false }\n// after\nservice_registration { enabled = true }","handlingStrategy":"validation","validationCode":"// before placing workloads using native service discovery\nif !clientConfig.ServiceRegistration.Enabled {\n    return errors.New(\"nomad service registration provider disabled on client\")\n}","typeGuard":null,"tryCatchPattern":"if err := handler.RegisterWorkload(workload); err != nil && strings.Contains(err.Error(), `provider \"nomad\" not enabled`) {\n    log.Error(\"client service registration disabled; check client config/implicit constraint\")\n    return err\n}","preventionTips":["Enable service_registration { enabled = true } on clients using native discovery","Rely on the implicit placement constraint to exclude disabled clients","Audit client configs before rolling out jobs with service blocks","Report/upgrade if the constraint incorrectly places allocs on disabled clients"],"tags":["go","service-discovery","client-config"],"backgroundTag":"service-registration-disabled","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"}