anchore-engine icon indicating copy to clipboard operation
anchore-engine copied to clipboard

Cannot pull add images for scanning -error ('error_codes': ['SKOPEO_UNKNOWN_ERROR'])

Open SyCode7 opened this issue 4 years ago • 6 comments

I cannot add images to the scanning engine, there is an error - anchore-cli --u admin --p foobar --url http://localhost:8228/v1 image add weaveworksdemos/payment

Error: cannot fetch image digest/manifest from registry
HTTP Code: 400

Detail: {'error_codes': ['SKOPEO_UNKNOWN_ERROR'], 'raw_exception_message': 'Error encountered in skopeo operation. cmd=/bin/sh -c skopeo inspect --raw --tls-verify=false ``docker://docker.io/weaveworksdemos/payment:latest, rc=1, stdout=None, ``stderr=b\'time="2019-07-24T20:38:21Z" level=fatal msg="pinging docker registry returned: Get ``https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 127.0.0.11:53: read udp ``127.0.0.1:33559->127.0.0.11:53: i/o timeout" \\n\', error_code=SKOPEO_UNKNOWN_ERROR'}

SyCode7 avatar Jul 24 '19 20:07 SyCode7

Hi @SyCode7,

From that output it looks like it's not able to resolve the docker.io registry or there could be a problem reaching the registry from your local network. Can you verify that you’re able to pull the image using docker itself from the same location that you have the anchore-engine container deployed? You can try something like:

$ docker pull docker.io/weaveworksdemos/payment
Using default tag: latest
latest: Pulling from weaveworksdemos/payment
709515475419: Pull complete 
4e909df158a7: Pull complete 
03e40790fdd4: Pull complete 
9bfd21636841: Pull complete 
Digest: sha256:5ab1c9877480a018d4dda10d6dfa382776e6bca9fc1c60bacbb80903fde8cfe0
Status: Downloaded newer image for weaveworksdemos/payment:latest

blang9238 avatar Jul 25 '19 22:07 blang9238

@blang9238 , thank you for your response. You are correct the issue was with the dns settings in my network. They were recently updated, therefore I have applied the necessary updates to my daemon.json and everything works fine now.

SyCode7 avatar Jul 26 '19 09:07 SyCode7

Hey @blang9238 I've installed anchore engine through a docker-compose file. After running the following command, docker-compose exec engine-api anchore-cli image add docker.io/library/debian:7.

I'm getting the below error

Error: cannot fetch image digest/manifest from registry HTTP Code: 400 Detail: {'error_codes': ['SKOPEO_UNKNOWN_ERROR'], 'raw_exception_message': 'Error encountered in skopeo operation. cmd=/bin/sh -c skopeo inspect --raw --tls-verify=false docker://docker.io/library/debian:7, rc=1, stdout=None, stderr=b'time="2020-04-26T13:07:38Z" level=fatal msg="Error parsing image name \\"docker://docker.io/library/debian:7\\": error pinging docker registry registry-1.docker.io: Get http://registry-1.docker.io/v2/: dial tcp 35.169.133.189:80: i/o timeout"\n', error_code=SKOPEO_UNKNOWN_ERROR'}

I tried to pull the same image using docker docker pull docker.io/library/debian:7

7: Pulling from library/debian 2b15b7abe8b3: Pull complete Digest: sha256:2259b099d947443e44bbd1c94967c785361af8fd22df48a08a3942e2d5630849 Status: Downloaded newer image for debian:7 docker.io/library/debian:7 That time it was working fine. Do you have any idea why it was failing?

navinprasadk avatar Apr 26 '20 13:04 navinprasadk

I have same problem.

$ anchore-cli system status
Service simplequeue (anchore-stage-anchore-anchore-engine-simplequeue-785795594qtskj, http://anchore-stage-anchore-anchore-engine-simplequeue:8083): up
Service analyzer (anchore-stage-anchore-anchore-engine-analyzer-5f446cb999-25bwr, http://anchore-stage-anchore-anchore-engine-analyzer:8084): up
Service policy_engine (anchore-stage-anchore-anchore-engine-policy-576fbd7dcf-d5rlp, http://anchore-stage-anchore-anchore-engine-policy:8087): up
Service apiext (anchore-stage-anchore-anchore-engine-api-5556c4d587-cx4kj, http://anchore-stage-anchore-anchore-engine-api:8228): up
Service catalog (anchore-stage-anchore-anchore-engine-catalog-d5986dcb9-4sbzh, http://anchore-stage-anchore-anchore-engine-catalog:8082): up

Engine DB Version: 0.0.13
Engine Code Version: 0.8.2

$ docker pull docker.io/library/alpine:3.11
3.11: Pulling from library/alpine
Digest: sha256:9a839e63dad54c3a6d1834e29692c8492d93f90c59c978c1ed79109ea4fb9a54
Status: Image is up to date for alpine:3.11
docker.io/library/alpine:3.11

$ anchore-cli --debug image add docker.io/library/alpine:3.11
DEBUG:anchorecli.clients.apiexternal:As Account = None
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): anchore.my.company.net:80
DEBUG:urllib3.connectionpool:http://anchore.my.company.net:80 "GET /v1/ HTTP/1.1" 200 5
DEBUG:anchorecli.clients.apiexternal:As Account = None
DEBUG:anchorecli.clients.apiexternal:POST url=http://anchore.my.company.net/v1/images?autosubscribe=True
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): anchore.my.company.net:80
DEBUG:urllib3.connectionpool:http://anchore.my.company.net:80 "POST /v1/images?autosubscribe=True HTTP/1.1" 400 650
DEBUG:anchorecli.cli.utils:fetched httpcode from response: 400
Error: cannot fetch image digest/manifest from registry
HTTP Code: 400
Detail: {'raw_exception_message': 'Error encountered in skopeo operation. cmd=/bin/sh -c skopeo   inspect --raw --tls-verify=false  docker://docker.io/library/alpine:3.11, rc=1, stdout=None, stderr=b\'time="2020-12-04T05:45:45Z" level=fatal msg="Error parsing image name \\\\"docker://docker.io/library/alpine:3.11\\\\": error pinging docker registry registry-1.docker.io: Get http://registry-1.docker.io/v2/: dial tcp 3.218.162.19:80: i/o timeout"\\n\', error_code=SKOPEO_UNKNOWN_ERROR', 'error_codes': ['SKOPEO_UNKNOWN_ERROR']}

Hokwang avatar Dec 04 '20 05:12 Hokwang

Anybody able to resolve this problem? I have been stuck with this issue as well.

bikashlama541 avatar Apr 17 '21 21:04 bikashlama541

Hi! I think I found a solution, I noticed that SKOPEO was generating a problem so I checked it and in my skopeo inspect docker://REPO-ADRES.com:5050/FULL/PATCH/TO-IMAGE --creds USER:PASSWORD and next add registry anchore anchore-cli registry add REPO-ADRES.com:5050/FULL/PATCH/TO-IMAGE USER PASSWORD

and it work for me.

myhellone avatar May 14 '21 13:05 myhellone