goharbor/harbor · error

failed to list artifacts of repository

Error message

failed to list artifacts of repository '%s': %v

What it means

Returned inside a concurrent FetchArtifacts task when listing artifacts of one repository of a Harbor (v1 API) project fails. It wraps the per-repo error with the repository name; the underlying failure comes from the Harbor v1 API (connectivity, auth, or project/repo access).

Solutions

  1. Check the wrapped error for the Harbor API failure details
  2. Verify the Harbor URL and credentials used by the adapter
  3. Ensure the account has artifact-list permission on the project/repository
  4. Retry the replication job; transient API errors are common
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/pkg/reg/adapter/harbor/v1/adapter.go:68 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/ca5122a221c1e802. Report an issue: GitHub.

Appendix: source

Thrown at src/pkg/reg/adapter/harbor/v1/adapter.go:68

	for _, project := range projects {
		repositories, err := a.listRepositories(project, filters)
		if err != nil {
			return nil, err
		}
		if len(repositories) == 0 {
			continue
		}

		var rawResources = make([]*model.Resource, len(repositories))
		runner := utils.NewLimitedConcurrentRunner(adp.MaxConcurrency)

		for i, r := range repositories {
			index := i
			repo := r
			runner.AddTask(func() error {
				artifacts, err := a.listArtifacts(repo.Name, filters)
				if err != nil {
					return fmt.Errorf("failed to list artifacts of repository '%s': %v", repo.Name, err)
				}
				if len(artifacts) == 0 {
					rawResources[index] = nil
					return nil
				}

				rawResources[index] = &model.Resource{
					Type:     model.ResourceTypeImage,
					Registry: a.Registry,
					Metadata: &model.ResourceMetadata{
						Repository: &model.Repository{
							Name:     repo.Name,
							Metadata: project.Metadata,
						},
						Artifacts: artifacts,
					},
				}
				return nil

View on GitHub (pinned to 7b2fd08cc5)