anchore / anchore-engine

A service that analyzes docker images and scans for vulnerabilities
Apache License 2.0
1.57k stars 273 forks source link

Anchore engine failure with ''NoneType'' object is not iterable' when scanning a manifest created by Podman #1393

Closed pganeshar closed 1 year ago

pganeshar commented 1 year ago

What happened: Submitted a manifest that contains an amd and arm image and Anchore scan failed with ''NoneType'' object is not iterable'. The images and manifest were created by Podman.

What you expected to happen: Anchore to scan the images successfully; like it did when the images and manifest are built by docker.

How to reproduce it (as minimally and precisely as possible):

  1. Build an amd image using podman
  2. Build an arm image using podman
  3. Create a manifest and amd and arm images to it.
  4. Submit the manifest to Anchore engine.
  5. Check Anchore event log, it reports with error ''NoneType'' object is not iterable' Here is the whole error:
    $ anchore-cli event get a451c800ab014def8503c4d59afb03ab
    details:
    msg: 'failed to download, unpack, analyze, and generate image export (9999999999999.dkr.ecr.us-west-2.amazonaws.com/sandbox-example/goserviceeks@sha256:8fd0f9323432343384385ec23b500ac091a9577c78cf87f412ab4ff1ad3fce9f)
    - exception: ''NoneType'' object is not iterable'
    level: error
    message: Failed to analyze image
    resource:
    id: 9999999999999.dkr.ecr.us-west-2.amazonaws.com/sandbox-example/goserviceeks:0.0.1-1662584101053-feature-signed
    type: image_tag
    user_id: dev-team
    source:
    base_url: http://release-name-anchore-engine-analyzer:8084/
    hostid: release-name-anchore-engine-analyzer-56ffc4fbd7-dlxw4
    request_id: null
    servicename: analyzer
    timestamp: '2022-10-06T21:03:29.845699Z'
    type: user.image.analysis.failed

Anything else we need to know?: Anchore scans the manifest successfully when its built by docker. Also if I submit the amd and arm images built by Podman individually, Anchore works fine its the manifest it has problem with.

Environment:

$ anchore-cli system status Engine DB Version: 0.0.14 Engine Code Version: 0.9.1

podman info --debug

host: arch: amd64 buildahVersion: 1.27.0 cgroupControllers:

tgerla commented 1 year ago

Hi @pganeshar, sorry for the bad news but we have actually just removed the anchore-engine upload feature from Syft going forward. Please feel free to come by our Slack channel and we can help you figure out a migration path. We will be happy to help you out.

kzantow commented 1 year ago

Quick follow-up: it should be noted that this upload functionality was never intended to work with Engine but only Enterprise due to some nuances between the APIs and it has always been an experimental feature (as indicated by the documentation/etc.). Enterprise now has a different tool to perform this upload so it is no longer needed in Syft. Sorry for the inconvenience!