Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 Internal error #33

Closed
TheOzzyman opened this issue Mar 15, 2020 · 12 comments
Closed

500 Internal error #33

TheOzzyman opened this issue Mar 15, 2020 · 12 comments

Comments

@TheOzzyman
Copy link

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'

@pannal pannal closed this as completed in a94edff Mar 15, 2020
@agneevX
Copy link

agneevX commented Mar 17, 2020

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

@pannal
Copy link
Owner

pannal commented Mar 17, 2020

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

@agneevX
Copy link

agneevX commented Mar 17, 2020

@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 added a commit that referenced this issue Mar 22, 2020
This reverts commit a94edff
pannal added a commit that referenced this issue Mar 22, 2020
@pannal
Copy link
Owner

pannal commented Mar 22, 2020

Can you retry with the latest version, please?

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

@pannal pannal reopened this Mar 22, 2020
@pannal
Copy link
Owner

pannal commented Mar 22, 2020

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
Copy link

agneevX commented Mar 22, 2020

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
Copy link
Owner

pannal commented Mar 22, 2020

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

@agneevX
Copy link

agneevX commented Mar 23, 2020

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
Copy link
Owner

pannal commented Mar 23, 2020

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

@pannal
Copy link
Owner

pannal commented Mar 23, 2020

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
Copy link

agneevX commented Mar 23, 2020

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?

@pannal pannal closed this as completed in 56598d7 Mar 28, 2020
@ukdtom
Copy link

ukdtom commented Mar 28, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants