DocNow / diffengine

track changes to the news, where news is anything with an RSS feed
MIT License
177 stars 30 forks source link

Occasional WebDriverExceptions raised from _generate_diff_images #26

Open ryanfb opened 7 years ago

ryanfb commented 7 years ago
Traceback (most recent call last):
  File "/usr/local/bin/diffengine", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/diffengine/__init__.py", line 460, in main
    version = entry.get_latest()
  File "/usr/local/lib/python3.6/site-packages/diffengine/__init__.py", line 175, in get_latest
    diff.generate()
  File "/usr/local/lib/python3.6/site-packages/diffengine/__init__.py", line 271, in generate
    self._generate_diff_images()
  File "/usr/local/lib/python3.6/site-packages/diffengine/__init__.py", line 297, in _generate_diff_images
    self.browser = webdriver.PhantomJS(phantomjs)
  File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 52, in __init__
    self.service.start()
  File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 102, in start
    raise WebDriverException("Can not connect to the Service %s" % self.path)
selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service phantomjs

https://github.com/DocNow/diffengine/blob/master/diffengine/__init__.py#L297

Maybe we should catch this and retry after waiting? Not sure exactly what's causing it (and if retrying would help or not).

edsu commented 7 years ago

I see some people reporting errors like this with the phantomjs that's in apt on Ubuntu. Does installing the binary somewhere and setting the path explicitly in your diffengine config help?