goharbor/harbor · error

failed to list projects at page

Error message

failed to list projects at page %d with page size %d, error :%v

What it means

Wrapping error sent over the ListAll result channel when Ctl.List fails while paginating through projects at a given page/pageSize. The goroutine stops iteration and yields this error, which includes the failing page number and chunk size plus the underlying cause.

Solutions

  1. Read the wrapped error for the DB/query root cause.
  2. Retry the listing; transient DB errors are a common cause.
  3. Reduce chunkSize or add query filters if large page queries time out.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/controller/project/util.go:46 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/abe9d4299bdbba73. Report an issue: GitHub.

Appendix: source

Thrown at src/controller/project/util.go:46

	Error error
}

// ListAll returns all projects with chunk support
func ListAll(ctx context.Context, chunkSize int, query *q.Query, options ...Option) <-chan Result {
	ch := make(chan Result, chunkSize)

	go func() {
		defer close(ch)

		query = q.MustClone(query)
		query.PageNumber = 1
		query.PageSize = int64(chunkSize)

		for {
			projects, err := Ctl.List(ctx, query, options...)
			if err != nil {
				format := "failed to list projects at page %d with page size %d, error :%v"
				ch <- Result{Error: fmt.Errorf(format, query.PageNumber, query.PageSize, err)}
				return
			}

			for _, p := range projects {
				ch <- Result{Data: p}
			}

			if len(projects) < chunkSize {
				break
			}

			query.PageNumber++
		}
	}()

	return ch
}

View on GitHub (pinned to 7b2fd08cc5)