{"record":{"id":"6b8c862c3bb685be","repo":"docker/cli","slug":"path-q-lacks-required-file-extension-exe","errorCode":null,"errorMessage":"path %q lacks required file extension (.exe)","messagePattern":"path %q lacks required file extension \\(\\.exe\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli-plugins/manager/suffix_windows.go","lineNumber":13,"sourceCode":"package manager\n\nimport (\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\n// This is made slightly more complex due to needing to be case-insensitive.\nfunc trimExeSuffix(s string) (string, error) {\n\text := filepath.Ext(s)\n\tif ext == \"\" || !strings.EqualFold(ext, \".exe\") {\n\t\treturn \"\", fmt.Errorf(\"path %q lacks required file extension (.exe)\", s)\n\t}\n\treturn strings.TrimSuffix(s, ext), nil\n}\n\nfunc addExeSuffix(s string) string {\n\treturn s + \".exe\"\n}\n","sourceCodeStart":1,"sourceCodeEnd":21,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli-plugins/manager/suffix_windows.go#L1-L21","documentation":"Returned by trimExeSuffix (Windows build only) when the plugin filename has no extension or an extension other than .exe (case-insensitive). On Windows, plugin executables must carry the .exe suffix so the manager can strip it to derive the command name.","triggerScenarios":"On Windows, a plugin candidate file like 'docker-foo' or 'docker-foo.bat' that lacks the .exe extension.","commonSituations":"A cross-platform plugin distributed as a non-.exe script/binary on Windows, or a file copied without its extension.","solutions":["Ensure the Windows plugin artifact has a .exe extension, e.g. docker-foo.exe.","Build the plugin for Windows (GOOS=windows) so the toolchain produces an .exe.","Remove non-.exe files from the Windows plugin search directory."],"exampleFix":"# before\ncli-plugins/docker-foo\n# after\ncli-plugins/docker-foo.exe","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"p, err := newPlugin(candidate, cmds)\nif err != nil {\n    continue\n}","preventionTips":["On Windows, distribute plugins as .exe artifacts.","Remove non-.exe files from the Windows plugin directory."],"tags":["cli-plugins","plugins","windows","filesystem"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}