goharbor/harbor · error

failed to list repo

Error message

failed to list repo: %s

What it means

The Ali ACR ListRepository OpenAPI response for the namespace carried ListRepositoryIsSuccess=false — the API answered but the business call failed (bad namespace, permissions, instance state); the failure text is embedded.

Solutions

  1. Confirm the namespace exists in the ACR instance
  2. Check access key permissions for repository listing
  3. Inspect the full response body logged alongside for the Aliyun error code
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/pkg/reg/adapter/aliacr/openapi.go:259 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/04e8dd4a1240d475. Report an issue: GitHub.

Appendix: source

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

}

// 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)
	reposReq.InstanceId = acree.instanceID
	reposReq.RepoNamespaceName = namespaceName
	reposReq.RepoStatus = "NORMAL"
	page := 1
	for {
		reposReq.PageNo = requests.NewInteger(page)
		reposResp, err := acree.client.ListRepository(reposReq)
		if err != nil {
			return nil, err
		}
		if !reposResp.ListRepositoryIsSuccess {
			return nil, fmt.Errorf("failed to list repo: %s", reposResp.GetHttpContentString())
		}
		for _, repo := range reposResp.Repositories {
			repos = append(repos, &repository{
				Name:      repo.RepoName,
				Namespace: repo.RepoNamespaceName,
				ID:        repo.RepoId,
			})
		}
		total, err := strconv.Atoi(reposResp.TotalCount)
		if err != nil {
			return nil, err
		}
		if total <= page*reposResp.PageSize {
			break
		}
		page++
	}
	return repos, nil

View on GitHub (pinned to 7b2fd08cc5)