pulp / pulp/pulpcore

Missing resource information in a "pulpcore.app.tasks.base.general_update" task during a replication

Open
#4,640 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue Triage-Needed
Dominant language
Python
Stars
598
Forks
168
Avg merge
1d 4h
Merged PRs (30d)
86

Description

Version
Python PYPI installation

  • PulpCore = 3.32.0
  • CertGuard = 1.6.5
  • file = 1.14.4
  • python = 3.10.0
  • rpm = 3.22.3

Describe the bug
In the Replication job execution, a "pulpcore.app.tasks.base.general_update" subtask doesn't reveal the artifact resource reference which it is trying to update. The following is a capture of "general_update" task of a distribution artifact and no clue which object it failed to update.

{
    "pulp_href": "/pulp/api/v3/tasks/018b8ae2-f55b-70e1-823d-d56c0fdab18d/",
    "pulp_created": "2023-11-01T12:36:51.676035Z",
    "state": "failed",
    "name": "pulpcore.app.tasks.base.general_update",
    "logging_cid": "0ebdbb4c4a1e406ab401d0548884cfe8",
    "created_by": "/pulp/api/v3/users/1/",
    "started_at": "2023-11-01T12:36:59.839374Z",
    "finished_at": "2023-11-01T12:37:00.057292Z",
    "error": {
        "traceback": "  File \"/usr/local/lib/python3.11/site-packages/pulpcore/tasking/tasks.py\", line 64, in _execute_task\n    result = func(*args, **kwargs)\n             ^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/pulpcore/app/tasks/base.py\", line 74, in general_update\n    serializer.is_valid(raise_exception=True)\n  File \"/usr/local/lib/python3.11/site-packages/rest_framework/serializers.py\", line 235, in is_valid\n    raise ValidationError(self.errors)\n",
        "description": "{'non_field_errors': [ErrorDetail(string=\"Only one of the attributes 'repository' and 'publication' may be used simultaneously.\", code='invalid')]}"
    },
    "worker": "/pulp/api/v3/workers/018b8ad1-5f9b-7f7d-b0ba-abd6c22cfa08/",
    "parent_task": "/pulp/api/v3/tasks/018b8ae2-ea8a-76f2-8a2a-cf2b8b67b296/",
    "child_tasks": [],
    "task_group": "/pulp/api/v3/task-groups/018b8ae2-ea84-7be0-9f39-33dcd5d27ab2/",
    "progress_reports": [],
    "created_resources": [],
    "reserved_resources_record": [
        "/api/v3/distributions/",
        "shared:/pulp/api/v3/domains/b56f460a-45b1-459f-9d2f-b4e6be950caa/"
    ]
}

To Reproduce
Kindly follow the reproduce procedure defined in the issue https://github.com/pulp/pulpcore/issues/4637

Expected behavior
Like "pulpcore.app.tasks.base.general_create", "pulpcore.app.tasks.base.general_delete", "pulp_rpm.app.tasks.synchronizing.synchronize" subtasks the "pulpcore.app.tasks.base.general_update" subtask should also provide an reference to an object which is updating.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in pulpcore/app/tasks/base.py around general_update, then compare the task information produced by general_create, general_delete, and pulp_rpm.app.tasks.synchronizing.synchronize. Follow the reproduction procedure from issue 4637. Done means a general_update subtask exposes a reference to the object it is updating, consistent with the expected behavior described here.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.