Browse Source

workaround boto urlopen error

2018-11-03 11:57:18 [boto] ERROR: Caught exception reading instance data
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/boto/utils.py", line 210, in retry_url
    r = opener.open(req, timeout=timeout)
  File "/usr/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1228, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1198, in do_open
    raise URLError(err)
URLError: <urlopen error timed out>
Fabian Peter Hammerle 5 years ago
parent
commit
30e4f92c07
1 changed files with 7 additions and 0 deletions
  1. 7 0
      ping.py

+ 7 - 0
ping.py

@@ -5,8 +5,15 @@ from scrapy.spiders import CrawlSpider, Rule
 
 
 class PingSpider(CrawlSpider):
+
     name = 'ping'
 
+    custom_settings = {
+        # WORKAROUND
+        # [boto] ERROR: Unable to read instance data, giving up
+        'DOWNLOAD_HANDLERS': {'s3': None},
+    }
+
     def __init__(self, start_url):
         self.start_urls = [start_url]
         self.rules = (