arminc / clair-scanner

Docker containers vulnerability scan
Apache License 2.0
848 stars 154 forks source link

Could not analyze layer: POST to Clair failed Post http://clair:6060/v1/layers: dial tcp: lookup clair on 127.0.0.11:53: server misbehaving #119

Closed jorgeuos closed 3 years ago

jorgeuos commented 3 years ago

Just wanna mention, if I or anyone else get similar issue because it was kind of frustrating.

This was working up, to a while ago. But then suddenly:

$ docker run -p 6060:6060 --net=scanning --link db:postgres -d --name clair arminc/clair-local-scan:v2.1.6_3bfb31ea61aa42eeb836354976065ccea308707e ; sleep 10
7b7XXxxxxxxxxXXXXXXxxxxxxXXXXXXxxxxxxXXXXXXxxxxxxXXXd7ed
$ docker run --net=scanning --rm --name=scanner --link=clair:clair -v '/var/run/docker.sock:/var/run/docker.sock' $SCANNERIMAGE --clair="http://clair:6060" --ip="scanner" -t Medium $IMAGE
2021/05/27 20:41:59 [INFO] ▶ Start clair-scanner
2021/05/27 20:45:52 [INFO] ▶ Server listening on port 9279
2021/05/27 20:45:52 [INFO] ▶ Analyzing 239XXxxxxxxxxXXXXXXxxxxxxXXXXXXxxxxxxXXXXXXxxxxxxXXXcbcf
2021/05/27 20:45:52 [CRIT] ▶ Could not analyze layer: POST to Clair failed Post http://clair:6060/v1/layers: dial tcp: lookup clair on 127.0.0.11:53: server misbehaving

I spent probably half a day chasing the error in the wrong end and eventually I started digging in the specific version being used and updated the image to the latest tag: arminc/clair-local-scan:v2.1.7_5125fde67edee46cb058a3feee7164af9645e07d And it worked.

I have no insight in why it broke, but updating fixed it.

You can close the issue. Br, Jorge

jorgeuos commented 3 years ago

Or I can close it myself.