diff --git a/cli/context/store/metadatastore.go b/cli/context/store/metadatastore.go index 42edc8a786..5222897f39 100644 --- a/cli/context/store/metadatastore.go +++ b/cli/context/store/metadatastore.go @@ -110,6 +110,9 @@ func (s *metadataStore) list() ([]Metadata, error) { for _, dir := range ctxDirs { c, err := s.getByID(contextdir(dir)) if err != nil { + if os.IsNotExist(err) { + continue + } return nil, errors.Wrap(err, "failed to read metadata") } res = append(res, c) diff --git a/cli/context/store/tlsstore.go b/cli/context/store/tlsstore.go index 9992481405..dbd1649b99 100644 --- a/cli/context/store/tlsstore.go +++ b/cli/context/store/tlsstore.go @@ -82,6 +82,9 @@ func (s *tlsStore) listContextData(name string) (map[string]EndpointFiles, error for _, epFS := range epFSs { if epFS.IsDir() { fss, err := os.ReadDir(filepath.Join(contextDir, epFS.Name())) + if os.IsNotExist(err) { + continue + } if err != nil { return nil, errors.Wrapf(err, "failed to list TLS files for endpoint %s", epFS.Name()) }