New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 801486 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 801440
Owner:
Last visit > 30 days ago
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

TypeError in risk_report.py: risks[top_key] is dict, not float

Project Member Reported by hiroh@chromium.org, Jan 12 2018

Issue description

Sometimes TypeError occurred in risk_report.py in CQ.
The stack trace is the below.

https://luci-milo.appspot.com/buildbot/chromeos/master-paladin/17465

19:49:59: ERROR: Traceback (most recent call last):
  File "/b/c/cbuild/repository/chromite/cbuildbot/stages/generic_stages.py", line 701, in Run
    self.PerformStage()
  File "/b/c/cbuild/repository/chromite/cbuildbot/stages/report_stages.py", line 1050, in PerformStage
    logging.PrintBuildbotStepText(risk_report.CLRiskText(build_id))
  File "/b/c/cbuild/repository/chromite/lib/risk_report.py", line 41, in CLRiskText
    top_risky = _TopRisky(risks)
  File "/b/c/cbuild/repository/chromite/lib/risk_report.py", line 71, in _TopRisky
    cl: risk for cl, risk in risks.iteritems()
  File "/b/c/cbuild/repository/chromite/lib/risk_report.py", line 72, in <dictcomp>
    if risk >= risks[top_key] * _CLOSE_TO_TOP_RATIO
TypeError: unsupported operand type(s) for *: 'dict' and 'float'

risk_report.py downloads a json file and read it to risks.
https://chromiumos-cl-scanner.appspot.com/external/risk/build/2205039

{
  "cls": {
    "681656": 0.0030543117260210047, 
    "757122": 0.00057718521861042232, 
    "782262": 0.00099129762934017907, 
    "806446": 0.00042256544195190684, 
    "807387": 0.00042197354935494388, 
    "807388": 0.00038750067560751252, 
....
        "862528": 0.0019327867218385426, 
    "862733": 0.00057703076762472146, 
    "862985": 0.0035788246155504812
  }
}


top_key is "cls" and thus it returns dict.
I guess json format in the site was changed but risk_report.py didn't correspond the format.
I guess why it's successful sometimes, is there is a case which risk_report.py doesn't execute.

 

Comment 1 by hiroh@chromium.org, Jan 12 2018

Summary: TypeError in risk_report.py: risks[top_key] is dict, not float (was: risk_report.py)
Components: Infra>Client>ChromeOS
Status: Assigned (was: Untriaged)
Labels: -Pri-0 Pri-1
Downgrading:  The cited build rejected no CLs, and was even listed
green in the CQ annotator (but not elsewhere).  So, the CQ is working
despite the problems.

Comment 4 by pho...@chromium.org, Jan 12 2018

Mergedinto: 801440
Status: Duplicate (was: Assigned)
Yeah, I saw this problem in build that originally submitted the problematic change. I've TBR'd a fix.

Sign in to add a comment