New issue
Advanced search Search tips

Issue 865385 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 20
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

WPT-NOTIFY failing with status 400 "Message IssueWrapper is missing required field projectId"

Project Member Reported by foolip@chromium.org, Jul 19

Issue description

This has happened on the two most recent imports:
https://ci.chromium.org/buildbot/chromium.infra.cron/wpt-importer/21542
https://ci.chromium.org/buildbot/chromium.infra.cron/wpt-importer/21543

Log excerpt:

2018-07-19 00:12:05,597 - WPT-NOTIFY enabled in this directory; adding the bug to the pending list.
2018-07-19 00:12:05,597 - Filing 1 bugs in the pending list to Monorail
2018-07-19 00:12:06,418 - URL being requested: GET https://monorail-prod.appspot.com/_ah/api/discovery/v1/apis/monorail/v1/rest
2018-07-19 00:12:06,676 - URL being requested: POST https://monorail-prod.appspot.com/_ah/api/monorail/v1/projects/chromium/issues?alt=json
2018-07-19 00:12:06,676 - Attempting refresh to obtain initial access_token
2018-07-19 00:12:06,712 - Refreshing access_token
Traceback (most recent call last):
  File "/b/rr/tmpBKCdP2/w/src/third_party/blink/tools/wpt_import.py", line 27, in <module>
    main()
  File "/b/rr/tmpBKCdP2/w/src/third_party/blink/tools/wpt_import.py", line 20, in main
    host.exit(importer.main())
  File "/b/rr/tmpBKCdP2/w/src/third_party/blink/tools/blinkpy/w3c/test_importer.py", line 179, in main
    if not self.send_notifications(local_wpt, options.auto_file_bugs, options.monorail_auth_json):
  File "/b/rr/tmpBKCdP2/w/src/third_party/blink/tools/blinkpy/w3c/test_importer.py", line 654, in send_notifications
    dry_run=not auto_file_bugs, service_account_key_json=monorail_auth_json)
  File "/b/rr/tmpBKCdP2/w/src/third_party/blink/tools/blinkpy/w3c/import_notifier.py", line 73, in main
    self.file_bugs(bugs, dry_run, service_account_key_json)
  File "/b/rr/tmpBKCdP2/w/src/third_party/blink/tools/blinkpy/w3c/import_notifier.py", line 264, in file_bugs
    response = api.insert_issue(bug)
  File "/b/rr/tmpBKCdP2/w/src/third_party/blink/tools/blinkpy/w3c/monorail.py", line 136, in insert_issue
    return self.api.issues().insert(projectId=issue.project_id, body=body).execute()
  File "/b/c/vpython/bafdb7/lib/python2.7/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/b/c/vpython/bafdb7/lib/python2.7/site-packages/googleapiclient/http.py", line 840, in execute
    raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://monorail-prod.appspot.com/_ah/api/monorail/v1/projects/chromium/issues?alt=json returned "Message IssueWrapper is missing required field projectId">
step returned non-zero exit code: 1

So, problem is somewhere around here:
https://cs.chromium.org/chromium/src/third_party/blink/tools/blinkpy/w3c/import_notifier.py?l=264&rcl=005a38c514d592f32765d8b9292336b2f6e27e31

Note that the imports still succeeded, but no bugs were filed. Possibly those should be manually filed.
 
Found https://chromium.googlesource.com/infra/infra//+/1a330c651aa58225cb747758f604061241db5d50 by searching for the error.

So, probably the fix is to just set issue.project_id somewhere.
Cc: jrobbins@chromium.org
Status: Started (was: Assigned)
Following some internal discussions, it seems the root cause is Monorail upgrading to Endpoints webapp2 adapter. "projectId" now becomes a required field when creating issues.

cc jrobbins who can correct me if I'm wrong.

Meanwhile, I'm working on a fix.
Yes, I believe that is the right cause and the right fix.
Manually filed all missing issues as of build #21544.
Project Member

Comment 5 by bugdroid1@chromium.org, Jul 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0caf564df1405f72ef5ca9191622bd624d336512

commit 0caf564df1405f72ef5ca9191622bd624d336512
Author: Robert Ma <robertma@chromium.org>
Date: Fri Jul 20 09:15:58 2018

[blinkpy] Fix Monorail wrapper after API update

Monorail is now using Endpoints v2, which requires projectId to also be
set in issue bodies.

This is basically the same fix as:
https://chromium.googlesource.com/infra/infra//+/1a330c651aa58225cb747758f604061241db5d50%5E%21/#F0

Bug:  865385 
Change-Id: I831203dede9e3c8112bee2d84d85f2555acb7cc8
Reviewed-on: https://chromium-review.googlesource.com/1144183
Commit-Queue: Philip Jägenstedt <foolip@chromium.org>
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576816}
[modify] https://crrev.com/0caf564df1405f72ef5ca9191622bd624d336512/third_party/blink/tools/blinkpy/w3c/monorail.py
[modify] https://crrev.com/0caf564df1405f72ef5ca9191622bd624d336512/third_party/blink/tools/blinkpy/w3c/monorail_unittest.py

Status: Fixed (was: Started)
The issue should be fixed now. I also confirmed there was no bug that I needed to manually file after #21544.

Sign in to add a comment