pannal / Kitana

A responsive Plex plugin web frontend
Other
501 stars 25 forks source link

500 Internal error #33

Closed TheOzzyman closed 4 years ago

TheOzzyman commented 4 years ago

I don't understand nothing about programming. But here is the error when I try to use Kitana.

500 Internal Server Error The server encountered an unexpected condition which prevented it from fulfilling the request.

Traceback (most recent call last): File "/usr/local/lib/python3.5/site-packages/cherrypy/_cprequest.py", line 638, in respond self._do_respond(path_info) File "/usr/local/lib/python3.5/site-packages/cherrypy/_cprequest.py", line 697, in _do_respond response.body = self.handler() File "/usr/local/lib/python3.5/site-packages/cherrypy/lib/encoding.py", line 219, in call self.body = self.oldhandler(*args, *kwargs) File "/usr/local/lib/python3.5/site-packages/cherrypy/_cpdispatch.py", line 54, in call return self.callable(self.args, **self.kwargs) File "kitana.py", line 489, in servers servers = self.discover_pms(server_name=server_name, server_addr=server_addr) File "kitana.py", line 406, in discover_pms https_required = device["httpsRequired"] == "1" KeyError: 'httpsRequired'

agneevX commented 4 years ago

@pannal So just git pull origin master inside the Kitana folder?

pannal commented 4 years ago

Yes or use one of the releases (binary or docker based)

agneevX commented 4 years ago

@pannal So just git pull origin master inside the Kitana folder?

