{"record":{"id":"4fb47ee8522c0150","repo":"goharbor/harbor","slug":"check-scan-report-timeout","errorCode":null,"errorMessage":"check scan report timeout","messagePattern":"check scan report timeout","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/scan/job.go","lineNumber":267,"sourceCode":"\t\t\t\t\trawReport, err := fetchScanReportFromScanner(client, resp.ID, m, reportURLParameter)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t// Not ready yet\n\t\t\t\t\t\tif notReadyErr, ok := err.(*v1.ReportNotReadyError); ok {\n\t\t\t\t\t\t\t// Reset to the new check interval\n\t\t\t\t\t\t\ttm.Reset(time.Duration(notReadyErr.RetryAfter) * time.Second)\n\t\t\t\t\t\t\tmyLogger.Infof(\"Report with mime type %s is not ready yet, retry after %d seconds\", m, notReadyErr.RetryAfter)\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\terrs[i] = errors.Wrap(err, fmt.Sprintf(\"scan job: fetch scan report, mimetype %v\", m))\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\trawReports[i] = rawReport\n\t\t\t\t\treturn\n\t\t\t\tcase <-ctx.SystemContext().Done():\n\t\t\t\t\t// Terminated by system\n\t\t\t\t\treturn\n\t\t\t\tcase <-time.After(checkTimeout):\n\t\t\t\t\terrs[i] = errors.New(\"check scan report timeout\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}(i, mimeType)\n\t}\n\n\t// Wait for all the retrieving routines are completed\n\twg.Wait()\n\n\tif shouldStop() {\n\t\treturn nil\n\t}\n\n\t// Merge errors\n\tfor _, e := range errs {\n\t\tif e != nil {\n\t\t\tif err != nil {\n\t\t\t\terr = errors.Wrap(e, err.Error())","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/scan/job.go#L249-L285","documentation":"Produced in the scan job's report-polling goroutines when the per-mime-type check loop exceeds checkTimeout. The goroutine polls fetchScanReportFromScanner at the scanner-advised RetryAfter intervals; if the report never becomes ready before time.After(checkTimeout) fires, the error is recorded for that mime type.","triggerScenarios":"Scanner adapter consistently answering ReportNotReady for longer than the hard deadline; scanner overloaded (scan_all on a large registry); slow network between Harbor core and the adapter; adapter's RetryAfter values repeatedly resetting the timer past the ceiling.","commonSituations":"Trivy or other adapters queueing behind big image scans; resource-starved scanner pods; scanning very large images where the adapter takes longer than the configured check timeout; retries after adapter restarts losing scan state.","solutions":["Check scanner adapter health and load; scale the adapter or reduce concurrent scans","Increase the scan check-timeout configuration in Harbor (scanner adapter and job settings) to fit large-image scan durations","Rescan the specific artifact once the adapter is idle; on-demand scans usually succeed where scan_all timed out","Verify network latency/MTU between core and scanner adapter pods"],"exampleFix":"// before\n// default checkTimeout too short for large images\ncheckTimeout = 30 * time.Minute\n\n// after\ncheckTimeout = 2 * time.Hour // sized for scan_all on large registries","handlingStrategy":"retry","validationCode":"// Pre-flight the adapter before launching bulk scans\nresp, err := scannerClient.GetMetadata()\nif err != nil || resp == nil {\n    return fmt.Errorf(\"scanner adapter not ready: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := runScan(artifact); err != nil {\n    if strings.Contains(err.Error(), \"check scan report timeout\") {\n        // transient: adapter overloaded; backoff and rescan this artifact later\n        time.Sleep(5 * time.Minute)\n        return runScan(artifact)\n    }\n    return err\n}","preventionTips":["Size the scan check timeout to your largest image scan duration","Limit scan_all concurrency or schedule it off-peak","Monitor adapter queue depth and scale scanner replicas with load"],"tags":["scan","timeout","scanner-adapter","polling"],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}