Bug 1104148 - Task created for the import upload into a repo cannot handle properly exceptions
Summary: Task created for the import upload into a repo cannot handle properly exceptions
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Pulp
Classification: Retired
Component: API/integration
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: pulp-bugs
QA Contact: pulp-qe-list
URL:
Whiteboard:
Depends On: 1104106
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-03 11:37 UTC by Ina Panova
Modified: 2014-06-06 10:03 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-06 10:03:10 UTC
Embargoed:


Attachments (Terms of Use)

Description Ina Panova 2014-06-03 11:37:35 UTC
Description of problem:
Task created for the import upload into a repo cannot handle properly exceptions.
$ curl -H "Accept: application/json" -X GET -k -u admin:admin 'https://example.com/pulp/api/v2/tasks/5f8aa1f1-5d77-408b-8d6f-822afaa38cf5/'|python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1658  100  1658    0     0   1583      0  0:00:01  0:00:01 --:--:--  1585
{
    "_href": "/pulp/api/v2/tasks/5f8aa1f1-5d77-408b-8d6f-822afaa38cf5/",
    "_id": {
        "$oid": "538d98df0c759879a2927ae1"
    },
    "_ns": "task_status",
    "error": {
        "code": "PLP0000",
        "data": {},
        "description": "Pulp exception occurred: PulpExecutionException",
        "sub_errors": []
    },
    "exception": null,
    "finish_time": "2014-06-03T09:43:59Z",
    "id": "538d98df591d260bedb7bbbd",
    "progress_report": {},
    "queue": "reserved_resource_worker-0.dq",
    "result": null,
    "spawned_tasks": [],
    "start_time": "2014-06-03T09:43:59Z",
    "state": "error",
    "tags": [
        "pulp:repository:isorepo",
        "pulp:action:import_upload"
    ],
    "task_id": "5f8aa1f1-5d77-408b-8d6f-822afaa38cf5",
    "task_type": "pulp.server.managers.content.upload.import_uploaded_unit",
    "traceback": "Traceback (most recent call last):\n  File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 240, in trace_task\n    R = retval = fun(*args, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", line 321, in __call__\n    return super(Task, self).__call__(*args, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 437, in __protected_call__\n    return self.run(*args, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/managers/content/upload.py\", line 223, in import_uploaded_unit\n    unit_metadata, file_path, conduit, call_config)\n  File \"/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/iso/importer.py\", line 120, in upload_unit\n    iso = models.ISO(unit_key['name'], unit_key['size'], unit_key['checksum'])\nPulpExecutionException: Pulp exception occurred: PulpExecutionException\n"
}

$ curl -H "Accept: application/json" -X GET -k -u admin:admin 'https://example.com/pulp/api/v2/tasks/6a3b6aee-3636-4179-be96-f4a66975d669/'|python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1620  100  1620    0     0   1579      0  0:00:01  0:00:01 --:--:--  1582
{
    "_href": "/pulp/api/v2/tasks/6a3b6aee-3636-4179-be96-f4a66975d669/",
    "_id": {
        "$oid": "538d99270c759879a2927ae3"
    },
    "_ns": "task_status",
    "error": {
        "code": "PLP0000",
        "data": {},
        "description": "Invalid unit type for repository",
        "sub_errors": []
    },
    "exception": null,
    "finish_time": "2014-06-03T09:45:11Z",
    "id": "538d9927591d260bedb7bbbe",
    "progress_report": {},
    "queue": "reserved_resource_worker-0.dq",
    "result": null,
    "spawned_tasks": [],
    "start_time": "2014-06-03T09:45:11Z",
    "state": "error",
    "tags": [
        "pulp:repository:rpmrepo",
        "pulp:action:import_upload"
    ],
    "task_id": "6a3b6aee-3636-4179-be96-f4a66975d669",
    "task_type": "pulp.server.managers.content.upload.import_uploaded_unit",
    "traceback": "Traceback (most recent call last):\n  File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 240, in trace_task\n    R = retval = fun(*args, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", line 321, in __call__\n    return super(Task, self).__call__(*args, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 437, in __protected_call__\n    return self.run(*args, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/managers/content/upload.py\", line 195, in import_uploaded_unit\n    ContentUploadManager.is_valid_upload(repo_id, unit_type_id)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/managers/content/upload.py\", line 164, in is_valid_upload\n    raise PulpDataException('Invalid unit type for repository')\nPulpDataException: Invalid unit type for repository\n"
}

Version-Release number of selected component (if applicable):
2.4.0-0.19.beta

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
traceback and no http_status

Expected results:
http_status and no traceback

Additional info:

Comment 1 Barnaby Court 2014-06-04 16:33:36 UTC
What http status are you expecting?  It appears that exceptions occurred because of invalid data being passed in.  The information given in the error block shows the information about the exception.  The state of the task is "error" as well.  Is your concern that a traceback was included in the task details returned by the REST call?

Comment 2 Ina Panova 2014-06-06 10:03:10 UTC
I think it's my mistake, I got confused, sorry for the mess. I am closing it as NOTABUG


Note You need to log in before you can comment on or make changes to this bug.