Closed Bug 1316961 Opened 3 years ago Closed 3 years ago

Action task - Add new jobs - KeyError: u"no such parameter u'decision_id'"

Categories

(Taskcluster :: General, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla53

People

(Reporter: armenzg, Assigned: bstack)

References

Details

Attachments

(2 files)

Kwierso point out to me that he could not add new jobs on try.
I think there is a regression on the action task.
> raise KeyError("no such parameter {!r}".format(k))
I can reproduce it locally.

Has anything landed in this area that could have caused this?

We landed something that would test the action task path inside of the gecko decision task:
https://hg.mozilla.org/mozilla-central/rev/d23c6cdd5c37
However, there might be something missing.


[1] https://treeherder.mozilla.org/#/jobs?repo=try&revision=51a2143c32fc32230cc68826a5f160cca96b2931&group_state=expanded&selectedJob=30932639
[2] https://public-artifacts.taskcluster.net/JNdCaHrnTj-_JvJ2-79fqg/0/public/logs/live_backing.log
[3]
[task 2016-11-11T20:50:27.795524Z] + ./mach --log-no-times taskgraph action-task --decision-id=N6ddCHOFR8ifpYBzUXV_tw --task-label=desktop-test-linux64/opt-mochitest-browser-chrome-7,desktop-test-linux64/opt-mochitest-browser-chrome-e10s-7
[task 2016-11-11T20:50:28.278462Z] Traceback (most recent call last):
[task 2016-11-11T20:50:28.278561Z]   File "/home/worker/checkouts/gecko/taskcluster/mach_commands.py", line 187, in taskgraph_action
[task 2016-11-11T20:50:28.278644Z]     return taskgraph.action.taskgraph_action(options)
[task 2016-11-11T20:50:28.278729Z]   File "/home/worker/checkouts/gecko/taskcluster/taskgraph/action.py", line 34, in taskgraph_action
[task 2016-11-11T20:50:28.278797Z]     decision_task_id = parameters['decision_id']
[task 2016-11-11T20:50:28.278895Z]   File "/home/worker/checkouts/gecko/taskcluster/taskgraph/parameters.py", line 52, in __getitem__
[task 2016-11-11T20:50:28.278961Z]     raise KeyError("no such parameter {!r}".format(k))
[task 2016-11-11T20:50:28.279025Z] KeyError: u"no such parameter u'decision_id'"
[taskcluster 2016-11-11 20:50:28.450Z] === Task Finished ===
[taskcluster 2016-11-11 20:50:28.523Z] Unsuccessful task run with exit code: 1 completed in 19.781 seconds
[4]
armenzg@armenzg-thinkpad:~/repos/firefox$ ./mach --log-no-times taskgraph action-task --decision-id=N6ddCHOFR8ifpYBzUXV_tw --task-label=desktop-test-linux64/opt-mochitest-browser-chrome-7,desktop-test-linux64/opt-mochitest-browser-chrome-e10s-7
Traceback (most recent call last):
  File "/home/armenzg/repos/firefox/taskcluster/mach_commands.py", line 187, in taskgraph_action
    return taskgraph.action.taskgraph_action(options)
  File "/home/armenzg/repos/firefox/taskcluster/taskgraph/action.py", line 34, in taskgraph_action
    decision_task_id = parameters['decision_id']
  File "/home/armenzg/repos/firefox/taskcluster/taskgraph/parameters.py", line 52, in __getitem__
    raise KeyError("no such parameter {!r}".format(k))
KeyError: u"no such parameter u'decision_id'"
You've got it.  Also, taskcluster/docs/parameters.rst.
Flags: needinfo?(dustin)
Duplicate of this bug: 1317106
I'm still getting this error @dustin

kalpesh@kalpesh-Inspiron-3542:~/Projects/mozilla-central$ ./mach --log-no-times taskgraph action-task --decision-id=N6ddCHOFR8ifpYBzUXV_tw --task-label=desktop-test-linux64/opt-mochitest-browser-chrome-7,desktop-test-linux64/opt-mochitest-browser-chrome-e10s-7
Starting new HTTPS connection (1): queue.taskcluster.net
"GET /v1/task/N6ddCHOFR8ifpYBzUXV_tw/artifacts/public/full-task-graph.json HTTP/1.1" 303 29
Starting new HTTPS connection (1): public-artifacts.taskcluster.net
"GET /N6ddCHOFR8ifpYBzUXV_tw/0/public/full-task-graph.json HTTP/1.1" 200 5379644
Starting new HTTPS connection (1): queue.taskcluster.net
"GET /v1/task/N6ddCHOFR8ifpYBzUXV_tw/artifacts/public/parameters.yml HTTP/1.1" 303 29
Starting new HTTPS connection (1): public-artifacts.taskcluster.net
"GET /N6ddCHOFR8ifpYBzUXV_tw/0/public/parameters.yml HTTP/1.1" 200 498
Traceback (most recent call last):
  File "/home/kalpesh/Projects/mozilla-central/taskcluster/mach_commands.py", line 187, in taskgraph_action
    return taskgraph.action.taskgraph_action(options)
  File "/home/kalpesh/Projects/mozilla-central/taskcluster/taskgraph/action.py", line 38, in taskgraph_action
    all_tasks, full_task_graph = TaskGraph.from_json(full_task_json)
  File "/home/kalpesh/Projects/mozilla-central/taskcluster/taskgraph/taskgraph.py", line 76, in from_json
    tasks[key] = task_kind.from_json(value)
  File "/home/kalpesh/Projects/mozilla-central/taskcluster/taskgraph/task/docker_image.py", line 115, in from_json
    imgMeta = task_dict['task']['extra']['imageMeta']
KeyError: u'imageMeta'
Flags: needinfo?(dustin)
Comment on attachment 8810225 [details]
Bug 1316961 - Action Tasks, key decision_id added to parameters.py.

https://reviewboard.mozilla.org/r/92576/#review92634

I strongly suspect this try job will fail.  The change that caused this issue basically made all parameters mandatory, on the grounds that we should not be introducing "smart" defaults for parameters since they are not intended to be created by humans.

What that means is that decision tasks will fail because they do not have these two parameters.

Looking at `action.py`, these two values are never actually used as parameters (meaning, passed as `params` to task-generation code).  Instead, it's just used as a dictionary to store these two options.  So probably the better fix is to stop putting those values into a `Parameters` object, since they are not parameters.

::: taskcluster/docs/parameters.rst:106
(Diff revision 1)
> +
> +``decision_id``
> +    The Gecko Decision Task's TaskID for which the action task is running.
> +
> +``task_labels``
> +    A comma seperated list of task labels that are supposed to triggered by the

separated (spelling error)
Attachment #8810225 - Flags: review?(dustin) → review-
Comment on attachment 8810225 [details]
Bug 1316961 - Action Tasks, key decision_id added to parameters.py.

https://reviewboard.mozilla.org/r/92576/#review92634

OK, hm, I can't figure out how that decision task succeeded.  It doesn't have either of the new parameters in parameters.yml.
Besides, when / why was the parameter "task_labels" changed to "task_label"? I feel some more changes might be needed in the action.py code for this to work. There seems to be an inconsistency across the code (action.yml / mach_commands.py have different names)
Indeed, this may need some more attention.  Also, -> jonasfj for the error in comment 5.
Flags: needinfo?(dustin) → needinfo?(jopsen)
Attachment #8810225 - Flags: review?(armenzg)
Assignee: nobody → kalpeshk2011
I will be looking at this.
Assignee: kalpeshk2011 → armenzg
The regression was introduced by bug 1296842
Assignee: armenzg → bstack
This patch is just not passing the decision_id and task_labels options into Parameters as dustin mentioned in comment 6. When run with the mach command in comment 5, it still gets the error about "imageMeta", however that's because the build with decision_id "N6ddCHOFR8ifpYBzUXV_tw" was before "imageMeta" was added to the generation and so when run from an up-to-date checkout, it fails. I expect that if this was run with the task-graph generation from before a week ago, this would now work correctly.
Comment on attachment 8810479 [details]
Bug 1316961 - Fix parameters for action tasks.

https://reviewboard.mozilla.org/r/92778/#review92760
Attachment #8810479 - Flags: review?(dustin) → review+
When I run the action task with

mach --log-no-times taskgraph action-task --decision-id=eE6e8GpYQ3OuSl4G1k0MaA --task-label=desktop-test-linux64/opt-mochitest-browser-chrome-7,desktop-test-linux64/opt-mochitest-browser-chrome-e10s-7

for the build in https://treeherder.mozilla.org/#/jobs?repo=try&revision=17df5cce8aa4&selectedJob=31033601, it gets all the way through to trying to submit, so I think the assumption about the up-to-date checkout is correct.
Flags: needinfo?(jopsen)
Keywords: checkin-needed
Status: NEW → ASSIGNED
Pushed by garndt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/11136ba1976d
Fix parameters for action tasks. r=dustin
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/11136ba1976d
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Whiteboard: [checkin-needed-aurora]
https://hg.mozilla.org/releases/mozilla-aurora/rev/cc2504fa4ce3
Whiteboard: [checkin-needed-aurora]
You need to log in before you can comment on or make changes to this bug.