Project

Profile

Help

Issue #9659

closed

Task.error dict does not include a type

Added by dkliban@redhat.com almost 3 years ago. Updated almost 3 years ago.

Status:
CLOSED - DUPLICATE
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

Ticket moved to GitHub: "pulp/pulpcore/2073":https://github.com/pulp/pulpcore/issues/2073


MemoryError does not have a message string. So when the error shows up in a Task, the description is an empty string and only a traceback is present. The Task.error dict should include a type key[0].

{
    "child_tasks": [],
    "created_resources": [],
    "error": {
        "description": "",
        "traceback": "  File \"/usr/lib/python3.6/site-packages/pulpcore/tasking/pulpcore_worker.py\", line 317, in _perform_task\n    result = func(*args, **kwargs)\n  File \"/usr/lib/python3.6/site-packages/pulpcore/app/tasks/importer.py\", line 161, in import_repository_version\n    a_result = _import_file(os.path.join(rv_path, filename), res_class, do_raise=False)\n  File \"/usr/lib/python3.6/site-packages/pulpcore/app/tasks/importer.py\", line 62, in _import_file\n    data = Dataset().load(json_file.read(), format=\"json\")\n  File \"/usr/lib/python3.6/site-packages/tablib/core.py\", line 403, in load\n    stream = normalize_input(in_stream)\n  File \"/usr/lib/python3.6/site-packages/tablib/utils.py\", line 10, in normalize_input\n    return StringIO(stream)\n"
    },
    "finished_at": "2021-12-16T21:10:44.339744Z",
    "logging_cid": "5771d8b0-21d3-42b5-b4a9-2d57b29cc756",
    "name": "pulpcore.app.tasks.importer.import_repository_version",
    "parent_task": "/pulp/api/v3/tasks/79b44b66-2b76-4be8-a29a-cbe9f4122a6e/",
    "progress_reports": [
        {
            "code": "import.repo.version.content",
            "done": 0,
            "message": "Importing content for Red_Hat_Enterprise_Linux_8_for_x86_64_-_BaseOS_RPMs_8-2128169",
            "state": "running",
            "suffix": null,
            "total": null
        }
    ],
    "pulp_created": "2021-12-16T20:50:49.847379Z",
    "pulp_href": "/pulp/api/v3/tasks/d24dd8ec-bbfa-4bf8-8950-ac905bb27d30/",
    "reserved_resources_record": [
        "/pulp/api/v3/repositories/rpm/rpm/3a731cf5-a48f-4bf2-9aae-cd153cac213e/"
    ],
    "started_at": "2021-12-16T20:50:49.891657Z",
    "state": "failed",
    "task_group": "/pulp/api/v3/task-groups/13d15dcc-0889-4dff-b513-a4e2d580af03/",
    "worker": null
}

[0] https://github.com/pulp/pulpcore/blob/8f74f9098a5c2d393e4bfd3835b99df3de5a913a/pulpcore/exceptions/base.py#L44

Also available in: Atom PDF