Tricium JS errors in gerrit-review |
|||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36 Steps to reproduce the problem: Go to a change on gerrit-review.googlesource.com (I was logged in on a change I own with this trace) https://gerrit-review.googlesource.com/c/gerrit/+/165452 What is the expected behavior? What went wrong? Failed to load resource: the server responded with a status of 404 () tricium-dev.appspot.com/prpc/tricium.Tricium/Progress Failed to load resource: the server responded with a status of 404 () gr-app.js:1421 [dom-repeat::dom-repeat]: expected array for `items`, found Object _logger @ gr-app.js:1421 tricium-view.js:117 TypeError: results.every is not a function at HTMLElement._isDone (tricium-view.js:157) at HTMLElement._update (tricium-view.js:138) at $.client.getProgress.then (tricium-view.js:113) at <anonymous> $.client.getProgress.then.catch @ tricium-view.js:117 /accounts/self/oauthconfig Failed to load resource: the server responded with a status of 404 () tricium-dev.appspot.com/prpc/tricium.Tricium/Progress Failed to load resource: the server responded with a status of 404 () gr-app.js:1421 [dom-repeat::dom-repeat]: expected array for `items`, found Object _logger @ gr-app.js:1421 tricium-view.js:117 TypeError: results.every is not a function at HTMLElement._isDone (tricium-view.js:157) at HTMLElement._update (tricium-view.js:138) at $.client.getProgress.then (tricium-view.js:113) at <anonymous> $.client.getProgress.then.catch @ tricium-view.js:117 gr-app.js:1917 GET https://gerrit-review.googlesource.com/accounts/self/oauthconfig 404 () _fetchWithXsrfToken @ gr-app.js:1917 fetch @ gr-app.js:1916 send @ gr-app.js:1987 GrPluginRestApi.fetch @ gr-app.js:2649 GrPluginRestApi.send @ gr-app.js:2649 GrPluginRestApi.get @ gr-app.js:2650 _getOAuthConfig @ tricium-client.js:290 Promise.then @ tricium-client.js:261 Promise.then (async) plugin.restApi.getLoggedIn.then @ tricium-client.js:260 Promise.then (async) _configureOAuthLibrary @ tricium-client.js:245 getOAuthToken @ tricium-client.js:50 _refreshProgress @ tricium-view.js:110 _updateTimerFired @ tricium-view.js:176 Progress:1 POST https://tricium-dev.appspot.com/prpc/tricium.Tricium/Progress 404 () gr-app.js:1421 [dom-repeat::dom-repeat]: expected array for `items`, found {} _logger @ gr-app.js:1421 _error @ gr-app.js:1421 _itemsChanged @ gr-app.js:1781 _complexObserverEffect @ gr-app.js:1617 _effectEffects @ gr-app.js:1609 _propertySetter @ gr-app.js:1608 __setProperty @ gr-app.js:1608 __setPropertyImpl @ gr-app.js:1759 _applyEffectValue @ gr-app.js:1630 _annotationEffect @ gr-app.js:1615 _effectEffects @ gr-app.js:1609 _propertySetter @ gr-app.js:1608 __setProperty @ gr-app.js:1608 __setPropertyImpl @ gr-app.js:1759 _forwardParentProp @ gr-app.js:1804 (anonymous) @ gr-app.js:1763 _functionEffect @ gr-app.js:1616 _effectEffects @ gr-app.js:1609 _propertySetter @ gr-app.js:1608 __setProperty @ gr-app.js:1608 _applyEffectValue @ gr-app.js:1630 _annotationEffect @ gr-app.js:1615 _effectEffects @ gr-app.js:1609 _propertySetter @ gr-app.js:1608 setter @ gr-app.js:1611 _update @ tricium-view.js:137 $.client.getProgress.then @ tricium-view.js:113 Promise.then (async) $.client.getOAuthToken.then @ tricium-view.js:112 Promise.then (async) _refreshProgress @ tricium-view.js:110 _updateTimerFired @ tricium-view.js:176 tricium-view.js:117 TypeError: results.every is not a function at HTMLElement._isDone (tricium-view.js:157) at HTMLElement._update (tricium-view.js:138) at $.client.getProgress.then (tricium-view.js:113) at <anonymous> $.client.getProgress.then.catch @ tricium-view.js:117 Promise.catch (async) $.client.getOAuthToken.then @ tricium-view.js:114 Promise.then (async) _refreshProgress @ tricium-view.js:110 _updateTimerFired @ tricium-view.js:176 gr-app.js:1917 GET https://gerrit-review.googlesource.com/accounts/self/oauthconfig 404 () _fetchWithXsrfToken @ gr-app.js:1917 fetch @ gr-app.js:1916 send @ gr-app.js:1987 GrPluginRestApi.fetch @ gr-app.js:2649 GrPluginRestApi.send @ gr-app.js:2649 GrPluginRestApi.get @ gr-app.js:2650 _getOAuthConfig @ tricium-client.js:290 Promise.then @ tricium-client.js:261 Promise.then (async) plugin.restApi.getLoggedIn.then @ tricium-client.js:260 Promise.then (async) _configureOAuthLibrary @ tricium-client.js:245 getOAuthToken @ tricium-client.js:50 _refreshProgress @ tricium-view.js:110 _updateTimerFired @ tricium-view.js:176 setTimeout (async) $.client.getProgress.then.catch.then @ tricium-view.js:121 Promise.then (async) $.client.getOAuthToken.then @ tricium-view.js:118 Promise.then (async) _refreshProgress @ tricium-view.js:110 _updateTimerFired @ tricium-view.js:176 Progress:1 POST https://tricium-dev.appspot.com/prpc/tricium.Tricium/Progress 404 () gr-app.js:1421 [dom-repeat::dom-repeat]: expected array for `items`, found {} _logger @ gr-app.js:1421 _error @ gr-app.js:1421 _itemsChanged @ gr-app.js:1781 _complexObserverEffect @ gr-app.js:1617 _effectEffects @ gr-app.js:1609 _propertySetter @ gr-app.js:1608 __setProperty @ gr-app.js:1608 __setPropertyImpl @ gr-app.js:1759 _applyEffectValue @ gr-app.js:1630 _annotationEffect @ gr-app.js:1615 _effectEffects @ gr-app.js:1609 _propertySetter @ gr-app.js:1608 __setProperty @ gr-app.js:1608 __setPropertyImpl @ gr-app.js:1759 _forwardParentProp @ gr-app.js:1804 (anonymous) @ gr-app.js:1763 _functionEffect @ gr-app.js:1616 _effectEffects @ gr-app.js:1609 _propertySetter @ gr-app.js:1608 __setProperty @ gr-app.js:1608 _applyEffectValue @ gr-app.js:1630 _annotationEffect @ gr-app.js:1615 _effectEffects @ gr-app.js:1609 _propertySetter @ gr-app.js:1608 setter @ gr-app.js:1611 _update @ tricium-view.js:137 $.client.getProgress.then @ tricium-view.js:113 Promise.then (async) $.client.getOAuthToken.then @ tricium-view.js:112 Promise.then (async) _refreshProgress @ tricium-view.js:110 _updateTimerFired @ tricium-view.js:176 setTimeout (async) $.client.getProgress.then.catch.then @ tricium-view.js:121 Promise.then (async) $.client.getOAuthToken.then @ tricium-view.js:118 Promise.then (async) _refreshProgress @ tricium-view.js:110 _updateTimerFired @ tricium-view.js:176 tricium-view.js:117 TypeError: results.every is not a function at HTMLElement._isDone (tricium-view.js:157) at HTMLElement._update (tricium-view.js:138) at $.client.getProgress.then (tricium-view.js:113) at <anonymous> Did this work before? N/A Chrome version: 64.0.3282.186 Channel: n/a OS Version: OS X 10.13.3 Flash Version:
,
Mar 13 2018
,
Mar 14 2018
,
Mar 14 2018
The issue seems to be out of TE-scope as it is related to Infra>Codereview>Gerrit. Hence, adding label TE-NeedsTriageHelp for further investigation from dev team. Thanks...!!
,
Mar 14 2018
Thanks for taking a look, we've got this one. Assigning to Quinten, the owner of the tricium plugin.
,
Mar 14 2018
Thanks for filing and triaging! First and most obvious thing is the error with `results.every` being called when `results` is an Object rather than an Array. This could have been introduced several weeks ago in https://chromium-review.googlesource.com/c/909994/ and I didn't notice til enabling the plugin with Gerrit. Not sure yet if gr-app.js:1421 [dom-repeat::dom-repeat]: expected array for `items`, found Object is a separate issue.
,
Mar 14 2018
,
Mar 15 2018
The following revision refers to this bug: https://chromium.googlesource.com/infra/gerrit-plugins/tricium/+/ad3a3ed9783f2819d2f1bf3a3c3df17bd086d3bf commit ad3a3ed9783f2819d2f1bf3a3c3df17bd086d3bf Author: Quinten Yearsley <qyearsley@chromium.org> Date: Thu Mar 15 15:48:22 2018 Fix empty results from getProgress so it is Array When changing the behavior for tricium-client getProgress so that it returns an empty result in the case of 404, I got the type of result wrong; it should be an Array. This fixes that and also updates a couple of comments. Bug: 821506 Change-Id: I089801fcfdd6808146ebad5310ebcc3242cb6793 Reviewed-on: https://chromium-review.googlesource.com/963485 Reviewed-by: Edwin Kempin <ekempin@google.com> [modify] https://crrev.com/ad3a3ed9783f2819d2f1bf3a3c3df17bd086d3bf/test/tricium-client_test.html [modify] https://crrev.com/ad3a3ed9783f2819d2f1bf3a3c3df17bd086d3bf/src/main/resources/static/tricium-client.js [modify] https://crrev.com/ad3a3ed9783f2819d2f1bf3a3c3df17bd086d3bf/src/main/resources/static/tricium-view.js
,
Mar 20 2018
The errors mentioned in #6 (error when calling results.every with {}, and dom-repeat error) are now resolved with the latest deployed version.
There is still a problem with the Tricium plugin in gerrit-review though:
gr-app.js:1918 GET https://gerrit-review.googlesource.com/accounts/self/oauthconfig 404 ()
_fetchWithXsrfToken @ gr-app.js:1918
fetch @ gr-app.js:1917
...
_getOAuthConfig @ tricium-client.js:292
...
getOAuthToken @ tricium-client.js:50
_refreshProgress @ tricium-view.js:110
_updateTimerFired @ tricium-view.js:179
It seems like _updateTimerFired is repeatedly firing, causing getOAuthToken to be called, which calls _getOAuthConfig, which fails, but getOAuthToken returns a resolved progress anyway, and then getProgress is called, which does work.
A couple things should change here.
1. Apparently setting up _getOAuthConfig isn't necessarily currently for getting Tricium Progress;
If _getOAuthConfig isn't necessary, we shouldn't need to call it.
2. Also, _updateTimerFired doesn't need to keep firing once all analyzers are finished.
https://chromium.googlesource.com/infra/gerrit-plugins/tricium/+/master/src/main/resources/static/tricium-client.js
,
Mar 28 2018
Update: now the googleoauth plugin has been activated, but now the Tricium plugin isn't showing up at all on the gerrit host. After digging in a bit, I noticed that _refreshToken in the client element is never resolving, because gapi.auth.authorize is not returning any kind of token. When I searched for documentation about this, I found that gapi.auth isn't really supported. Filed bug 826834 .
,
Apr 13 2018
Logged errors resolved now. |
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by wyatta@google.com
, Mar 13 2018