{"record":{"id":"198ff678dbbdd73d","repo":"hashicorp/nomad","slug":"not-implemented","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"client/allocdir/fs_default.go","lineNumber":12,"sourceCode":"// Copyright IBM Corp. 2015, 2026\n// SPDX-License-Identifier: BUSL-1.1\n\n//go:build !linux\n\npackage allocdir\n\nimport \"os\"\n\n// mountDir bind mounts old to next using the given file mode.\nfunc mountDir(old, next string, uid, gid int, mode os.FileMode) error {\n\tpanic(\"not implemented\")\n}\n","sourceCodeStart":1,"sourceCodeEnd":14,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocdir/fs_default.go#L1-L14","documentation":"mountDir is a stub that unconditionally panics with 'not implemented'. Bind-mounting directories is only supported on Linux; on other platforms this placeholder is the entire implementation, so any call to it crashes. It exists only so the package compiles on non-Linux GOOSes.","triggerScenarios":"Any call to mountDir while the non-Linux build of the allocdir package is compiled in — i.e., invoking allocdir mount functionality (e.g., during task environment setup with mount-enabled configs) on darwin/windows/BSD builds.","commonSituations":"Running or unit-testing a Nomad-like client on macOS/Windows; CI on non-Linux runners exercising allocdir code paths; enabling mount-related task driver options on an unsupported OS.","solutions":["Run the client on Linux where the real bind-mount implementation is built","Avoid code paths that require mount support when targeting non-Linux platforms","Skip/exclude allocdir mount tests on non-Linux GOOS with a build-tag guard","Contribute or vendor a platform-specific implementation if non-Linux support is required"],"exampleFix":"// before\nmountDir(old, next, uid, gid, mode) // panics on this platform\n// after\nif runtime.GOOS != \"linux\" {\n\treturn fmt.Errorf(\"mountDir is not supported on %s\", runtime.GOOS)\n}\nmountDir(old, next, uid, gid, mode)","handlingStrategy":"validation","validationCode":"if runtime.GOOS != \"linux\" {\n\treturn fmt.Errorf(\"directory mounting requires Linux, running on %s\", runtime.GOOS)\n}\n// proceed to call allocdir mount APIs only on Linux","typeGuard":null,"tryCatchPattern":"// Go: recover around mount operations on non-Linux builds\nfunc safeMount(old, next string, uid, gid int, mode os.FileMode) (err error) {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\terr = fmt.Errorf(\"mountDir unsupported: %v\", r)\n\t\t}\n\t}()\n\tmountDir(old, next, uid, gid, mode)\n\treturn nil\n}","preventionTips":["Only run workloads that need allocdir mounting on Linux hosts","Gate mount-dependent code and tests behind build tags or runtime.GOOS checks","Check OS support before enabling task-driver mount options","Skip allocdir mount tests on non-Linux CI runners"],"tags":["unimplemented","platform-specific","mount","linux"],"backgroundTag":"not-implemented-for-platform","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"}