nhanb / pytaku-old-gae

[DEFUNCT] Online manga reader
GNU General Public License v3.0
15 stars 4 forks source link

IncompleteRead error when searching from vechai.info #2

Open nhanb opened 9 years ago

nhanb commented 9 years ago

To reproduce, search any manga title and observe that no result from vechai appears. Looking at the logs shows that a request to http://vechai.info/search/items.js has failed:

    2014-12-29 07:13:42.020 /api/search?type=name&keyword=one 200 5612ms 2kb Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0 module=default version=0-2
    E 2014-12-29 07:13:42.018 Traceback (most recent call last):
    E 2014-12-29 07:13:42.018 File "/base/data/home/apps/s~pytaku-dev/0-2.381141223263818675/pytaku/api/api.py", line 179, in _search
    E 2014-12-29 07:13:42.018 series_list = search_func(unidecode(keyword))
    E 2014-12-29 07:13:42.018 File "/base/data/home/apps/s~pytaku-dev/0-2.381141223263818675/pytaku/sites/vechai.py", line 36, in search_series
    E 2014-12-29 07:13:42.018 resp = urlfetch.fetch(url)
    E 2014-12-29 07:13:42.018 File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/urlfetch.py", line 271, in fetch
    E 2014-12-29 07:13:42.018 return rpc.get_result()
    E 2014-12-29 07:13:42.018 File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 613, in get_result
    E 2014-12-29 07:13:42.018 return self.__get_result_hook(self)
    E 2014-12-29 07:13:42.018 File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/urlfetch.py", line 414, in _get_fetch_result
    E 2014-12-29 07:13:42.018 raise DownloadError("Unable to fetch URL: " + url + error_detail)
    E 2014-12-29 07:13:42.018 DownloadError: Unable to fetch URL: http://vechai.info/search/items.js

The SDK's local devserver says it's an IncompleteRead error:

Traceback (most recent call last):
  File "/home/nhanb/Dropbox/small_projects/pytaku/pytaku/api/api.py", line 179, in _search
    series_list = search_func(unidecode(keyword))
  File "/home/nhanb/Dropbox/small_projects/pytaku/pytaku/sites/vechai.py", line 36, in search_series
    resp = urlfetch.fetch(url)
  File "/home/nhanb/google_appengine/google/appengine/api/urlfetch.py", line 271, in fetch
    return rpc.get_result()
  File "/home/nhanb/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 613, in get_result
    return self.__get_result_hook(self)
  File "/home/nhanb/google_appengine/google/appengine/api/urlfetch.py", line 414, in _get_fetch_result
    raise DownloadError("Unable to fetch URL: " + url + error_detail)
DownloadError: Unable to fetch URL: http://vechai.info/search/items.js Error: IncompleteRead(5567 bytes read)

Which, according to a blog post, can be "fixed" by patching httplib.HTTPResponse.read: http://bobrochel.blogspot.com/2010/11/bad-servers-chunked-encoding-and.html

I'll disable vechai for now until I can find a clean fix (or abandon it forever. Stupid site...)

NamPNQ commented 9 years ago
  1. Url fetch data had change to http://vechai.info/comic.js
  2. I think this bug is deadline, see https://cloud.google.com/appengine/docs/python/urlfetch/fetchfunction

We have a workaround for resolve it: