asciidisco / plugin.video.netflix

Inputstream based Netflix plugin for Kodi
MIT License
1.24k stars 226 forks source link

No status line received - the server has closed the connection #709

Closed Houndie closed 4 years ago

Houndie commented 5 years ago

I'm submitting a ...

General infomration

Netflix logs in correctly, and lists users. Selecting a user results in an error message that suggests looking at the log for more information.

Prerequisites

Description

Log presents this information:

2019-08-25 12:22:58.806 T:139716896749312   ERROR: Traceback (most recent call last):
2019-08-25 12:22:58.806 T:139716896749312   ERROR:   File "/usr/lib/python2.7/SocketServer.py", line 293, in _handle_request_noblock
2019-08-25 12:22:58.806 T:139716896749312   ERROR:     self.process_request(request, client_address)
2019-08-25 12:22:58.806 T:139716896749312   ERROR:   File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
2019-08-25 12:22:58.806 T:139716896749312   ERROR:     self.finish_request(request, client_address)
2019-08-25 12:22:58.806 T:139716896749312   ERROR:   File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
2019-08-25 12:22:58.806 T:139716896749312   ERROR:     self.RequestHandlerClass(request, client_address, self)
2019-08-25 12:22:58.806 T:139716896749312   ERROR:   File "/usr/lib/python2.7/SocketServer.py", line 655, in __init__
2019-08-25 12:22:58.806 T:139716896749312   ERROR:     self.handle()
2019-08-25 12:22:58.806 T:139716896749312   ERROR:   File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
2019-08-25 12:22:58.806 T:139716896749312   ERROR:     self.handle_one_request()
2019-08-25 12:22:58.806 T:139716896749312   ERROR:   File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
2019-08-25 12:22:58.806 T:139716896749312   ERROR:     method()
2019-08-25 12:22:58.806 T:139716896749312   ERROR:   File "/home/xbmc//.kodi/addons/plugin.video.netflix/resources/lib/NetflixHttpRequestHandler.py", line 50, in do_GET
2019-08-25 12:22:58.806 T:139716896749312   ERROR:     result = getattr(self.server.res_handler, method)(params)
2019-08-25 12:22:58.806 T:139716896749312   ERROR:   File "/home/xbmc//.kodi/addons/plugin.video.netflix/resources/lib/NetflixHttpSubRessourceHandler.py", line 343, in switch_profile
2019-08-25 12:22:58.806 T:139716896749312   ERROR:     account=self.credentials)
2019-08-25 12:22:58.806 T:139716896749312   ERROR:   File "/home/xbmc//.kodi/addons/plugin.video.netflix/resources/lib/NetflixSession.py", line 365, in switch_profile
2019-08-25 12:22:58.806 T:139716896749312   ERROR:     params=payload)
2019-08-25 12:22:58.806 T:139716896749312   ERROR:   File "/home/xbmc//.kodi/addons/plugin.video.netflix/resources/lib/NetflixSession.py", line 2044, in _session_get
2019-08-25 12:22:58.806 T:139716896749312   ERROR:     url = self._get_api_url_for(component=component)
2019-08-25 12:22:58.806 T:139716896749312   ERROR:   File "/home/xbmc//.kodi/addons/plugin.video.netflix/resources/lib/NetflixSession.py", line 1738, in _get_api_url_for
2019-08-25 12:22:58.806 T:139716896749312   ERROR:     has_base_url = api_root.find(base_url) > -1
2019-08-25 12:22:58.806 T:139716896749312   ERROR: TypeError: coercing to Unicode: need string or buffer, NoneType found
2019-08-25 12:22:58.808 T:139718197524224   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                            Error Type: <class 'httplib.BadStatusLine'>
                                            Error Contents: No status line received - the server has closed the connection
                                            Traceback (most recent call last):
                                              File "/home/xbmc//.kodi/addons/plugin.video.netflix/addon.py", line 33, in <module>
                                                NAVIGATION.router(paramstring=REQUEST_PARAMS)
                                              File "/home/xbmc//.kodi/addons/plugin.video.netflix/resources/lib/utils.py", line 60, in wrapped
                                                result = func(*args, **kwargs)
                                              File "/home/xbmc//.kodi/addons/plugin.video.netflix/resources/lib/Navigation.py", line 123, in router
                                                options = self.before_routing_action(params=params)
                                              File "/home/xbmc//.kodi/addons/plugin.video.netflix/resources/lib/utils.py", line 60, in wrapped
                                                result = func(*args, **kwargs)
                                              File "/home/xbmc//.kodi/addons/plugin.video.netflix/resources/lib/Navigation.py", line 901, in before_routing_action
                                                'profile_id': profile_id})
                                              File "/home/xbmc//.kodi/addons/plugin.video.netflix/resources/lib/Navigation.py", line 1053, in call_netflix_service
                                                data = urllib2.urlopen(full_url).read()
                                              File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
                                                return opener.open(url, data, 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 1201, in do_open
                                                r = h.getresponse(buffering=True)
                                              File "/usr/lib/python2.7/httplib.py", line 1121, in getresponse
                                                response.begin()
                                              File "/usr/lib/python2.7/httplib.py", line 438, in begin
                                                version, status, reason = self._read_status()
                                              File "/usr/lib/python2.7/httplib.py", line 402, in _read_status
                                                raise BadStatusLine("No status line received - the server has closed the connection")
                                            BadStatusLine: No status line received - the server has closed the connection
                                            -->End of Python script error report<--
2019-08-25 12:22:58.877 T:139718197524224 WARNING: CPythonInvoker(18, /home/xbmc//.kodi/addons/plugin.video.netflix/addon.py): the python script "/home/xbmc//.kodi/addons/plugin.video.netflix/addon.py" has left several classes in memory that we couldn't clean up. The classes include: N9XBMCAddon9xbmcaddon5AddonE
2019-08-25 12:22:58.879 T:139716888356608   ERROR: GetDirectory - Error getting plugin://plugin.video.netflix/?action=video_lists&profile_id=43OK53VFYBDRNIXCRUGFRCVFJY
2019-08-25 12:22:58.881 T:139718342654656   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.netflix/?action=video_lists&profile_id=43OK53VFYBDRNIXCRUGFRCVFJY) failed

Other addons (including those which access the internet) work correctly, and I can access the internet on this computer just fine, which suggests that something is malformed with the request.

Steps to Reproduce

Open Netflix Addon Sign in Select user Receive error message

Expected behavior: Continue to search for videos

Actual behavior: Error message, no forward progress

Context (Environment)

Kodi 18.3 Arch Linux (up to date)

Installation

Operating System

Additional informatin on the environment

Arch linux, kernel 6.2.9.arch1-1-x86_64 python2.7 and python 3.7.4

Debug log

https://pastebin.com/CR7qpWnS

zarianu commented 4 years ago

Got same issues on my LibreELEC on Raspberry PI, could provide some details if needed.

wonder75 commented 4 years ago

Same problem here. Crashes after selecting the user. Libreelec on Raspberry Pi. I deleted the userdata directory, reinstalled the plugin, rebooted several times. Sadly nothing helped.

cpresser commented 4 years ago

I did debug this, and figured its already fixed in this commit: https://github.com/asciidisco/plugin.video.netflix/commit/34c8910b94e57127b2ebfc46bbbac5f7a8588341 The current release does include this fix. https://github.com/asciidisco/plugin.video.netflix/releases/tag/0.13.23 So the solution is to update the plugin.

However, for some reason the update mechanism inside kodi did not give me the newest version. I had to to it manually. I did not further investigate why the update failed, I was to lazy for that.

zarianu commented 4 years ago

@cpresser thanks for this tip, worked like a charm! (installed latest release from .zip and did logout/login)

Houndie commented 4 years ago

Sorry for taking so long to get back to this, real life got in the way once again.

It does look like the problem has been fixed.

However, it also appears that this project has been abandoned, and that https://github.com/CastagnaIT/plugin.video.netflix/ is the follow up project. Explains why install from repository didn't work.

Either way, seems sane to close the ticket at this point :-)