{"id":"6b44f7c37dc9ff5b","repo":"docker/cli","slug":"unexpected-path-format","errorCode":null,"errorMessage":"unexpected path format","messagePattern":"unexpected path format","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/context/store/store.go","lineNumber":376,"sourceCode":"\timportContentType, err := getImportContentType(r)\n\tif err != nil {\n\t\treturn err\n\t}\n\tswitch importContentType {\n\tcase zipType:\n\t\treturn importZip(name, s, r)\n\tdefault:\n\t\t// Assume it's a TAR (TAR does not have a \"magic number\")\n\t\treturn importTar(name, s, r)\n\t}\n}\n\nfunc isValidFilePath(p string) error {\n\tif p != metaFile && !strings.HasPrefix(p, \"tls/\") {\n\t\treturn errors.New(\"unexpected context file\")\n\t}\n\tif path.Clean(p) != p {\n\t\treturn errors.New(\"unexpected path format\")\n\t}\n\tif strings.Contains(p, `\\`) {\n\t\treturn errors.New(`unexpected '\\' in path`)\n\t}\n\treturn nil\n}\n\nfunc importTar(name string, s Writer, reader io.Reader) error {\n\ttr := tar.NewReader(&limitedReader{R: reader, N: maxAllowedFileSizeToImport})\n\ttlsData := ContextTLSData{\n\t\tEndpoints: map[string]EndpointTLSData{},\n\t}\n\tvar importedMetaFile bool\n\tfor {\n\t\thdr, err := tr.Next()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/context/store/store.go#L358-L394","documentation":"Error \"unexpected path format\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/context/store/store.go:376 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}