hashicorp/nomad · critical
not implemented
Error message
not implemented
What it means
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.
Source
Thrown at client/allocdir/fs_default.go:12
// Copyright IBM Corp. 2015, 2026
// SPDX-License-Identifier: BUSL-1.1
//go:build !linux
package allocdir
import "os"
// mountDir bind mounts old to next using the given file mode.
func mountDir(old, next string, uid, gid int, mode os.FileMode) error {
panic("not implemented")
}
View on GitHub (pinned to 482b49bf1a)
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
Example fix
// before
mountDir(old, next, uid, gid, mode) // panics on this platform
// after
if runtime.GOOS != "linux" {
return fmt.Errorf("mountDir is not supported on %s", runtime.GOOS)
}
mountDir(old, next, uid, gid, mode) Defensive patterns
Strategy: validation
Validate before calling
if runtime.GOOS != "linux" {
return fmt.Errorf("directory mounting requires Linux, running on %s", runtime.GOOS)
}
// proceed to call allocdir mount APIs only on Linux Try / catch
// Go: recover around mount operations on non-Linux builds
func safeMount(old, next string, uid, gid int, mode os.FileMode) (err error) {
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("mountDir unsupported: %v", r)
}
}()
mountDir(old, next, uid, gid, mode)
return nil
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Failed to unmount proc %q: %w
- mount --make-rshared %s failed: %q
- mount --rbind %s %s failed: %q
- failed to bind mount ns at %s: %v
- journald log monitoring only available on linux
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/198ff678dbbdd73d.
Report an issue: GitHub.