optiopay / klar

Integration of Clair and Docker Registry
MIT License
507 stars 140 forks source link

ECR Failed to analyze using API v1 and v3 errors #72

Closed nukepuppy closed 6 years ago

nukepuppy commented 6 years ago

It's certainly not really clear whats happening but

used helm from contrib of clair to deploy into a kubernetes cluster... pods are up and a public service endpoint ELB is up via AWS (postgres backend for clair)

assuming one follows directions on klar setup for ECR (which by the way could use some help in clarity - ie: its missing the fact you need to define CLAIR_ADDR) ..

i run the below:

CLAIR_ADDR=SOME_ELB_THING.us-east-1.elb.amazonaws.com DOCKER_USER=AWS DOCKER_PASSWORD=${PASSWORD} /usr/bin/klar  ${REGISTRY}/myapp:12345

output:

Analysing 12 layers
Failed to analyze using API v1: push image https://AWSACCOUNTID.dkr.ecr.us-east-1.amazonaws.com/v2/myapp:12345 to Clair failed: can't even read an error message: invalid character 'N' looking for beginning of value

Failed to analyze using API v3: push image https://AWSACCOUNTID.dkr.ecr.us-east-1.amazonaws.com/v2/myapp:12345 to Clair failed: rpc error: code = Unavailable desc = all SubConns are in TransientFailure

Failed to analyze, exiting

all clair sees according to logs is:

{"Event":"Handled HTTP request","Level":"info","Location":"server.go:105","Time":"2017-12-19 18:24:49.860861","elapsed time (ms)":0.018253,"method":"POST","remote addr":"172.20.7.43:9931","request uri":"/v1/layers","status":"404"}
nukepuppy commented 6 years ago

well seems like when setting the PORT inside CLAIR_ADDR .. so :6060 to the end of the ELB string i defined before.. seems to work. though i thought that could be ommited?

by the way .. maybe its just easier to add flags to the klar tool than to define some dangerous ENV values... but i expect to just do like klar -host 1.2.3.4 -port 6060 -whateverelse etc

sorry for noise in this ticket.. but closing since its just a vague definition of the docs