RemiRigal / Plex-Auto-Languages

Automated language selection for Plex TV Shows !
MIT License
406 stars 15 forks source link

When plex dies PlexAutoLanguages is frozen forever. #91

Open ChristianMalazarte opened 10 months ago

ChristianMalazarte commented 10 months ago

So I'm getting this error sometimes when Plex connection times out:

2023-08-31 20:43:45,797 [WARNING] The Plex server closed the websocket connection
2023-08-31 20:43:45,838 [ERROR] Unable to process timeline
  File "/app/plex_auto_languages/plex_alert_handler.py", line 66, in _process_alerts
    alert.process(self._plex)
  File "/app/plex_auto_languages/alerts/timeline.py", line 52, in process
    item = plex.fetch_item(self.item_id)
  File "/app/plex_auto_languages/plex_server.py", line 57, in fetch_item
    return self._plex.fetchItem(item_id)
  File "/usr/local/lib/python3.8/site-packages/plexapi/base.py", line 295, in fetchItem
    return self.fetchItems(ekey, cls, **kwargs)[0]
  File "/usr/local/lib/python3.8/site-packages/plexapi/base.py", line 243, in fetchItems
    data = self._server.query(ekey, headers=headers)
  File "/usr/local/lib/python3.8/site-packages/plexapi/server.py", line 756, in query
    raise BadRequest(message)
</html>nter>nginx/1.22.1</center>/center>d>eway;

The only way to fix it is to issue a docker restart container command.

eandrade92630 commented 8 months ago

If you use docker you could do a health check on Plex and if there's no response or it responds with exit code 1 autoheal will restart the container.

edrock200 commented 4 months ago

Just make sure to add "autoheal=true" label to pal container

capssicum commented 3 months ago

Just make sure to add "autoheal=true" label to pal container

how to add this in docker compose please ?

capssicum commented 3 months ago

If you use docker you could do a health check on Plex and if there's no response or it responds with exit code 1 autoheal will restart the container.

kindly how to add it to docker compose health check , will u please write it in order to copy and paste it to my docker compose file ?

tronyx commented 3 months ago

Already an issue for this problem: https://github.com/RemiRigal/Plex-Auto-Languages/issues/56