{"id":"82d91e783fb66fe5","repo":"docker/cli","slug":"failed-to-read-metadata-w","errorCode":null,"errorMessage":"failed to read metadata: %w","messagePattern":"failed to read metadata: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/context/store/metadatastore.go","lineNumber":121,"sourceCode":"\treturn nil\n}\n\nfunc (s *metadataStore) list() ([]Metadata, error) {\n\tctxDirs, err := listRecursivelyMetadataDirs(s.root)\n\tif err != nil {\n\t\tif errors.Is(err, os.ErrNotExist) {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\tres := make([]Metadata, 0, len(ctxDirs))\n\tfor _, dir := range ctxDirs {\n\t\tc, err := s.getByID(contextdir(dir))\n\t\tif err != nil {\n\t\t\tif errors.Is(err, os.ErrNotExist) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"failed to read metadata: %w\", err)\n\t\t}\n\t\tres = append(res, c)\n\t}\n\tsort.Slice(res, func(i, j int) bool {\n\t\treturn sortorder.NaturalLess(res[i].Name, res[j].Name)\n\t})\n\treturn res, nil\n}\n\nfunc isContextDir(path string) bool {\n\ts, err := os.Stat(filepath.Join(path, metaFile))\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn !s.IsDir()\n}\n\nfunc listRecursivelyMetadataDirs(root string) ([]string, error) {","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/context/store/metadatastore.go#L103-L139","documentation":"Error \"failed to read metadata: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/context/store/metadatastore.go:121 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}