{"record":{"id":"9ed0023a12b48b9a","repo":"goharbor/harbor","slug":"failed-to-get-stats-of-worker-pools","errorCode":null,"errorMessage":"failed to get stats of worker pools","messagePattern":"failed to get stats of worker pools","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"src/jobservice/worker/cworker/c_worker.go","lineNumber":320,"sourceCode":"\t\t}\n\n\t\twPoolStatus := workerPoolStatusHealthy\n\t\tif time.Unix(hb.HeartbeatAt, 0).Add(workerPoolDeadTime).Before(time.Now()) {\n\t\t\twPoolStatus = workerPoolStatusDead\n\t\t}\n\t\tstat := &worker.StatsData{\n\t\t\tWorkerPoolID: hb.WorkerPoolID,\n\t\t\tStartedAt:    hb.StartedAt,\n\t\t\tHeartbeatAt:  hb.HeartbeatAt,\n\t\t\tJobNames:     hb.JobNames,\n\t\t\tConcurrency:  hb.Concurrency,\n\t\t\tStatus:       wPoolStatus,\n\t\t}\n\t\tstats = append(stats, stat)\n\t}\n\n\tif len(stats) == 0 {\n\t\treturn nil, errors.New(\"failed to get stats of worker pools\")\n\t}\n\n\treturn &worker.Stats{\n\t\tPools: stats,\n\t}, nil\n}\n\n// StopJob will stop the job\nfunc (w *basicWorker) StopJob(jobID string) error {\n\tif utils.IsEmptyStr(jobID) {\n\t\treturn errors.New(\"empty job ID to stop\")\n\t}\n\n\tt, err := w.ctl.Track(jobID)\n\tif err != nil && !errs.IsObjectNotFoundError(err) {\n\t\t// For none not found error, directly return\n\t\treturn err\n\t}","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/jobservice/worker/cworker/c_worker.go#L302-L338","documentation":"Error \"failed to get stats of worker pools\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/jobservice/worker/cworker/c_worker.go:320 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}