Division by zero error from "summarize_build_stats"
Reported by
jrbarnette@chromium.org,
Jun 8 2017
|
|||||
Issue description
If you run this command:
bin/summarize_build_stats --past-week --end-date 2017-06-02
The command fails with the following exception:
11:27:34: INFO: Running cidb query on pid 19716, repr(query) starts with <sqlalchemy.sql.selectable.Select at 0x7f3da66e8710; Select object>
11:27:34: INFO: No runs included.
summarize_build_stats: Unhandled exception:
Traceback (most recent call last):
File "bin/summarize_build_stats", line 93, in <module>
main()
File "bin/summarize_build_stats", line 29, in main
wrapper.DoMain()
File "/usr/local/google/home/jrbarnette/repos/cros.b/chromite/scripts/wrapper.py", line 164, in DoMain
commandline.ScriptWrapperMain(FindTarget)
File "/usr/local/google/home/jrbarnette/repos/cros.b/chromite/lib/commandline.py", line 837, in ScriptWrapperMain
ret = target(argv[1:])
File "/usr/local/google/home/jrbarnette/repos/cros.b/chromite/scripts/summarize_build_stats.py", line 811, in main
options.bad_patch_candidates)
File "/usr/local/google/home/jrbarnette/repos/cros.b/chromite/scripts/summarize_build_stats.py", line 251, in Summarize
return self.SummarizeCQ(bad_patch_candidates=bad_patch_candidates)
File "/usr/local/google/home/jrbarnette/repos/cros.b/chromite/scripts/summarize_build_stats.py", line 331, in SummarizeCQ
false_rejection_count)
File "/usr/local/google/home/jrbarnette/repos/cros.b/chromite/scripts/summarize_build_stats.py", line 216, in FalseRejectionRate
rejection_count * 100. / (rejection_count + good_patch_count)
ZeroDivisionError: float division by zero
,
Jun 9 2017
,
Jun 9 2017
I run "bin/summarize_build_stats --past-week --end-date 2017-06-02 --cred-dir ~/cidb_creds/prod_cidb_gen2_readonly/" and it works fine for me. I think you were using the old cidb-creds connecting to the old cidb instance which has been abandoned. Please delete ".cache/cidb_creds" or explicitly pass in the path to the new cidb_cred dir.
,
Jun 9 2017
,
Jun 9 2017
I've confirmed that the problem is credentials, in that I can download correct credentials and use them with the --cred-dir option. However, I'm unable to explain why the default credentials aren't working... I suspect xixuan@ can offer up some additional understanding.
,
Jun 9 2017
OK. Adding some clarification regarding the nature of the failure: * The credentials under "prod_cidb_gen2_readonly" work. * The credentials under "prod_replica_cidb_gen2_readonly" don't work.
,
Jun 9 2017
From the very beginning of go/cros-cidb-admin (I just added a section days ago), it explains that if you want your tool work, an essential step is to add your IP to the restricted network of the corresponding cidb instance. Why "prod_cidb_gen2_readonly" work? Answer: I add a mtv-related IP "104.132.0.0/16" to the restricted network of cidb-gen2, which should cover Richard's IP. Why "prod_replica_cidb_gen2_readonly" don't work? Answer: I don't add any non-personal IP to the restricted network of cidb-gen2-replica2. Short-term solution: I add "104.132.0.0/16" to cidb-gen2-replica2, so that anyone in our group's able to connect to it. Please have a retry? Long-term solution: We should remove the IP-based connection method, and instead, use some group-based connection method.
,
Jun 9 2017
> Short-term solution: > I add "104.132.0.0/16" to cidb-gen2-replica2, so that anyone in our group's able to connect to it. Please have a retry? That seems to have done it. The command now works right out of the box.
,
Jun 19 2017
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by jrbarnette@chromium.org
, Jun 9 2017