Opened 4 years ago

Closed 4 years ago

#4784 closed defect (fixed)

Missing error handling in updateMalwareDomainsList

Reported by: ferris Assignee: kvas
Priority: P3 Milestone:
Module: Sitescripts Keywords:
Cc: kvas, jsonesen Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):



Cron <rsync@filtermaster2> python -m sitescripts.subscriptions.bin.updateMalwareDomainsList

How to reproduce

This happens regularly on the filtermasters. I'm guessing it can be reproduced by mocking one of the malwaredomain servers to be down.

Observed behaviour

We're getting these alerts occasionally:

Traceback (most recent call last):
  File "/usr/lib/python2.7/", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/", line 72, in _run_code
    exec code in run_globals
  File "/opt/sitescripts/sitescripts/subscriptions/bin/", line 63, in <module>
    data = try_mirror(mirror)
  File "/opt/sitescripts/sitescripts/subscriptions/bin/", line 40, in try_mirror
    response = urllib2.urlopen(mirror + MALWAREDOMAINS_PATH)
  File "/usr/lib/python2.7/", line 126, in urlopen
    return, data, timeout)
  File "/usr/lib/python2.7/", line 400, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/", line 418, in _open
    '_open', req)
  File "/usr/lib/python2.7/", line 378, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/", line 1207, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/", line 1177, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 110] Connection timed out>

Expected behaviour

I'd expect this error to be caught, and that the next malwaredomain server would be attempted.

In case all the mirrors are failing, it would also be good to get the reasons why, instead of just a message saying 'Unable to fetch malware domains list.'.

Change History (4)

comment:1 Changed 4 years ago by kvas

  • Owner set to kvas
  • Priority changed from Unknown to P3
  • Ready set

comment:2 Changed 4 years ago by kvas

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:4 Changed 4 years ago by kvas

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.