z411 / trackma

Open multi-site list manager for Unix-like systems. (ex-wMAL)
https://z411.github.io/trackma
GNU General Public License v3.0
761 stars 82 forks source link

trackma crashes at startup with "Remote end closed connection without response" #680

Open v-fox opened 1 year ago

v-fox commented 1 year ago

While changing an episode count on one series trackma crashed and does so on every startup now with:

libanilist: Downloading list...
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/trackma/ui/qt/workers.py", line 181, in run
    ret = self.function(*self.args, **self.kwargs)
  File "/usr/lib/python3.10/site-packages/trackma/ui/qt/workers.py", line 157, in _start
    self.engine.start()
  File "/usr/lib/python3.10/site-packages/trackma/engine.py", line 249, in start
    (self.api_info, self.mediainfo) = self.data_handler.start()
  File "/usr/lib/python3.10/site-packages/trackma/data.py", line 178, in start
    self.download_data()
  File "/usr/lib/python3.10/site-packages/trackma/data.py", line 548, in download_data
    self.showlist = self.api.fetch_list()
  File "/usr/lib/python3.10/site-packages/trackma/lib/libanilist.py", line 268, in fetch_list
    data = self._request(query, variables)['data']['MediaListCollection']
  File "/usr/lib/python3.10/site-packages/trackma/lib/libanilist.py", line 202, in _request
    return self._raw_request('POST', self.query_url, jsonpost=data, auth=True)
  File "/usr/lib/python3.10/site-packages/trackma/lib/libanilist.py", line 184, in _raw_request
    response = self.opener.open(request, timeout=10)
  File "/usr/lib64/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/usr/lib64/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib64/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/usr/lib64/python3.10/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/lib64/python3.10/urllib/request.py", line 1352, in do_open
    r = h.getresponse()
  File "/usr/lib64/python3.10/http/client.py", line 1374, in getresponse
    response.begin()
  File "/usr/lib64/python3.10/http/client.py", line 318, in begin
    version, status, reason = self._read_status()
  File "/usr/lib64/python3.10/http/client.py", line 287, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
[1]    26172 IOT instruction (core dumped)  trackma-qt

At the same time I couldn't open https://anilist.co in a browser directly until enabling Tor's proxy once. So I suspect shenanigans from their admin, hoster or my ISP. But trackma still gives out same error. Running PROXY_ENABLED=yes HTTP_PROXY="127.0.0.1:8080" HTTPS_PROXY="127.0.0.1:8080" trackma-qt (where the address is tor-socks5->privoxy-http gateway) works around that and starts it up.

Either way, trackma should allow at least browsing local lists on connectivity loss instead of just crashing.

z411 commented 1 year ago

Either way, trackma should allow at least browsing local lists on connectivity loss instead of just crashing.

It should. If it's trying to retrieve your list either your autoretrieve time passed or it never got to download the list at all. That said, you're right, an http error should be handled as an APIError (which should get seen as a warning by the Engine).