{"id":"61caaa812bdac6ce","repo":"docker/cli","slug":"1-s-2-s-1-s-driver-and-1-s-file-conflict","errorCode":null,"errorMessage":"%[1]s %[2]s: %[1]s.driver and %[1]s.file conflict; only use %[1]s.driver","messagePattern":"%\\[1\\]s %\\[2\\]s: %\\[1\\]s\\.driver and %\\[1\\]s\\.file conflict; only use %\\[1\\]s\\.driver","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/compose/loader/loader.go","lineNumber":669,"sourceCode":"\tswitch {\n\tcase obj.External.External:\n\t\t// handle deprecated external.name\n\t\tif obj.External.Name != \"\" {\n\t\t\tif obj.Name != \"\" {\n\t\t\t\treturn obj, fmt.Errorf(\"%[1]s %[2]s: %[1]s.external.name and %[1]s.name conflict; only use %[1]s.name\", objType, name)\n\t\t\t}\n\t\t\tif versions.GreaterThanOrEqualTo(details.Version, \"3.5\") {\n\t\t\t\tlogrus.Warnf(\"%[1]s %[2]s: %[1]s.external.name is deprecated in favor of %[1]s.name\", objType, name)\n\t\t\t}\n\t\t\tobj.Name = obj.External.Name\n\t\t\tobj.External.Name = \"\"\n\t\t} else if obj.Name == \"\" {\n\t\t\tobj.Name = name\n\t\t}\n\t\t// if not \"external: true\"\n\tcase obj.Driver != \"\":\n\t\tif obj.File != \"\" {\n\t\t\treturn obj, fmt.Errorf(\"%[1]s %[2]s: %[1]s.driver and %[1]s.file conflict; only use %[1]s.driver\", objType, name)\n\t\t}\n\tdefault:\n\t\tobj.File = absPath(details.WorkingDir, obj.File)\n\t}\n\n\treturn obj, nil\n}\n\nfunc absPath(workingDir string, filePath string) string {\n\tif filepath.IsAbs(filePath) {\n\t\treturn filePath\n\t}\n\treturn filepath.Join(workingDir, filePath)\n}\n\nvar transformMapStringString TransformerFunc = func(data any) (any, error) {\n\tswitch value := data.(type) {\n\tcase map[string]any:","sourceCodeStart":651,"sourceCodeEnd":687,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/compose/loader/loader.go#L651-L687","documentation":"Error \"%[1]s %[2]s: %[1]s.driver and %[1]s.file conflict; only use %[1]s.driver\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/compose/loader/loader.go:669 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}