goharbor/harbor · error

failed to list namespace: %v

Error message

failed to list namespace: %v

What it means

Error "failed to list namespace: %v" thrown in goharbor/harbor.

Source

Thrown at src/pkg/reg/adapter/aliacr/openapi.go:229

// ListNamespace returns a list of namespaces
func (acree *acreeOpenapi) ListNamespace() ([]string, error) {
	var namespaces []string
	nsReq := cr_ee.CreateListNamespaceRequest()
	nsReq.SetDomain(acree.domain)
	nsReq.InstanceId = acree.instanceID
	page := 1
	for {
		nsReq.PageNo = requests.NewInteger(page)
		nsResp, err := acree.client.ListNamespace(nsReq)
		if err != nil {
			return nil, err
		}
		for _, ns := range nsResp.Namespaces {
			namespaces = append(namespaces, ns.NamespaceName)
		}
		if !nsResp.ListNamespaceIsSuccess {
			return nil, fmt.Errorf("failed to list namespace: %v", nsResp)
		}
		total, err := strconv.Atoi(nsResp.TotalCount)
		if err != nil {
			return nil, err
		}
		if total-(nsResp.PageNo*nsResp.PageSize) <= 0 {
			break
		}
		page++
	}
	return namespaces, nil
}

// ListRepository returns a list of repositories in the specified namespace
func (acree *acreeOpenapi) ListRepository(namespaceName string) ([]*repository, error) {
	var repos []*repository
	reposReq := cr_ee.CreateListRepositoryRequest()
	reposReq.SetDomain(acree.domain)

View on GitHub (pinned to 7b2fd08cc5)

When it happens

Trigger: Thrown at src/pkg/reg/adapter/aliacr/openapi.go:229 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/ef94c1ddc08959de. Report an issue: GitHub.