Description of problem: The state of the task created for the import of the uploaded content into the repo is 'finished' regardless error specified in the 'result' $ curl -H "Accept: application/json" -X GET -k -u admin:admin 'https://example.com/pulp/api/v2/tasks/1a6f35ae-9b41-495e-bec0-8315f83a4932/'|python -m json.tool % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 770 100 770 0 0 587 0 0:00:01 0:00:01 --:--:-- 587 { "_href": "/pulp/api/v2/tasks/1a6f35ae-9b41-495e-bec0-8315f83a4932/", "_id": { "$oid": "5370e3fc930c1f4a8635b4dc" }, "_ns": "task_status", "error": null, "exception": null, "finish_time": "2014-05-12T15:08:44Z", "id": "5370e3fcd428846387488552", "progress_report": {}, "queue": "reserved_resource_worker-0.compute.amazonaws.com", "result": { "details": { "errors": [ "metadata for the given package could not be extracted" ] }, "success_flag": false, "summary": "" }, "spawned_tasks": [], "start_time": "2014-05-12T15:08:44Z", "state": "finished", "tags": [ "pulp:repository:m2", "pulp:action:import_upload" ], "task_id": "1a6f35ae-9b41-495e-bec0-8315f83a4932", "task_type": "pulp.server.managers.content.upload.import_uploaded_unit", "traceback": null } Version-Release number of selected component (if applicable): pulp-2.4.0-0.13.beta How reproducible: always Steps to Reproduce: 1. 2. 3. Actual results: task state 'finished', when import fails Expected results: task state 'error', when import fails Additional info:
This appears to be fixed by bcourt's patch https://github.com/pulp/pulp_rpm/pull/491
This was fixed in pulp-2.4.0-0.19.beta.
# pulp-admin -u admin -p admin rpm repo uploads rpm --repo-id m2 --file ~/some.iso +----------------------------------------------------------------------+ Unit Upload +----------------------------------------------------------------------+ Extracting necessary metadata for each request... [==================================================] 100% Analyzing: some.iso ... completed Creating upload requests on the server... [==================================================] 100% Initializing: some.iso ... completed Starting upload of selected units. If this process is stopped through ctrl+c, the uploads will be paused and may be resumed later using the resume command or cancelled entirely using the cancel command. Uploading: some.iso ... completed Importing into the repository... This command may be exited via ctrl+c without affecting the request. [\] Running... Task Failed metadata for the given package could not be extracted Deleting the upload request... ... completed $ curl -H "Accept: application/json" -X GET -k -u admin:admin 'https://example.com/pulp/api/v2/tasks/431dd6bb-aacf-4f7b-98dc-eb5b05d364ec/'|python -m json.tool % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 772 100 772 0 0 480 0 0:00:01 0:00:01 --:--:-- 480 { "_href": "/pulp/api/v2/tasks/431dd6bb-aacf-4f7b-98dc-eb5b05d364ec/", "_id": { "$oid": "538d95920c759879a2927ade" }, "_ns": "task_status", "error": null, "exception": null, "finish_time": "2014-06-03T09:29:54Z", "id": "538d9592591d260beec5f884", "progress_report": {}, "queue": "reserved_resource_worker-0.dq", "result": { "details": { "errors": [ "metadata for the given package could not be extracted" ] }, "success_flag": false, "summary": "" }, "spawned_tasks": [], "start_time": "2014-06-03T09:29:54Z", "state": "finished", "tags": [ "pulp:repository:m2", "pulp:action:import_upload" ], "task_id": "431dd6bb-aacf-4f7b-98dc-eb5b05d364ec", "task_type": "pulp.server.managers.content.upload.import_uploaded_unit", "traceback": null } State of the task is still 'finished' instead of 'error'
We can change the task state, but not for pulp 2.4. Moving to medium/no release. We could also add additional checks to was_successful() in pulp/bindings/responses.py but I think it would be better to just fix it in the json result.
It would affect qe automation but we could put 'pass' for 2.4 version.
Moved to https://pulp.plan.io/issues/428