{"id":"1319067557f70011","repo":"docker/cli","slug":"failed-to-remove-context-s-w","errorCode":null,"errorMessage":"failed to remove context %s: %w","messagePattern":"failed to remove context (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/context/store/store.go","lineNumber":144,"sourceCode":"\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnames := make([]string, 0, len(list))\n\tfor _, item := range list {\n\t\tnames = append(names, item.Name)\n\t}\n\treturn names, nil\n}\n\n// CreateOrUpdate creates or updates metadata for the context.\nfunc (s *ContextStore) CreateOrUpdate(meta Metadata) error {\n\treturn s.meta.createOrUpdate(meta)\n}\n\n// Remove deletes the context with the given name, if found.\nfunc (s *ContextStore) Remove(name string) error {\n\tif err := s.meta.remove(name); err != nil {\n\t\treturn fmt.Errorf(\"failed to remove context %s: %w\", name, err)\n\t}\n\tif err := s.tls.remove(name); err != nil {\n\t\treturn fmt.Errorf(\"failed to remove context %s: %w\", name, err)\n\t}\n\treturn nil\n}\n\n// GetMetadata returns the metadata for the context with the given name.\n// It returns an errdefs.ErrNotFound if the context was not found.\nfunc (s *ContextStore) GetMetadata(name string) (Metadata, error) {\n\treturn s.meta.get(name)\n}\n\n// ResetTLSMaterial removes TLS data for all endpoints in the context and replaces\n// it with the new data.\nfunc (s *ContextStore) ResetTLSMaterial(name string, data *ContextTLSData) error {\n\tif err := s.tls.remove(name); err != nil {\n\t\treturn err","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/context/store/store.go#L126-L162","documentation":"Error \"failed to remove context %s: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/context/store/store.go:144 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}