Issue #428
closedTask state should be 'error' if import content into a repo fails
Description
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:--:-- 587
% 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 -
{
"_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@ec2-54-220-72-88.eu-west-1.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 bug was cloned from Bugzilla Bug #1096886 +
Updated by cduryee over 8 years ago
This appears to be fixed by bcourt's patch
https://github.com/pulp/pulp_rpm/pull/491
+ This comment was cloned from Bugzilla #1096886 comment 1 +
Updated by rbarlow over 8 years ago
This was fixed in pulp-2.4.0-0.19.beta.
+ This comment was cloned from Bugzilla #1096886 comment 2 +
Updated by ipanova@redhat.com over 8 years ago
- 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:--:-- 480
% 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 -
{
"_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@example.com.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'
+ This comment was cloned from Bugzilla #1096886 comment 3 +
Updated by cduryee over 8 years ago
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.
+ This comment was cloned from Bugzilla #1096886 comment 4 +
Updated by ipanova@redhat.com over 8 years ago
It would affect qe automation but we could put 'pass' for 2.4 version.
+ This comment was cloned from Bugzilla #1096886 comment 5 +
Updated by bmbouter over 4 years ago
- Status changed from NEW to CLOSED - WONTFIX
Updated by bmbouter over 4 years ago
- Severity set to 1. Low
Pulp 2 is approaching maintenance mode, and this Pulp 2 ticket is not being actively worked on. As such, it is being closed as WONTFIX. Pulp 2 is still accepting contributions though, so if you want to contribute a fix for this ticket, please reopen or comment on it. If you don't have permissions to reopen this ticket, or you want to discuss an issue, please reach out via the developer mailing list.