{"record":{"id":"2603f7d46cee11dc","repo":"hashicorp/nomad","slug":"fuzzy-search-is-not-enabled","errorCode":null,"errorMessage":"fuzzy search is not enabled","messagePattern":"fuzzy search is not enabled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/search_endpoint.go","lineNumber":752,"sourceCode":"\t\treturn structs.ErrPermissionDenied\n\t}\n\tdefer metrics.MeasureSince([]string{\"nomad\", \"search\", \"fuzzy_search\"}, time.Now())\n\n\taclObj, err := s.srv.ResolveACL(args)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tnamespace := args.RequestNamespace()\n\tcontext := args.Context\n\n\tif !sufficientFuzzySearchPerms(aclObj, namespace, context) {\n\t\treturn structs.ErrPermissionDenied\n\t}\n\n\t// check that fuzzy search API is enabled\n\tif !s.srv.config.SearchConfig.FuzzyEnabled {\n\t\treturn fmt.Errorf(\"fuzzy search is not enabled\")\n\t}\n\n\t// check the query term meets minimum length\n\tmin := s.srv.config.SearchConfig.MinTermLength\n\tif n := len(args.Text); n < min {\n\t\treturn fmt.Errorf(\"fuzzy search query must be at least %d characters, got %d\", min, n)\n\t}\n\n\t// for case-insensitive searching, lower-case the search term once and reuse\n\ttext := strings.ToLower(args.Text)\n\n\t// accumulate fuzzy search results and any truncations\n\treply.Matches = make(map[structs.Context][]structs.FuzzyMatch)\n\treply.Truncations = make(map[structs.Context]bool)\n\n\t// Setup the blocking query\n\topts := blockingOptions{\n\t\tqueryMeta: &reply.QueryMeta,","sourceCodeStart":734,"sourceCodeEnd":770,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/search_endpoint.go#L734-L770","documentation":"Nomad's fuzzy search API (FuzzySearch RPC) is an opt-in feature controlled by the server config SearchConfig.FuzzyEnabled. The server rejects fuzzy search RPCs with this error when the feature flag is off, even if permissions are valid. It protects servers from the extra resource cost of fuzzy matching until an operator explicitly enables it.","triggerScenarios":"Calling the Search.FuzzySearch RPC (e.g. via `nomad search -fuzzy` or the API POST /v1/search/fuzzy) on a server whose config.SearchConfig.FuzzyEnabled is false (the default).","commonSituations":"Operators upgrading Nomad and trying the fuzzy search endpoint without adding search { fuzzy_enabled = true } to the server config; CI/tools assuming fuzzy search is on by default; enterprise/oss clusters where the flag was never set in the server hcl.","solutions":["Set `search { fuzzy_enabled = true }` in the Nomad server configuration block and restart/roll the servers","Fall back to the non-fuzzy Search RPC (context + prefix matching) which is always enabled","If the flag cannot be changed, filter results client-side from prefix search results instead"],"exampleFix":"// before (server config)\nserver { enabled = true }\n// after\nserver {\n  enabled = true\n  search {\n    fuzzy_enabled = true\n    min_term_length = 2\n  }\n}","handlingStrategy":"validation","validationCode":"// Before issuing a fuzzy search, check the server advertises the feature\n// or probe once and cache the capability:\nresp, err := client.Search().FuzzySearch(ctx, &api.SearchRequest{Text: \"probe-prefix\", Context: \"jobs\"})\nif err != nil && strings.Contains(err.Error(), \"fuzzy search is not enabled\") {\n    fuzzyEnabled = false // fall back to prefix search\n}","typeGuard":null,"tryCatchPattern":"resp, err := client.Search().FuzzySearch(ctx, req)\nif err != nil {\n    if strings.Contains(err.Error(), \"fuzzy search is not enabled\") {\n        resp, err = client.Search().Get(ctx, req) // prefix-search fallback\n    }\n    if err != nil { return err }\n}","preventionTips":["Enable search { fuzzy_enabled = true } in server config before rolling out fuzzy-dependent tooling","Feature-detect once at client startup and cache the result","Keep a prefix-search fallback path in any search UI"],"tags":["nomad","go","configuration","feature-flag"],"backgroundTag":"feature-disabled-by-config","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"}