{"record":{"id":"abe9d4299bdbba73","repo":"goharbor/harbor","slug":"failed-to-list-projects-at-page-d-with-page-size","errorCode":null,"errorMessage":"failed to list projects at page %d with page size %d, error :%v","messagePattern":"failed to list projects at page (.+?) with page size (.+?), error :(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/controller/project/util.go","lineNumber":46,"sourceCode":"\tError error\n}\n\n// ListAll returns all projects with chunk support\nfunc ListAll(ctx context.Context, chunkSize int, query *q.Query, options ...Option) <-chan Result {\n\tch := make(chan Result, chunkSize)\n\n\tgo func() {\n\t\tdefer close(ch)\n\n\t\tquery = q.MustClone(query)\n\t\tquery.PageNumber = 1\n\t\tquery.PageSize = int64(chunkSize)\n\n\t\tfor {\n\t\t\tprojects, err := Ctl.List(ctx, query, options...)\n\t\t\tif err != nil {\n\t\t\t\tformat := \"failed to list projects at page %d with page size %d, error :%v\"\n\t\t\t\tch <- Result{Error: fmt.Errorf(format, query.PageNumber, query.PageSize, err)}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, p := range projects {\n\t\t\t\tch <- Result{Data: p}\n\t\t\t}\n\n\t\t\tif len(projects) < chunkSize {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tquery.PageNumber++\n\t\t}\n\t}()\n\n\treturn ch\n}\n","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/controller/project/util.go#L28-L64","documentation":"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.","triggerScenarios":"Thrown at src/controller/project/util.go:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped error for the DB/query root cause.","Retry the listing; transient DB errors are a common cause.","Reduce chunkSize or add query filters if large page queries time out."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","contentChangedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}