On Tue, Feb 2, 2016 at 10:18 AM, sebb <seb...@gmail.com> wrote: > One of the reporter scripts failed. > > Turns out that the public_ldap_people.json file was empty except for > the top-level dict: > > { > "people": { > } > } > > That should not happen. > > Here is the listing of the cached files: > > -rw-rw-r-- 1 www-data www-data 82234 Jan 30 00:32 > public_ldap_committees.json > -rw-rw-r-- 1 www-data www-data 13254 Feb 1 19:38 public_nonldap_groups.json > -rw-rw-r-- 1 www-data www-data 267146 Feb 1 19:51 public_ldap_groups.json > -rw-rw-r-- 1 www-data www-data 423795 Feb 1 20:45 committee-info.json > -rw-rw-r-- 1 www-data www-data 22 Feb 2 11:49 public_ldap_people.json > > The file was fetched as per the following log entries: > > Reading https://whimsy.apache.org/public/public_ldap_people.json > File public_ldap_people.json exists and check interval is zero > https://whimsy.apache.org/public/public_ldap_people.json > {'If-Modified-Since': 'Mon, 01 Feb 2016 17:19:03 GMT'} > STATUS 200 > Date: Tue, 02 Feb 2016 12:00:11 GMT > Server: Apache/2.4.7 (Ubuntu) > Strict-Transport-Security: max-age=63072000; includeSubdomains; preload > Last-Modified: Tue, 02 Feb 2016 11:49:08 GMT > ETag: "16-52ac816dbfbe2" > Accept-Ranges: bytes > Content-Length: 22 > Access-Control-Allow-Origin: * > Content-Type: application/json; charset=utf-8 > Via: 1.1 whimsy.apache.org > Via: 1.1 whimsy.apache.org > Connection: close > > So it looks as though the file was fetched correctly. > > But how was it generated with no useful content?
It looks like the following returned an empty list: https://github.com/apache/whimsy/blob/master/www/roster/public_ldap_people.rb#L25 ... which means that the following returned an empty list: https://github.com/apache/whimsy/blob/master/lib/whimsy/asf/ldap.rb#L266 ... which means that the following returned an empty list: https://github.com/apache/whimsy/blob/master/lib/whimsy/asf/ldap.rb#L129 And that code looks problematic. The first thing I would suggest would be to remove the begin/rescue/return []/end lines, allowing whatever LDAP error occurs to bubble up. It may turn out that there are errors that may be worth retrying (e.g. LDAP server goes down, try reconnecting). If so, a much more focused rescue clause could be re-added. > Unfortunately the Whimsy log files are not kept for any length of time. There wouldn't be anything in the logs. If, however, the exception weren't captured, that would be logged, and that result would trigger an email. - Sam Ruby