Container Scanning is failing randomly

The container_scanning job is sometimes failing with:

[...]
  9450K .......... .......... .......... .......... .......... 98%  151M 0s
  9500K .......... .......... .......... .......... .......... 99% 5.86M 0s
  9550K .......... .......... .......... .......... .......... 99%  105M 0s
  9600K .......... .......... .......... .                    100%  127M=0.6s

2018-04-13 09:15:13 (16.7 MB/s) - 'clair-scanner_linux_amd64' saved [9862522/9862522]

2018/04/13 09:15:13 [INFO] ▶ Start clair-scanner
2018/04/13 09:15:52 [INFO] ▶ Server listening on port 9279
2018/04/13 09:15:52 [INFO] ▶ Analyzing 501c82e5da89552cf99e8b6d8ec08c47b206ffb08110d04a092ce31b5fe65d0b
2018/04/13 09:15:52 [CRIT] ▶ Could not analyze layer: POST to Clair failed Post http://docker:6060/v1/layers: dial tcp 172.17.0.3:6060: getsockopt: connection refused
Uploading artifacts...
WARNING: gl-sast-container-report.json: no matching files 
Uploading artifacts to coordinator... ok            id=62779917 responseStatus=201 Created token=3TVmNKHb
Job succeeded

(extracted from https://gitlab.com/bikebilly/spring-auto-devops/-/jobs/62779917

Since we don't make the job fail in this case, no error is reported in MR widget nor CI view.

It's probably because the client tries to connect too soon with the server, we need to investigate that.

/cc @bikebilly

Assignee Loading
Time tracking Loading