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

KeyError when publishing repo with unsupported arch package #777

Closed
daviddavis opened this issue May 30, 2023 · 4 comments · Fixed by #778
Closed

KeyError when publishing repo with unsupported arch package #777

daviddavis opened this issue May 30, 2023 · 4 comments · Fixed by #778
Labels
.bugfix CHANGES/<issue_number>.bugfix prio-list

Comments

@daviddavis
Copy link
Contributor

A KeyError gets raised during publish if a repo contains a package with an architecture that doesn't have a corresponding release architecture.

To Reproduce

  1. Create a repo with some release architectures (e.g. arm64)
  2. Add a package for which there isn't a release architecture (e.g. frigg_1.0_ppc64.deb)
  3. Publish the repo

The task fails due to a KeyError:

{
    "child_tasks": [],
    "created_resources": [],
    "error": {
        "description": "'ppc64'",
        "traceback": "  File \"/usr/local/lib/pulp/lib64/python3.10/site-packages/pulpcore/tasking/tasks.py\", line 66, in _execute_task\n    result = func(*args, **kwargs)\n  File \"/home/vagrant/devel/pulp_deb/pulp_deb/app/tasks/publishing.py\", line 200, in publish\n    release_helper.components[prc.release_component.component].add_package(\n  File \"/home/vagrant/devel/pulp_deb/pulp_deb/app/tasks/publishing.py\", line 249, in add_package\n    self.package_index_files[package.architecture][0]\n"
    },
    "finished_at": "2023-05-30T11:22:34.373597Z",
    "logging_cid": "2a7ee29e3eeb4a6d9b562fe612316e2d",
    "name": "pulp_deb.app.tasks.publishing.publish",
    "parent_task": null,
    "progress_reports": [],
    "pulp_created": "2023-05-30T11:22:34.176793Z",
    "pulp_href": "/pulp/api/v3/tasks/4ebb6bf0-c7d2-42e8-833f-de40c205ad48/",
    "reserved_resources_record": [
        "shared:/pulp/api/v3/repositories/deb/apt/703c66ef-f106-40c1-bb97-f2a5e797bdf2/"
    ],
    "started_at": "2023-05-30T11:22:34.223482Z",
    "state": "failed",
    "task_group": null,
    "worker": "/pulp/api/v3/workers/c4cdc31f-47cf-4506-8024-cf9a795a05cd/"
}
@daviddavis
Copy link
Contributor Author

daviddavis commented May 30, 2023

Steps I used to reproduce this:

pulp deb repository create --name test

http --form :/pulp/api/v3/content/deb/packages/ file@frigg_1.0_ppc64.deb
http :/pulp/api/v3/repositories/deb/apt/703c66ef-f106-40c1-bb97-f2a5e797bdf2/modify/ add_content_units:='["/pulp/api/v3/content/deb/packages/63f97069-7d56-4620-891e-fc690d0c52f3/"]'

http :/pulp/api/v3/content/deb/releases/ distribution=test codename=test suite=test
http :/pulp/api/v3/repositories/deb/apt/703c66ef-f106-40c1-bb97-f2a5e797bdf2/modify/ add_content_units:='["/pulp/api/v3/content/deb/releases/61ee49c6-96d4-4d0a-be56-2637205a8004/"]'

http :/pulp/api/v3/content/deb/release_components/ codename=test component=test distribution=test suite=test
http :/pulp/api/v3/repositories/deb/apt/703c66ef-f106-40c1-bb97-f2a5e797bdf2/modify/ add_content_units:='["/pulp/api/v3/content/deb/release_components/fe1a0193-1e6f-4ea5-9362-04fe8f19818e/"]'

http :/pulp/api/v3/content/deb/release_architectures/ codename=test distribution=test suite=test architecture=amd64
http :/pulp/api/v3/repositories/deb/apt/703c66ef-f106-40c1-bb97-f2a5e797bdf2/modify/ add_content_units:='["/pulp/api/v3/content/deb/release_architectures/c427ef12-224f-49e5-9346-d49f53b0d989/"]'

http :/pulp/api/v3/content/deb/package_release_components/ release_component=/pulp/api/v3/content/deb/release_components/fe1a0193-1e6f-4ea5-9362-04fe8f19818e/ package=/pulp/api/v3/content/deb/packages/63f97069-7d56-4620-891e-fc690d0c52f3/
http :/pulp/api/v3/repositories/deb/apt/703c66ef-f106-40c1-bb97-f2a5e797bdf2/modify/ add_content_units:='["/pulp/api/v3/content/deb/package_release_components/07be43f7-5236-4f24-ae0a-31ea4021fbfa/"]'

pulp deb publication create --repository test --structured

@quba42
Copy link
Collaborator

quba42 commented May 30, 2023

I think this is an oversight on my part, during recent publish changes. It is something we should make the publish robust against, and ideally add a test so this never happens again.

@quba42 quba42 added .bugfix CHANGES/<issue_number>.bugfix prio-list labels May 30, 2023
@daviddavis
Copy link
Contributor Author

Which recent publish changes? We are experiencing this in 2.20.0.

I've opened a proposed fix here: #778

daviddavis added a commit to daviddavis/pulp_deb that referenced this issue May 30, 2023
@quba42
Copy link
Collaborator

quba42 commented May 30, 2023

@daviddavis Then I was mistaken about this breaking with the recent changes, though I have some vague recollection of this sort of thing having worked in the past/having been an issue before. But I could be mistaken about that as well...

daviddavis added a commit to daviddavis/pulp_deb that referenced this issue Jun 5, 2023
fixes pulp#777

Co-authored-by: Quirin Pamp <quirinp@protonmail.com>
daviddavis added a commit to daviddavis/pulp_deb that referenced this issue Jun 5, 2023
fixes pulp#777

Co-authored-by: Quirin Pamp <quirinp@protonmail.com>
daviddavis added a commit to daviddavis/pulp_deb that referenced this issue Jun 5, 2023
@quba42 quba42 linked a pull request Jun 6, 2023 that will close this issue
adamsanaglo pushed a commit to adamsanaglo/pulp_deb that referenced this issue Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.bugfix CHANGES/<issue_number>.bugfix prio-list
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants