{"id":"edbccb60ceacd0d3","repo":"docker/cli","slug":"failed-to-remove-metadata-w","errorCode":null,"errorMessage":"failed to remove metadata: %w","messagePattern":"failed to remove metadata: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/context/store/metadatastore.go","lineNumber":101,"sourceCode":"\t}\n\tif err := json.Unmarshal(bytes, &untyped); err != nil {\n\t\treturn Metadata{}, fmt.Errorf(\"parsing %s: %v\", fileName, err)\n\t}\n\tr.Name = untyped.Name\n\tif r.Metadata, err = parseTypedOrMap(untyped.Metadata, s.config.contextType); err != nil {\n\t\treturn Metadata{}, fmt.Errorf(\"parsing %s: %v\", fileName, err)\n\t}\n\tfor k, v := range untyped.Endpoints {\n\t\tif r.Endpoints[k], err = parseTypedOrMap(v, s.config.endpointTypes[k]); err != nil {\n\t\t\treturn Metadata{}, fmt.Errorf(\"parsing %s: %v\", fileName, err)\n\t\t}\n\t}\n\treturn r, err\n}\n\nfunc (s *metadataStore) remove(name string) error {\n\tif err := os.RemoveAll(s.contextDir(contextdirOf(name))); err != nil {\n\t\treturn fmt.Errorf(\"failed to remove metadata: %w\", err)\n\t}\n\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","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/context/store/metadatastore.go#L83-L119","documentation":"Error \"failed to remove metadata: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/context/store/metadatastore.go:101 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}