Story #1019

Add ScheduleID to Tasks spawned by schedulers

Added by about 5 years ago. Updated about 2 months ago.

Start date:
Due date:
% Done:


Estimated time:
Platform Release:
Sprint Candidate:
Pulp 2


At the moment, one can't link schedule-spawned tasks to their particular schedule.
As a result, one can't tell easily whether e.g. scheduled unit install works or whether to delete/reconfigure it because of a malformed unit key.
This makes it difficult for automated tests (or other API consumer) to check spawned tasks progress/status explicitly.
I therefore suggest adding a link from the spawned task back to the scheduler object instance (another tag possibly).

Scheduled regular Unit installation object
[root@ip-172-31-20-145 ~]# curl -k https://admin:admin@localhost/pulp/api/v2/consumers/SimpleScheduledInstall_consumer/schedules/content/install/ | python -mjson.tool

        "_href": "/pulp/api/v2/consumers/SimpleScheduledInstall_consumer/schedules/content/install/556863872bcb1c2d440c0ef1/", 
        "_id": "556863872bcb1c2d440c0ef1", 
        "args": [
        "consecutive_failures": 0, 
        "enabled": true, 
        "failure_threshold": 3, 
        "first_run": "2015-05-29T13:03:03Z", 
        "kwargs": {
            "options": null, 
            "units": [
                    "type_id": "rpm", 
                    "unit_key": "pike"
        "last_run_at": "2015-05-29T14:07:03Z", 
        "last_updated": 1432904583.9740551, 
        "next_run": "2015-05-29T14:08:03Z", 
        "options": null, 
        "remaining_runs": null, 
        "resource": "pulp:consumer:SimpleScheduledInstall_consumer", 
        "schedule": "PT1M", 
        "task": "pulp.server.tasks.consumer.install_content", 
        "total_run_count": 65, 
        "units": [
                "type_id": "rpm", 
                "unit_key": "pike"

Task spawned by the scheduler to install the unit, failing because of malformed unit key
curl -k https://admin:admin@localhost/pulp/api/v2/tasks/ | python -mjson.tool | less

        "_href": "/pulp/api/v2/tasks/9cbab540-9a1b-4636-b8f6-5928456eeac1/", 
        "_id": {
            "$oid": "55681cb92bcb1c238ad7a30e"
        "_ns": "task_status", 
        "error": null, 
        "exception": null, 
        "finish_time": "2015-05-29T08:00:57Z", 
        "id": "55681cb92bcb1c238ad7a30e", 
        "progress_report": null, 
        "result": null, 
        "spawned_tasks": [], 
        "start_time": "2015-05-29T08:00:57Z", 
        "state": "error", 
        "tags": [
        "task_id": "9cbab540-9a1b-4636-b8f6-5928456eeac1", 
        "task_type": null, 
        "traceback": "Traceback (most recent call last):\n  File \"/home/mkovacik/src/pulp-automation/pulp_auto/\", line 137, in __call__\n    response = self.request_to_call(self.module, request, self.PROFILE)()\n  File \"/home/mkovacik/src/pulp-automation/pulp_auto/\", line 118, in <lambda>\n    **dict(list(request['kws'].viewitems()) + [('PROFILE', PROFILE)])\n  File \"/home/mkovacik/src/pulp-automation/pulp_auto/handler/\", line 19, in logged_wrapper\n    ret = method(self, *args, **kvs)\n  File \"/home/mkovacik/src/pulp-automation/pulp_auto/handler/\", line 47, in wrapped_method\n    units\n  File \"/home/mkovacik/src/pulp-automation/pulp_auto/handler/\", line 45, in <lambda>\n    PROFILE\n  File \"/home/mkovacik/src/pulp-automation/pulp_auto/handler/\", line 29, in install\n, PROFILE)\n  File \"/home/mkovacik/src/pulp-automation/pulp_auto/handler/\", line 46, in store\n    if Rpm.list(unit, PROFILE) == []:\n  File \"/home/mkovacik/src/pulp-automation/pulp_auto/handler/\", line 34, in list\n    nevra = Rpm.unit_to_nevra(unit)\n  File \"/home/mkovacik/src/pulp-automation/pulp_auto/handler/\", line 14, in unit_to_nevra\n    'name':,\nAttributeError: 'unicode' object has no attribute 'name'\n", 
        "worker_name": "agent"


#1 Updated by bmbouter over 1 year ago

  • Status changed from NEW to CLOSED - WONTFIX

#2 Updated by bmbouter over 1 year ago

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.

#3 Updated by bmbouter over 1 year ago

  • Tags Pulp 2 added

#4 Updated by bmbouter about 2 months ago

  • Category deleted (14)

We are removing the 'API' category per open floor discussion June 16, 2020.

Please register to edit this issue

Also available in: Atom PDF