mozilla / ssh_scan_api

An API for ssh_scan (https://github.com/mozilla/ssh_scan) and the backend API service for the Mozilla SSH Observatory (https://observatory.mozilla.org/)
31 stars 12 forks source link

NoMethod bug in ALPHA postgres port #122

Closed claudijd closed 6 years ago

claudijd commented 6 years ago

api_1 | 172.19.0.1 - - [16/Jan/2018:15:47:19 +0000] "GET /api/v1/scan/results?uuid=ee8a66e7-4d4b-410b-9eda-aa49d6ce22d1 HTTP/1.1" 200 18 0.0015 api_1 | 2018-01-16 15:47:19 - NoMethodError - undefined method +' for nil:NilClass: api_1 | /app/lib/ssh_scan_api/database/postgres.rb:147:inblock in grade_report' api_1 | /app/lib/ssh_scan_api/database/postgres.rb:146:in each' api_1 | /app/lib/ssh_scan_api/database/postgres.rb:146:ingrade_report' api_1 | /app/lib/ssh_scan_api/database.rb:65:in grade_report' api_1 | /app/lib/ssh_scan_api/api.rb:212:inblock (2 levels) in '

Note that this only affects https://github.com/mozilla/ssh_scan_api/pull/121

claudijd commented 6 years ago

Repro Steps

1.) Stand up a docker-based infra 2.) run a scan end-to-end 3.) then visit the /api/v1/stats route and get an "internal error", which is the result of this exception

claudijd commented 6 years ago

Fixed in https://github.com/mozilla/ssh_scan_api/pull/121/commits/34e0fbe06083248c7764c72c909e42d272ea228a