Same issue :(

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request.

Traceback (most recent call last):
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 485, in wrap_socket
    cnx.do_handshake()
  File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 1808, in do_handshake
    self._raise_ssl_error(self._ssl, result)
  File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 1541, in _raise_ssl_error
    raise SysCallError(-1, "Unexpected EOF")
OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 376, in _make_request
    self._validate_conn(conn)
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
    conn.connect()
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/connection.py", line 360, in connect
    ssl_context=context,
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 370, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 491, in wrap_socket
    raise ssl.SSLError("bad handshake: %r" % e)
ssl.SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/agneev/.local/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/util/retry.py", line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='172-104-62-76.10a8fffc0ff04329a0715e0e3e3ca62e.plex.direct', port=8443): Max retries exceeded with url: /servers (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/agneev/.local/lib/python3.6/site-packages/cherrypy/_cprequest.py", line 638, in respond
    self._do_respond(path_info)
  File "/home/agneev/.local/lib/python3.6/site-packages/cherrypy/_cprequest.py", line 697, in _do_respond
    response.body = self.handler()
  File "/home/agneev/.local/lib/python3.6/site-packages/cherrypy/lib/encoding.py", line 219, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/home/agneev/.local/lib/python3.6/site-packages/cherrypy/_cpdispatch.py", line 54, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "Kitana/kitana.py", line 489, in servers
    servers = self.discover_pms(server_name=server_name, server_addr=server_addr)
  File "Kitana/kitana.py", line 453, in discover_pms
    self.session.get(self.server_addr + "servers", headers=self.full_headers, **self.req_defaults)
  File "/home/agneev/.local/lib/python3.6/site-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/home/agneev/.local/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/agneev/.local/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/home/agneev/.local/lib/python3.6/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='172-104-62-76.10a8fffc0ff04329a0715e0e3e3ca62e.plex.direct', port=8443): Max retries exceeded with url: /servers (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),))
Powered by CherryPy 18.5.0
pannal commented 4 years ago

Can you retry with the latest version, please?

Edit: Use git master, there isn't a release yet.

pannal commented 4 years ago

If it doesn't, can you please post the content of https://plex.tv/api/resources?includeHttps=1&includeRelay=1&X-Plex-Token=YOUR_PLEX_TOKEN (fill in your plex token), with sensitive information redacted, please?

agneevX commented 4 years ago

Can you retry with the latest version, please?

Recloned the repo and I'm still getting errors:

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request.

Traceback (most recent call last):
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 485, in wrap_socket
    cnx.do_handshake()
  File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 1808, in do_handshake
    self._raise_ssl_error(self._ssl, result)
  File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 1541, in _raise_ssl_error
    raise SysCallError(-1, "Unexpected EOF")
OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 376, in _make_request
    self._validate_conn(conn)
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
    conn.connect()
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/connection.py", line 360, in connect
    ssl_context=context,
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 370, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 491, in wrap_socket
    raise ssl.SSLError("bad handshake: %r" % e)
ssl.SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/agneev/.local/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/home/agneev/.local/lib/python3.6/site-packages/urllib3/util/retry.py", line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='172-104-59-203.10a8fffc0ff04329a0715e0e3e3ca62e.plex.direct', port=8443): Max retries exceeded with url: /servers (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/agneev/.local/lib/python3.6/site-packages/cherrypy/_cprequest.py", line 638, in respond
    self._do_respond(path_info)
  File "/home/agneev/.local/lib/python3.6/site-packages/cherrypy/_cprequest.py", line 697, in _do_respond
    response.body = self.handler()
  File "/home/agneev/.local/lib/python3.6/site-packages/cherrypy/lib/encoding.py", line 219, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/home/agneev/.local/lib/python3.6/site-packages/cherrypy/_cpdispatch.py", line 54, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "Kitana/kitana.py", line 489, in servers
    servers = self.discover_pms(server_name=server_name, server_addr=server_addr)
  File "Kitana/kitana.py", line 453, in discover_pms
    self.session.get(self.server_addr + "servers", headers=self.full_headers, **self.req_defaults)
  File "/home/agneev/.local/lib/python3.6/site-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/home/agneev/.local/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/agneev/.local/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/home/agneev/.local/lib/python3.6/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='172-104-59-203.10a8fffc0ff04329a0715e0e3e3ca62e.plex.direct', port=8443): Max retries exceeded with url: /servers (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),))
Powered by CherryPy 18.5.0

If it doesn't, can you please post the content of

<MediaContainer size="3">
<Device name="Plex Server" product="Plex Media Server" productVersion="1.18.8.2527-740d4c206" platform="Linux" platformVersion="10 (buster)" device="PC" clientIdentifier="xxxxx" createdAt="1572869965" lastSeenAt="1584851700" provides="server" owned="1" accessToken="xxxxx" publicAddress="xxxxx" httpsRequired="0" synced="0" relay="1" dnsRebindingProtection="0" natLoopbackSupported="0" publicAddressMatches="1" presence="1">
<Connection protocol="https" address="10.0.0.2" port="32400" uri="https://xxxxx.plex.direct:32400" local="1"/>
<Connection protocol="https" address="xxxxx" port="25979" uri="xxxxx.plex.direct:25979" local="0"/>
<Connection protocol="https" address="xxxxx" port="8443" uri="xxxxx.plex.direct:8443" local="0" relay="1"/>
</Device>
pannal commented 4 years ago

And does the non-relay connection work? Why do you select the one with port 8443?

agneevX commented 4 years ago

And does the non-relay connection work? Why do you select the one with port 8443?

Of course not. My public IP is NATed, hence Plex Relay.

pannal commented 4 years ago

Can you try a pip3 install ndg-httpsclient + a restart of Kitana?

pannal commented 4 years ago

Of course not. My public IP is NATed, hence Plex Relay.

OK and Kitana can't run on the machine or the network of the PMS?

agneevX commented 4 years ago

Can you try a pip3 install ndg-httpsclient + a restart of Kitana?

Yep that's working.

OK and Kitana can't run on the machine or the network of the PMS?

That's what I'm doing now but its good to be able to access plugins remotely plus negates the need for setting up fake domain names in hosts :)

Also can you add an example systemd unit file config somewhere?

ukdtom commented 4 years ago

If it doesn't, can you please post the content of https://plex.tv/api/resources?includeHttps=1&includeRelay=1&X-Plex-Token=YOUR_PLEX_TOKEN (fill in your plex token), with sensitive information redacted, please?

For future versions, better make that call:

https://plex.tv/api/v2/resources?includeHttps=1&includeRelay=1&X-Plex-Client-Identifier=test&X-Plex-Token=XXXYYYZZZ

Notice v2 in the url, as well as the X-Plex-Client-Identifier is req.