{"record":{"id":"f2ff62cede614dd7","repo":"hashicorp/nomad","slug":"w-w","errorCode":null,"errorMessage":"%w: %w","messagePattern":"%w: %w","errorType":"exception","errorClass":"errEnvProbeQueryFailed","httpStatus":null,"severity":"error","filePath":"client/fingerprint/fingerprint_retry.go","lineNumber":122,"sourceCode":"\t}\n\n\tif shouldSkipEnvFingerprinter(cfg, err) {\n\t\trw.logger.Debug(\"error performing initial probe, skipping\")\n\t\treturn nil\n\t}\n\n\trw.logger.Error(\"fingerprinting failed after all attempts\", \"error\", err)\n\treturn err\n}\n\n// errEnvProbeQueryFailed is used to indicate that the initial probe to\n// determine if the environment fingerprinter is applicable has failed.\nvar errEnvProbeQueryFailed = errors.New(\"fingerprint initial probe failed\")\n\n// wrapProbeError wraps the passed error with errEnvProbeQueryFailed to indicate\n// that the initial probe has failed.\nfunc wrapProbeError(err error) error {\n\treturn fmt.Errorf(\"%w: %w\", errEnvProbeQueryFailed, err)\n}\n\n// shouldSkipEnvFingerprinter determines if an environment fingerprinter should\n// be skipped based on the passed configuration and error from the\n// fingerprinter. Skipped indicates the client is not running in the environment\n// the fingerprinter is designed for.\nfunc shouldSkipEnvFingerprinter(cfg *config.Fingerprint, err error) bool {\n\n\tif err == nil {\n\t\treturn false\n\t}\n\n\tif cfg != nil && cfg.ExitOnFailure != nil {\n\t\treturn !*cfg.ExitOnFailure\n\t}\n\n\treturn errors.Is(err, errEnvProbeQueryFailed)\n}","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/fingerprint/fingerprint_retry.go#L104-L140","documentation":"wrapProbeError wraps any error from the initial environment probe with errEnvProbeQueryFailed using Go's multi-%w wrapping. It lets callers detect a probe failure via errors.Is(err, errEnvProbeQueryFailed) while still inspecting the underlying cause. It is thrown by the fingerprint retry wrapper when the initial fingerprint probe (e.g. checking if an environment fingerprinter applies) fails.","triggerScenarios":"Calling Fingerprint on a fingerprinter wrapped with the retry wrapper when the initial environment probe query returns an error (e.g. an external command or API the environment fingerprinter depends on fails).","commonSituations":"Running Nomad on a host where an environment-specific probe (cloud metadata, hypervisor detection) fails; network or command errors during client startup fingerprinting; unit tests exercising the retry wrapper with failing probe errors.","solutions":["Inspect the wrapped cause with errors.Is/As to find the underlying probe failure and fix that (network, missing command, permissions).","If the environment genuinely does not match the fingerprinter, configure it to be skipped so the probe is not run.","Check the error is transient and rely on the retry wrapper to re-attempt the probe.","Update client fingerprint configuration (fingerprint whitelist/blacklist) to disable the problematic fingerprinter."],"exampleFix":"// before\nerr := fp.Fingerprint(req)\nlog.Fatal(err)\n// after\nif err := fp.Fingerprint(req); err != nil {\n  if errors.Is(err, errEnvProbeQueryFailed) {\n    log.Printf(\"env probe failed, skipping fingerprinter: %v\", err)\n    return\n  }\n  log.Fatal(err)\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func IsEnvProbeFailed(err error) bool {\n\treturn errors.Is(err, errEnvProbeQueryFailed)\n}","tryCatchPattern":"if err := fp.Fingerprint(req); err != nil {\n\tif errors.Is(err, errEnvProbeQueryFailed) {\n\t\tlog.Printf(\"env probe failed, skipping: %v\", err)\n\t} else {\n\t\treturn err\n\t}\n}","preventionTips":["Use errors.Is against errEnvProbeQueryFailed rather than string matching the message.","Check the wrapped cause with errors.As to fix the real underlying failure.","Configure fingerprinters that do not apply to the host to be skipped.","Rely on the retry wrapper only for transient probe errors."],"tags":["fingerprinting","go","error-wrapping"],"backgroundTag":"error-wrapping-probe-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"}