optiopay / klar

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

"parent layer is unknown" + "resource cannot be found" #57

Closed nielsole closed 7 years ago

nielsole commented 7 years ago

Hi, I am running klar on an image in our registry and receive the following error:

Push layer 1 failed: Push error 422: {"Error":{"Message":"worker: OS and/or package manager are not supported"}}

Push layer 0 failed: Push error 400: {"Error":{"Message":"worker: parent layer is unknown, it must be processed first"}}

Analyse image http://localhost/v2/image/name:0.0.1 failed: Analyze error 404: {"Error":{"Message":"the resource cannot be found"}}

And in the clair logs this appears:

{"Event":"Handled HTTP request","Level":"info","Location":"router.go:57","Time":"2017-09-19 09:11:49.755765","elapsed time":59881969,"method":"GET","remote addr":"[::1]:46938","request uri":"/v1/layers/sha256:<redacted-256-hash>?vulnerabilities","status":"404"}

Running docker pull image/name:0.0.1 is working, this is why I am suspecting klar. Do you have any idea what the issue could be?

Versions:
klar: v1.4.1
clair: quay.io/coreos/clair:v2.0.1
nielsole commented 7 years ago

And this behaviour is flaky. Sometimes klar just exits 0 with Found 0 vulnerabilities, but if you look at the clair logs you find this:

{"Event":"Handled HTTP request","Level":"info","Location":"router.go:57","Time":"2017-09-19 09:53:26.557955","elapsed time":1025060,"method":"POST","remote addr":"[::1]:55740","request uri":"/v1/layers","status":"201"}
{"Event":"Handled HTTP request","Level":"info","Location":"router.go:57","Time":"2017-09-19 09:53:26.559220","elapsed time":841451,"method":"POST","remote addr":"[::1]:55740","request uri":"/v1/layers","status":"201"}
{"Event":"Handled HTTP request","Level":"info","Location":"router.go:57","Time":"2017-09-19 09:53:26.560282","elapsed time":744177,"method":"POST","remote addr":"[::1]:55740","request uri":"/v1/layers","status":"201"}
{"Event":"Namespace unknown","Level":"warning","Location":"worker.go:211","Time":"2017-09-19 09:53:30.367955","feature name":"libxau","feature version":"1:1.0.8-1","layer":"sha256:<redacted-256-hash>"}
{"Event":"Handled HTTP request","Level":"info","Location":"router.go:57","Time":"2017-09-19 09:53:30.368175","elapsed time":3807472164,"method":"POST","remote addr":"[::1]:55740","request uri":"/v1/layers","status":"422"}
{"Event":"the parent layer is unknown. it must be processed first","Level":"warning","Location":"worker.go:93","Time":"2017-09-19 09:53:30.370079","layer":"sha256:<redacted-256-hash>","parent layer":"sha256:<redacted-256-hash>"}
{"Event":"Handled HTTP request","Level":"info","Location":"router.go:57","Time":"2017-09-19 09:53:30.370278","elapsed time":1628279,"method":"POST","remote addr":"[::1]:55740","request uri":"/v1/layers","status":"400"}
{"Event":"Handled HTTP request","Level":"info","Location":"router.go:57","Time":"2017-09-19 09:53:30.371338","elapsed time":661453,"method":"GET","remote addr":"[::1]:55740","request uri":"/v1/layers/sha256:<redacted-256-hash>?vulnerabilities","status":"404"}

which I would interpret as a failure

hashmap commented 7 years ago

Please try v1.5 RC1 https://github.com/optiopay/klar/releases/tag/1.5-RC1

nielsole commented 7 years ago

I just tried it out and it didn't solve the problem. Same error message as before. I double checked to use the correct version ;) Maybe we should add a version flag, to get the current version from the binary.

hashmap commented 7 years ago

@nielsole interesting, please try https://github.com/optiopay/klar/releases/tag/v1.5-RC2 it's basically the same version but with simple tracing support, specify env var to enable it: KLAR_TRACE=true

nielsole commented 7 years ago

Well, turns I missed something and didn't deploy the new version :/ So no I do not get the error anymore and the Clair logs also look good. :+1: Thank you for fixing this.