Server unavailable

Server Version#: 1.40.5.8921
Player Version#: 10.20.0.1427

Started noticing an issue that is happening more lately. My server goes unavailable locally.

It will show up eventually and work when streaming. But now seems the menu will be randomly broken. I’ll have the art work for 3 or 4 video as I scroll the same 3 or 4 videos show up. Or my clients just cant find the server. My clients are Nvidia shields.

My server is a PC running linux with an i9 13900 cpu. I have roughly 1500 movies in my library. When downloading logs what is the typical log file to look in? do you just grep for ERROR in plex media server.log or do you search all of them?

2024-09-11 19:49:39,030 (1507737d2808) :  DEBUG (proxyservice:12) - Starting the proxy service
2024-09-11 19:49:39,031 (15076fff5b38) :  DEBUG (runtime:1117) - Created a thread named 'ensure_agent_info_exists_inner'
2024-09-11 19:49:39,032 (15076ffafb38) :  CRITICAL (runtime:1128) - Exception in thread named 'refresh_servers' (most recent call last):
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-836b34c27/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 1126, in _start_thread
    f(*args, **kwargs)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-836b34c27/System.bundle/Contents/Code/peerservice.py", line 169, in refresh_servers
    servers_el = self.get_servers_el()
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-836b34c27/System.bundle/Contents/Code/peerservice.py", line 165, in get_servers_el
    return XML.ElementFromURL('http://127.0.0.1:32400/servers', cacheTime = 0)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-836b34c27/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/parsekit.py", line 344, in ElementFromURL
    method=method,
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-836b34c27/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/networkkit.py", line 67, in _http_request
    req = self._core.networking.http_request(url, *args, **kwargs)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-836b34c27/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 352, in http_request
    return HTTPRequest(self._core, url, data, h, url_cache, encoding, errors, timeout, immediate, sleep, opener, follow_redirects, method)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-836b34c27/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 119, in __init__
    self.load()
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-836b34c27/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 159, in load
    f = self._opener.open(req, timeout=self._timeout)
  File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 556, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 503: Service Unavailable


DEBUG (networking:144) - Requesting 'http://resources-cdn.plexapp.com/hashes.json'
2024-09-11 19:49:41,809 (15076ffd2b38) :  ERROR (networking:197) - Error opening URL 'http://resources-cdn.plexapp.com/hashes.json'
2024-09-11 19:49:41,809 (15076ffd2b38) :  CRITICAL (runtime:1299) - Exception getting hosted resource hashes (most recent call last):
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-836b34c27/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 1291, in get_resource_hashes
    json = self._core.networking.http_request("http://resources-cdn.plexapp.com/hashes.json", timeout=5).content
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-836b34c27/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 243, in content
    return self.__str__()
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-836b34c27/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 221, in __str__
    self.load()
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-836b34c27/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 159, in load
    f = self._opener.open(req, timeout=self._timeout)
  File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/plexmediaserver/Resources/Python/python27.zip/urllib2.py", line 556, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found

Having the full DEBUG logs ZIP (not just error) allows us to see what it was doing.
Also, certain statements and errors show as WARNING when they’re really error.

If you can change to DEBUG logging, Restart PMS, then download the logs ZIP from PMS (or make a tar.gz of the Logs directory when it’s failing) that would be much more helpful.

@xokia

Got your files. Reviewing now.
Good thinking on your part !

@xokia

I found one major problem…

You’re using your own domain but haven’t told Plex it’s your domain

If you’re using a self-signed cert, then that won’t work.
PMS requires genuine CA-signed certificates.

Sep 11, 2024 19:53:22.684 [23191636482872] DEBUG - Request came in with unrecognized domain / IP ‘plex.xxxxxxxxx.com’ in header Host; treating as non-local

For your certificate to work,

  1. Cert,
  2. Key,
  3. CA of the issuing agency (e.g Let’s Encrypt, etc)

All these must be in the P12 file.

Put the P12 somewhere Plex can read it.
( I usually put it in /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache with the other certs but the choice is yours. )

You then go to Settings - Server - Show Advanced - Add and give it the info about the cert file (Path and Password)

As you save it, PMS will authenticate the cert and add it.

I use swag as a reverse proxy so swag handles the certificate. I use a wildcard certificate.
so the website would be xxxxxxxxxxx.com and I have DNS forwarding for plex.xxxxxxxx.com doesnt seem to change anything

/swag-ssl is the container path on the host it points to the certificate in the swag docker container.

Reverse proxies are a PITA with PMS.

PMS will see the “Referred” entries in the header.
This is what it’s triggering on and complaining about.

PMS is considering this to be a MITM attack and won’t accept the connection.

On my machine,

  1. My cert is from L.E.
  2. CloudFlare does the WAN DNS
  3. PfSense manages the LAN DNS in all regards,
  4. When a request, resolved to IP by CloudFlare, comes to my pfsense,
    – It sees the domain name in the request
    – It does simple port forwarding (key here) to the PMS port
  5. PMS sees my FQDN reference in the header and
  6. Having accepted & loaded the L.E. cert
  7. Allows entry where PMS then switches to using the plex.direct domain which it requires.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.