clair-scanner: [CRITICAL] Clair Scannner 400 errors when Analyzing code

Running clair-scanner in docker and we are noticing blobs/sha256 appended to the layer and the scanning is failing.

23:26:52  + /clair/clair-scanner --clair=http://clair/ --ip=X.X.X.X --report=build/clair/clair-result_1.json --whitelist=build/clair/clair-allowlist.yaml sha256:eb9d02bc6996d6ff8e8b20e6ab12d97ae9288e1868461e640d6caa6f17acc754
23:26:52  2024/12/09 04:26:51 [INFO] ▶ Start clair-scanner
23:27:00  2024/12/09 04:26:59 [INFO] ▶ Server listening on port 9279
23:27:00  2024/12/09 04:26:59 [INFO] ▶ Analyzing blobs/sha256/a9b34f345c5b4d6b4e95067e09312cad6db11e6593eb93dd73df573dff9b3f02
23:27:00  2024/12/09 04:26:59 [CRIT] ▶ Could not analyze layer: Clair responded with a failure: Got response 400 with message {"Error":{"Message":"could not find layer"}}
23:27:00  
23:27:00  [Pipeline] echo
23:27:00  Clair returned with status 1
23:27:00  [Pipeline] archiveArtifacts

Earlier scans didn’t have blobs/sha256 infront of the layer. Tried pointing to older image for clair scanner but that didn’t work either.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 33 (1 by maintainers)

Most upvoted comments

Hello @datadot

I think I’ve good news, increasing memory to 4 Gigs solved the problem. I was able to scan image successfully.

05:49:34  + /clair/clair-scanner --clair=http://clair/ --ip=X.X.X.X --report=build/clair/clair-result_docker-eu-dev-PR-43-2.json --whitelist=build/clair/clair-allowlist.yaml docker-eu-dev-PR-43-2
05:49:34  2025/01/24 10:49:34 [INFO] ▶ Starting clair-scanner for image: hm-vpc-test-runner:dev-PR-43-2
05:49:57  2025/01/24 10:49:56 [INFO] ▶ Starting HTTP file server on 0.0.0.0:9279 serving path: /tmp/clair-scanner-3006509694
05:49:57  2025/01/24 10:49:56 [INFO] ▶ Starting HTTP server on 0.0.0.0:9279
05:49:57  2025/01/24 10:49:56 [INFO] ▶ HTTP server is ready on 0.0.0.0:9279
05:50:35  2025/01/24 10:50:32 [WARN] ▶ Image [hm-vpc-test-runner:dev-PR-43-2] contains 193 total vulnerabilities
05:50:35  2025/01/24 10:50:32 [ERRO] ▶ Image [hm-vpc-test-runner:dev-PR-43-2] contains 193 unapproved vulnerabilities
05:50:35  2025/01/24 10:50:33 [ERRO] ▶ Unapproved vulnerabilities found in the image
05:50:35  [Pipeline] echo
05:50:35  Clair exited with 1
05:50:35  [Pipeline] archiveArtifacts
05:50:36  Archiving artifacts
05:50:36  [Pipeline] echo
05:50:36  Analyzing results for hm-vpc-test-runner:dev-PR-43-2
05:50:36  [Pipeline] readJSON
05:50:37  [Pipeline] writeFile
05:50:37  [Pipeline] archiveArtifacts
05:50:37  Archiving artifacts
05:50:37  [Pipeline] echo
05:50:37  Fix patches for vulnerabities found (12)
05:50:37  [Pipeline] echo
05:50:37  Vulnerabilities were found that don't have fixes available yet.