optiopay / klar

Integration of Clair and Docker Registry
MIT License
506 stars 138 forks source link

Can't run klar command[question] #151

Closed royoan closed 5 years ago

royoan commented 5 years ago

Hi I downloal the klar from git cd /root curl https://github.com/optiopay/klar/releases/download/v2.4.0/klar-2.4.0-linux-amd64 -o ./klar PATH=$PATH:/root/klar then run:

[root@centos01 klar]# CLAIR_ADDR=localhost CLAIR_OUTPUT=High CLAIR_THRESHOLD=10 DOCKER_USER=**** DOCKER_PASSWORD=**** klar postgres:9.6
/root/clair/klar/klar: line 1: syntax error near unexpected token `<'
/root/clair/klar/klar: line 1: `<html><body>You are being <a href="https://github-production-release-asset-2e65be.s3.amazonaws.com/61352446/20ae6f80-f705-11e8-9195-5f7b62305128?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20190710%2Fus-east-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20190710T103211Z&amp;X-Amz-Expires=300&amp;X-Amz-Signature=a085b877feeaa5f7abee612ee9365be732d57b5fa765fdd783e57b288db96f7e&amp;X-Amz-SignedHeaders=host&amp;actor_id=0&amp;response-content-disposition=attachment%3B%20filename%3Dklar-2.4.0-linux-amd64&amp;response-content-type=application%2Foctet-stream">redirected</a>.</body></html>'

How to run the klar ?

EdanStarfire commented 5 years ago

if you cat your ./klar file, it looks like you might be getting that download poorly (it's downloading the klar-2.4.0-linux-amd64 executable as what's being passed to klar - which is weird (see the redirect. Try manually downloading and running first, and confirming that it works that way. If that works, then your next step is to try to determine why you were getting redirected.

If that doesn't work, I've definitely had issues with Klar handling HTTP errors from clair poorly. I just ran into it last week as my clair server bounced when I wasn't expecting it and I got that error due to a 503 response received. If that's the case, make sure you can get to the Clair API directly yourself first. Then punch it with Klar.

royoan commented 5 years ago

if you cat your ./klar file, it looks like you might be getting that download poorly (it's downloading the klar-2.4.0-linux-amd64 executable as what's being passed to klar - which is weird (see the redirect. Try manually downloading and running first, and confirming that it works that way. If that works, then your next step is to try to determine why you were getting redirected.

If that doesn't work, I've definitely had issues with Klar handling HTTP errors from clair poorly. I just ran into it last week as my clair server bounced when I wasn't expecting it and I got that error due to a 503 response received. If that's the case, make sure you can get to the Clair API directly yourself first. Then punch it with Klar.

Thanks, I'm not use it now