Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'NoneType' object is not iterable error is raised when syncing a manifest list #882

Closed
lubosmj opened this issue Jun 28, 2022 · 5 comments
Closed
Assignees
Labels

Comments

@lubosmj
Copy link
Member

lubosmj commented Jun 28, 2022

When I create a manifest list with the following manifests and push it to dockerhub:

#podman version 3.4.7

podman pull ghcr.io/pulp/test-fixture-1:manifest_a
podman pull ghcr.io/pulp/test-fixture-1:manifest_b
podman pull ghcr.io/pulp/test-fixture-1:manifest_c

podman manifest create ml

podman manifest add ml ghcr.io/pulp/test-fixture-1:manifest_a
podman manifest add ml ghcr.io/pulp/test-fixture-1:manifest_b
podman manifest add ml ghcr.io/pulp/test-fixture-1:manifest_c

podman manifest push ml docker.io/lubosmj/test

I receive a runtime error when trying to sync from the corresponding remote dockerhub repository:

pulp container remote create --name test --url https://registry-1.docker.io --upstream-name "lubosmj/test"
pulp container repository create --name test
pulp container repository sync --name test --remote test
Started background task /pulp/api/v3/tasks/020c95a3-c990-4a36-b121-c5c347c8212d/
...Error: Task /pulp/api/v3/tasks/020c95a3-c990-4a36-b121-c5c347c8212d/ failed: ''NoneType' object is not iterable'
pulp [494a2583824d4ada829d0f55f555347d]: pulpcore.tasking.pulpcore_worker:INFO: Task 020c95a3-c990-4a36-b121-c5c347c8212d failed ('NoneType' object is not iterable)
pulp [494a2583824d4ada829d0f55f555347d]: pulpcore.tasking.pulpcore_worker:INFO:   File "/home/vagrant/devel/pulpcore/pulpcore/tasking/pulpcore_worker.py", line 445, in _perform_task
    result = func(*args, **kwargs)
  File "/home/vagrant/devel/pulp_container/pulp_container/app/tasks/synchronize.py", line 41, in synchronize
    return dv.create()
  File "/home/vagrant/devel/pulpcore/pulpcore/plugin/stages/declarative_version.py", line 161, in create
    loop.run_until_complete(pipeline)
  File "/usr/lib64/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/home/vagrant/devel/pulpcore/pulpcore/plugin/stages/api.py", line 225, in create_pipeline
    await asyncio.gather(*futures)
  File "/home/vagrant/devel/pulpcore/pulpcore/plugin/stages/api.py", line 43, in __call__
    await self.run()
  File "/home/vagrant/devel/pulp_container/pulp_container/app/tasks/sync_stages.py", line 188, in run 
    await self.handle_blobs(man_dc, content_data)
  File "/home/vagrant/devel/pulp_container/pulp_container/app/tasks/sync_stages.py", line 306, in handle_blobs
    for layer in content_data.get("layers") or content_data.get("fsLayers"):
@ipanova
Copy link
Member

ipanova commented Jun 29, 2022

the sync pipeline logic probably does not account for the case when there is an empty manifest list ( you did not use --all during push.)

@lubosmj
Copy link
Member Author

lubosmj commented Jun 29, 2022

The manifest list should contain 3 manifests: https://hub.docker.com/repository/registry-1.docker.io/lubosmj/test/tags
image

@lubosmj
Copy link
Member Author

lubosmj commented Jun 29, 2022

There might be no manifests pushed along with the manifest list as I did not use the --all option: https://docs.podman.io/en/latest/markdown/podman-manifest-push.1.html#all

@ipanova, do we want to enable synchronization of "empty" (i.e., containing only metadata) manifest lists?

@ipanova
Copy link
Member

ipanova commented Jun 29, 2022

yes, as long a json schema validation allows such and based on the specs i've checked, there is no enforcement of manifests array>=1

@lubosmj lubosmj self-assigned this Jun 29, 2022
lubosmj added a commit to lubosmj/pulp_container that referenced this issue Jul 13, 2022
In this commit, a couple of validation schemas were
introduced to the sync and push workflows. Newly added
manifests or manifest lists are now being validated by
the JSON validator.

closes pulp#854
closes pulp#853
closes pulp#672
closes pulp#882
lubosmj added a commit to lubosmj/pulp_container that referenced this issue Jul 26, 2022
In this commit, a couple of validation schemas were
introduced to the sync and push workflows. Newly added
manifests or manifest lists are now being validated by
the JSON validator.

closes pulp#854
closes pulp#853
closes pulp#672
closes pulp#882
lubosmj added a commit to lubosmj/pulp_container that referenced this issue Jul 26, 2022
In this commit, a couple of validation schemas were
introduced to the sync and push workflows. Newly added
manifests or manifest lists are now being validated by
the JSON validator.

closes pulp#854
closes pulp#853
closes pulp#672
closes pulp#882
lubosmj added a commit to lubosmj/pulp_container that referenced this issue Jul 26, 2022
In this commit, a couple of validation schemas were
introduced to the sync and push workflows. Newly added
manifests or manifest lists are now being validated by
the JSON validator.

closes pulp#854
closes pulp#853
closes pulp#672
closes pulp#882
@ipanova
Copy link
Member

ipanova commented Jul 29, 2022

ipanova
hey, i am looking back at this issue https://github.com/pulp/pulp_container/issues/882
and i think based on the traceback it has nothing to do with the empty manifests in the manifest list
it fails here https://github.com/pulp/pulp_container/blob/main/pulp_container/app/tasks/sync_stages.py#L188 because it went into the else condition  https://github.com/pulp/pulp_container/blob/main/pulp_container/app/tasks/sync_stages.py#L176
lmjachky
Yes
ipanova
because it did not find the mediatype?https://github.com/pulp/pulp_container/blob/main/pulp_container/app/tasks/sync_stages.py#L133
lmjachky
Because the media type for oci is unknown 
Yes
ipanova
so this is a dupe
of the other issue
you agree?
lmjachky
Ah, actually, you are right 
Yes, I agree 

@lubosmj will you close it as a dup of #883?

@lubosmj lubosmj closed this as completed Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants