{"record":{"id":"938f61d76e9399bb","repo":"hashicorp/nomad","slug":"failed-to-open-s-v","errorCode":null,"errorMessage":"failed to open %s: %v","messagePattern":"failed to open (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"client/fingerprint/bridge_linux.go","lineNumber":111,"sourceCode":"\t} else {\n\t\treturn nil\n\t}\n\n\treturn errs\n}\n\nfunc (f *BridgeFingerprint) findDir(dirname string) error {\n\tif _, err := os.Stat(dirname); err != nil {\n\t\treturn fmt.Errorf(\"failed to find %s: %v\", dirname, err)\n\t} else {\n\t\treturn nil\n\t}\n}\n\nfunc (f *BridgeFingerprint) searchFile(module, filename string, re *regexp.Regexp) error {\n\tfile, err := os.Open(filename)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to open %s: %v\", filename, err)\n\t}\n\tdefer func() {\n\t\t_ = file.Close()\n\t}()\n\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\tif re.MatchString(scanner.Text()) {\n\t\t\treturn nil // found the module!\n\t\t}\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\treturn fmt.Errorf(\"failed to scan %s: %v\", filename, err)\n\t}\n\n\treturn fmt.Errorf(\"module %s not in %s\", module, filename)\n}\n","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/fingerprint/bridge_linux.go#L93-L129","documentation":"searchFile opens a kernel metadata file (e.g. /proc/modules, /lib/modules/<ver>/modules.builtin or modules.dep) and scans it for the bridge module. This error means os.Open failed on that file. Combined with other detect() failures it just disables the bridge fingerprint; it never fails the client. It indicates the kernel metadata file itself is unreadable or absent.","triggerScenarios":"detect('bridge') falls through to searchFile on /proc/modules or /lib/modules/<KernelVersion>/modules.builtin|modules.dep and os.Open returns an error - file missing (no /lib/modules for the running kernel version, stripped host image) or unreadable due to permissions/namespace restrictions.","commonSituations":"Minimal or distroless host images without /lib/modules installed; running Nomad in a container without /proc or /lib/modules mounted; kernel upgraded without matching linux-modules package so <KernelVersion> directory is absent.","solutions":["Install kernel modules metadata for the running kernel (e.g. 'apt install linux-modules-$(uname -r)' or matching package) or mount /lib/modules:ro into the container.","Load the bridge module directly ('modprobe bridge') so detect succeeds at the /sys/module or /proc/modules stage.","If in a container, bind-mount /proc and /lib/modules from the host.","If bridge mode is unused, this can be safely ignored - the node just won't advertise bridge networking."],"exampleFix":"// before (docker run without kernel modules)\ndocker run nomad ...\n// after\ndocker run -v /lib/modules:/lib/modules:ro -v /proc:/host/proc nomad ...\n// or on the host: sudo apt-get install linux-modules-$(uname -r)","handlingStrategy":"fallback","validationCode":"// host-side preflight (shell)\n// test -r /proc/modules || echo 'no /proc/modules'\n// test -d /lib/modules/$(uname -r) || echo 'install kernel modules metadata for running kernel'","typeGuard":null,"tryCatchPattern":"if err := f.searchFile(module, path, re); err != nil {\n    // treat unreadable kernel metadata as 'not detected', not fatal\n    errs = multierror.Append(errs, err)\n    // continue probing other locations (this is what detect() already does)\n}","preventionTips":["Install the kernel-modules package matching the running kernel (linux-modules-$(uname -r)).","When containerizing Nomad, bind-mount /lib/modules:ro and /proc from the host.","Re-provision module metadata after kernel upgrades."],"tags":["fingerprint","linux","kernel-module","filesystem"],"backgroundTag":"kernel-modules-directory-missing","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"}