{"record":{"id":"394559caf0a62148","repo":"hashicorp/nomad","slug":"unsupported-platform","errorCode":null,"errorMessage":"Unsupported platform","messagePattern":"Unsupported platform","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"helper/mount/mount_unsupported.go","lineNumber":24,"sourceCode":"\npackage mount\n\nimport (\n\t\"errors\"\n)\n\n// mounter provides the default implementation of mount.Mounter\n// for unsupported platforms.\ntype mounter struct {\n}\n\n// New returns a Mounter for the current system.\nfunc New() Mounter {\n\treturn &mounter{}\n}\n\nfunc (m *mounter) IsNotAMountPoint(path string) (bool, error) {\n\treturn false, errors.New(\"Unsupported platform\")\n}\n\nfunc (m *mounter) Mount(device, target, mountType, options string) error {\n\treturn errors.New(\"Unsupported platform\")\n}\n","sourceCodeStart":6,"sourceCodeEnd":30,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/helper/mount/mount_unsupported.go#L6-L30","documentation":"On platforms without mount support (the build-tag-gated mount_unsupported.go stub), the mounter stub returns this error from every method. IsNotAMountPoint cannot check mount status on an unsupported OS, so it always fails with \"Unsupported platform\".","triggerScenarios":"Calling mount.New().IsNotAMountPoint(path) on a build compiled for an unsupported platform (e.g. the file has no OS build tag coverage — typically Windows or other non-Linux/BSD targets), or when the helper/raftutil code inspects raft bolt files on such a platform.","commonSituations":"Cross-compiling Nomad helpers for Windows/unsupported OS; unit tests of mount-dependent code running on an OS excluded by build tags; code assuming Linux-only features while running on macOS/Windows builds of the stub.","solutions":["Run on a supported platform (Linux/BSD) where the real mounter implementation is compiled in.","Guard call sites with runtime.GOOS checks and skip mount inspection on unsupported OSes.","If platform support is needed, provide a concrete Mounter implementation with the appropriate build tags instead of relying on the stub."],"exampleFix":"// before\nisMount, err := m.IsNotAMountPoint(path)\n// after\nif runtime.GOOS == \"windows\" {\n    return nil // mount inspection unsupported on this platform\n}\nisMount, err := m.IsNotAMountPoint(path)","handlingStrategy":"fallback","validationCode":"if runtime.GOOS != \"linux\" && runtime.GOOS != \"darwin\" && !isBSD(runtime.GOOS) {\n    // mount inspection unavailable; skip\n}","typeGuard":"func mountSupported() bool {\n    switch runtime.GOOS {\n    case \"linux\", \"darwin\", \"freebsd\", \"openbsd\", \"netbsd\":\n        return true\n    }\n    return false\n}","tryCatchPattern":"isMount, err := m.IsNotAMountPoint(path)\nif err != nil && err.Error() == \"Unsupported platform\" {\n    // degrade: treat as unknown, skip mount check\n    return unknownMountState, nil\n}","preventionTips":["Gate mount-dependent code behind runtime.GOOS or build tags.","Document platform requirements for mount-inspecting helpers.","Avoid running raft/mount inspection tooling on unsupported targets."],"tags":["platform","filesystem","unsupported-os"],"backgroundTag":"unsupported-platform-stub","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"}